Skip to main content

Credit — type: "win"

POST{base}/transaction

Money arriving in the balance: a bet that won, or a cashout the player accepted.

Same {base}/transaction address as Debit, same response shape, same duplicate protection. Three things differ.

Request​

FieldSentRule
typealwayswin.
amountalwaysWhat the player receives, in full. Positive.
currencyalwaysISO 4217.
referencealwaysYour idempotency key, unique to this payout — not the bet's.
parentReferencealwaysThe reference of the bet being paid. This is what ties a payout to its stake in your ledger.
playerIdon service-key callsYour externalId. A cashout the player accepted carries their own Bearer instead, and then playerId is absent.
simulationconnection test onlytrue marks a connection test: ignore it, answer success, move no money.
betalwaysThe settled ticket, whole — the shape Debit defines. Here id, payout and settledAt are set, status is WON or CASHED_OUT, and each leg's own status says how it came in.

What differs from a debit​

  1. The Bearer is your service key. A settlement happens hours after the player closed the tab — there is no session, so the request names the player outright.
  2. 402 is not an answer. We are handing money over. Any status other than 200 is a provider error; the Debit table applies otherwise.
  3. We retry. A payout you refuse is still owed. Refusing postpones a settlement, it does not cancel one — which makes retries the normal path here, not the exception. The same reference must pay once.
POST {base}/transaction
Authorization: Bearer <your service key>
Content-Type: application/json
{
"type": "win",
"amount": 25.00,
"currency": "USD",
"reference": "payout_3b7d0c11",
"parentReference": "bet_9f2c1e4a",
"playerId": "10",
"bet": {
"id": "68a0f1c2d3e4f5a6b7c8d9e0",
"kind": "SINGLE",
"status": "WON",
"stake": 10.00,
"totalStake": 10.00,
"totalOdds": 2.50,
"potentialPayout": 25.00,
"payout": 25.00,
"system": null,
"placedAt": "2026-08-16T15:04:05.000Z",
"settledAt": "2026-08-16T21:52:10.000Z",
"selections": [
{
"fixture": {
"id": "11223344",
"name": "Real Madrid vs Barcelona",
"startDate": "2026-08-16T19:00:00.000Z"
},
"sport": { "id": "6046", "name": "Football" },
"league": { "id": "38", "name": "LaLiga" },
"market": { "id": "1", "name": "1X2" },
"selection": { "id": "271", "name": "Real Madrid", "line": null },
"price": 2.50,
"status": "WON"
}
]
}
}
curl -s -X POST "https://casino.example.com/api/sportsbook/transaction" \
-H "Authorization: Bearer <your service key>" \
-H "Content-Type: application/json" \
-d '{
"type": "win",
"amount": 25.00,
"currency": "USD",
"reference": "payout_3b7d0c11",
"parentReference": "bet_9f2c1e4a",
"playerId": "10",
"bet": {
"id": "68a0f1c2d3e4f5a6b7c8d9e0",
"kind": "SINGLE",
"status": "WON",
"stake": 10.00,
"totalStake": 10.00,
"totalOdds": 2.50,
"potentialPayout": 25.00,
"payout": 25.00,
"system": null,
"placedAt": "2026-08-16T15:04:05.000Z",
"settledAt": "2026-08-16T21:52:10.000Z",
"selections": [
{
"fixture": {
"id": "11223344",
"name": "Real Madrid vs Barcelona",
"startDate": "2026-08-16T19:00:00.000Z"
},
"sport": { "id": "6046", "name": "Football" },
"league": { "id": "38", "name": "LaLiga" },
"market": { "id": "1", "name": "1X2" },
"selection": { "id": "271", "name": "Real Madrid", "line": null },
"price": 2.50,
"status": "WON"
}
]
}
}'

Next: Prize — paying a bet race's winners.