Appearance
Rollback
PUT https://{PARTNER_API_URL}/payment/bet with type: 3
This request will be performed in case of the following errors during Place bet call or control stage before accepting the bet.
In addition to errors during the initial Place bet request, a Rollback may also be triggered if, at the final stage of processing, system determines that the bet cannot be completed. This may happen even if the Place bet request was initially accepted by the partner's system. Rollback requests are sent under the following conditions:
- Errors During Place Bet Request:
- You've responded with HTTP status code
400and error code100System error. - Your server returned HTTP status code other than
200or400. - Your system haven't respond to our request within the 5s timeout.
- Control stage before accepting the bet:
- Event Completion: The event associated with the bet has ended, making it invalid for new bets.
- Odds Change: The odds for the event have changed since the Place bet request, leading to a misalignment with the original bet terms.
- Event Withdrawn from Trading: The event has been removed from trading, invalidating any pending bets on it.
- Limit Exceeded: The bet fails to meet the set betting limits.
When you receive a request you should perform the following actions on your side:
- Check that the method is
PUTand thetype === 3 - Verify request signature.
- Find the bet in your system by
transactionId(this id initially was sent with place bet request). - If the bet is found, you should cancel it and refund the amount back to the user.
WARNING
Please double-check that your system won't refund the same bet twice!
WARNING
For systems designed on an event-driven architecture with asynchronous processing, Rollback requests may arrive before the corresponding Place bet request has been fully processed from the queue. This creates a potential race condition between the two requests.
Request examples
The request data contains all common parameters for Place bet with following additions:
typevalue is3.errorCodefield of type int to specify the exact reason for the rollback. Below are the possible:- 8: Odds have changed.
- 9: Event has already completed.
- 10: Request timeout on partner system.
- 32: Event has been withdrawn from trading.
- 50: Technical issues occurred while closing the bet.
- 52: Technical issues on the partner’s side.
- 110: Exceeded outcome limit for maximum bet.
- 111: Exceeded outcome limit for win bet.
- 112: Exceeded number of bets allowed on the event.
- 113: Exceeded player limit for maximum bet.
- 114: Exceeded player limit for maximum win.
- 115: Exceeded main betting limit.
json
{
"transactionId": "f067f2c2-0126-437d-b28f-df63466e482d",
"currency": "USD",
"amount": 1,
"userId": "ee84b55e-8dc3-4381-b97f-56507723e8dd",
"type": 3,
"coefficient": 1,
"token": "5caa4cabce523c2f7610c50ce9819bfc",
"requestId": "c687d8b8-5fbb-43c2-ac91-95b93f353770",
"bonusId": null,
"bonusTemplateId": null,
"gameType": "sportsbook",
"errorCode": 9,
"boosterCoefficient": 1,
"ticketType": "single",
"bonusAmount": null
}As a response we are expecting to get the same format as for Place bet request.
You should respond positively (HTTP status code 200) in the following cases:
- There is no bet found in your system and there is no need for a return of funds to a user.
- The bet occurred and you have successfully returned the money back to a user.
- The bet occurred and the money was returned to user during previous Rollback request and therefore this Rollback request can be safely skipped.
Retry Mechanism for Rollback Requests
If a Rollback request fails, the system will automatically retry up to 10 times over a 6-minute period, exponentially increasing the time interval between attempts. Here are the main aspects of the retry functionality:
Retry Conditions:
A retry is triggered if the initial Rollback request fails due to:
- No response received within the 5-second timeout.
- A response with an HTTP status code other than 200 or 400.
- Success Criteria:
The system will consider the Rollback request successfully processed and stop retries under either of the following conditions:
- The partner's server returns HTTP status code 200 with a response body in the following format:
json
{
"transactionId": "225450d5-01bb-455e-b513-7acf4451de",
"transactionTime": "2024-09-28T17:12:04.231406Z"
}- The partner's server responds with HTTP status code 400 and a body indicating that the bet has already been processed:
json
{
"code": 8,
"message": "The bet has already been processed"
}Here, code 8 signifies that the rollback request was already handled, so our system treats this as a successfully processed rollback.
This retry mechanism enhances the reliability of the Rollback process, giving multiple chances for a successful rollback even in case of transient errors or temporary unavailability of the partner’s system.