Skip to main content

Rollback — type: "rollback"

POST{base}/transaction

Returns a stake and always names the movement it reverses.

We send one when
We took the stake and could not record the betThe ticket never existed. Arrives seconds after the debit.
The event was voided or the bet cancelledThe stake goes back; there is no payout.
A settlement is correctedThe wrong movement is reversed before the right one is applied.

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

Request​

FieldSentRule
typealwaysrollback.
amountalwaysWhat goes back, positive. The amount of the movement being reversed.
currencyalwaysISO 4217.
referencealwaysYour idempotency key, unique to this rollback.
parentReferencealwaysThe reference of the movement being undone. Without it a rollback is an unexplained credit in your ledger.
playerIdon service-key callsYour externalId.
simulationconnection test onlytrue marks a connection test: ignore it, answer success, move no money.
betalwaysThe ticket being unwound — the shape Debit defines. On a voided ticket status is REFUND and payout is the stake going back; on the refund of a bet we could not record, id is still null and status still PENDING, exactly as the debit sent it.

Never​

  1. Never answer 402. A rollback returns money; there is no balance to lack.
  2. Never apply twice. The same reference replays the stored result. Twice hands the player a stake they never placed.
  3. Never error on an unknown parentReference. If you have no record of the movement — you were unreachable, we timed out — answer 200 with the current balance. Nothing to undo is not a failure, and erroring makes us retry a movement that never happened.
POST {base}/transaction
Authorization: Bearer <player token | your service key>
Content-Type: application/json
{
"type": "rollback",
"amount": 10.00,
"currency": "USD",
"reference": "rb_5c8e2f90",
"parentReference": "bet_9f2c1e4a",
"playerId": "10",
"bet": {
"id": "68a0f1c2d3e4f5a6b7c8d9e0",
"kind": "SINGLE",
"status": "REFUND",
"stake": 10.00,
"totalStake": 10.00,
"totalOdds": 2.10,
"potentialPayout": 21.00,
"payout": 10.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.10,
"status": "REFUND"
}
]
}
}
curl -s -X POST "https://casino.example.com/api/sportsbook/transaction" \
-H "Authorization: Bearer <your service key>" \
-H "Content-Type: application/json" \
-d '{
"type": "rollback",
"amount": 10.00,
"currency": "USD",
"reference": "rb_5c8e2f90",
"parentReference": "bet_9f2c1e4a",
"playerId": "10",
"bet": {
"id": "68a0f1c2d3e4f5a6b7c8d9e0",
"kind": "SINGLE",
"status": "REFUND",
"stake": 10.00,
"totalStake": 10.00,
"totalOdds": 2.10,
"potentialPayout": 21.00,
"payout": 10.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.10,
"status": "REFUND"
}
]
}
}'