SyncCredit API Common Payload Structure
All types use the samedt/callback/sync_credit API with the following payload format:
Key Differences by Type
| Type | credit Direction | canceled_id | Special Handling |
|---|---|---|---|
| 8 Payout | Positive (win) or 0 (lose) | Empty | Normal settlement, includes win/loss amount |
| 10 Round Recalculation | Difference (can be positive or negative) | Empty | Due to on-site anomaly, system backend adjusts original payout difference |
| 11 Cancel Round | Positive (refund bet) | Empty | Due to on-site anomaly, system backend refunds all bets for the round |
| 12 Add Order | Positive for win, negative for lose (win/loss value) | Empty | Due to on-site anomaly, system backend adds order, directly in settled status |
| 13 Cancel Order | Positive (refund bet) | Empty | Due to on-site anomaly, system backend cancels order |
| 23 Bet Failure Refund | Positive | Original transaction ID | Betting party did not receive bet response, transaction invalid. You need to verify if original transaction ID had a deduction, and rollback if so |
| 26 Modify Order | Difference (can be positive or negative) | Empty | 1. Only for traditional orders, due to on-site anomaly, system backend modifies order 2. Used to update hedge valid bet amount |
| 29 Credit Rollback | Positive | Original transaction ID | General rollback mechanism for scenarios like tip failure, similar to type 23, means betting party did not receive deduction response, transaction invalid, you need to verify if original transaction ID had a deduction, and rollback if so |
Additional Note: Type 26 Hedge Sync Mechanism
In Test Case 1, Payout (Type 8) and Round Recalculation (Type 10) are accompanied by additional Type 26 (credit=0) records. This is due to the Hedge Calculation mechanism.Trigger Conditions
When a player has hedge bets in the same round (e.g., betting on both Banker and Player), the system automatically generates Type 26 records during payout or recalculation:| Game Type | Hedge Play Types |
|---|---|
| Baccarat (BAC) / Niu Niu (NIU) | playtype 1 (Banker) ↔ playtype 2 (Player) |
| Roulette (ROU) | playtype 151-156 are mutual hedges |
| Dragon Tiger (DTB) | Multiple hedge play types (1↔2, 4↔5, 6↔7, 8↔9, 10↔11) |
Logic Description
When processing payouts/recalculations for orders with hedge bets, the system will:- Check if hedge orders exist in the same round
- If hedges exist, recalculate valid_amount for both sides
- Insert Type 26 record to notify seamless wallet of valid_amount changes
Type 26 Hedge Sync Fields
| Field | Value | Description |
|---|---|---|
type | 26 | Modify order |
credit | Fixed at 0 | Does not affect credit, only syncs valid bet amount |
valid_amount | Adjusted value | Recalculated valid bet amount |
Example
In Case 1, betting “100 on Banker” and “100 on Player” simultaneously creates a hedge:- Processing Banker (playtype=1) payout → generates Player’s Type 26 (credit=0)
- Processing Player (playtype=2) payout → generates Banker’s Type 26 (credit=0)
Test Cases
Case 1: Normal Flow → Round Recalculation → Cancel Round
Covered Types: 8 Payout, 10 Round Recalculation, 11 Cancel Round Card Settings:- Original result (Banker wins): Player [♠ 2, ♥3] = 5 points, Banker [♦K, ♣9] = 9 points → Banker Wins
- Recalculated result (Player wins): Player [♠ 9, ♥8] = 7 points, Banker [♦4, ♣2] = 6 points → Player Wins
| Step | Action | Type | credit | Description |
|---|---|---|---|---|
| 1 | Bet 100 on Banker | 7 | -100 | Deduction |
| 2 | Bet 100 on Player | 7 | -100 | Deduction |
| 3 | Result: Banker wins, Payout | 8 | +200 | Banker bet wins (1:1, return principal + winnings) |
| 4 | (same round) | 8 | 0 | Player bet loses |
| 5 | Backend recalculates to Player wins | 10 | -200 | Banker (originally won becomes lost, deduct payout) |
| 6 | (same round) | 10 | +200 | Player (originally lost becomes won, issue payout) |
| 7 | Backend cancels round | 11 | +100 | Refund Banker bet |
| 8 | (same round) | 11 | +100 | Refund Player bet |
Steps 1-2: Bet Deduction (Type 7)
Steps 1-2: Bet Deduction (Type 7)
Steps 3-4: Payout (Type 8) + Hedge Sync (Type 26)
Steps 3-4: Payout (Type 8) + Hedge Sync (Type 26)
The following is a single API request with multiple Objects in the
info array, process them in order.Steps 5-6: Round Recalculation (Type 10) + Hedge Sync (Type 26)
Steps 5-6: Round Recalculation (Type 10) + Hedge Sync (Type 26)
The following is a single API request with multiple Objects in the
info array, process them in order.Steps 7-8: Cancel Round (Type 11) + Hedge Sync (Type 26)
Steps 7-8: Cancel Round (Type 11) + Hedge Sync (Type 26)
The following is a single API request with multiple Objects in the
info array, process them in order.Case 2: Normal Flow → Cancel Order
Covered Types: 8 Payout, 13 Cancel Order Card Settings:- Result (Banker wins): Player [♠ 4, ♥2] = 6 points, Banker [♦7, ♣K] = 7 points → Banker Wins
| Step | Action | Type | credit | Description |
|---|---|---|---|---|
| 1 | Bet 100 on Banker | 7 | -100 | Deduction |
| 2 | Result: Banker wins, Payout | 8 | +200 | Win (1:1, return principal + winnings) |
| 3 | Backend cancels order | 13 | -100 | Deduct difference (paid 200 - refund bet 100 = deduct 100) |
Step 1: Bet Deduction (Type 7)
Step 1: Bet Deduction (Type 7)
Step 2: Payout (Type 8)
Step 2: Payout (Type 8)
Step 3: Cancel Order (Type 13)
Step 3: Cancel Order (Type 13)
Case 3: Bet → Bet Failure Refund
Covered Types: 23 Bet Failure Refund| Step | Action | Type | credit | canceled_id |
|---|---|---|---|---|
| 1 | Bet 100 (simulate no response received) | 7 | -100 | - |
| 2 | Trigger bet failure refund | 23 | +100 | Step 1’s transaction ID |
Step 1: Bet Deduction (Type 7)
Step 1: Bet Deduction (Type 7)
Step 2: Bet Failure Refund (Type 23)
Step 2: Bet Failure Refund (Type 23)
Test Summary
| Case | Covered Types |
|---|---|
| Case 1 | 8, 10, 11, 26 |
| Case 2 | 8, 13 |
| Case 3 | 23 |