Appearance
Settle
PUT https://{PARTNER_API_URL}/payment/bet with type: 2
This request will be performed when our system calculates result and payout for previously placed bet. When you receive a request you should perform the following actions on your side:
- Check that the method is
PUTand thetype === 2. - Verify request signature.
- If the request data contains field
"resultType": "cashout"— you must verify usertoken. In other cases there is no requirement for token to be validated because other requests will be initiated not by a user but by our system. - Find the bet in your system by
transactionId(this id initially was sent with place bet request). - Update the user balance and perform payout based on the
amountandcurrencyfields.amount === 0— means lose, do nothing with balanceamount > 0— meaning win/refund/cashout. You should add theamountvalue to the user balance.
- Respond to a request informing us about operation results.
Resettle
Settle endpoint could be requested several times in case of result changes or if the previous settle request was failed. If this happens you should check corresponding transactionId state and perform the actions (including user balance update) to ensure that our systems are back in sync.
The resettling of the bet happens in the following cases:
- There was a timeout or unexpected error during our previous request. So we re-trying the request with the same data one more time.
- The event’s result was incorrect and therefore depending bets should be recalculated.
- The event was canceled, and it is necessary to return the event’s bets.
To correctly process resettlement request:
- Re-check previously applied bet settlement (use
transactionId). If everything is matching — just respond with success. - If the bet payout (
amountvalue from the previous Settle request) on your side differs — revert the previous assessment. - Make a new payment based on the new
amountreceived from the Settle request.
Blocking bet resettlement
If you received a request to change bet result but your system rules does not allow this, you can respond with HTTP status code 400 and code: 20 in the body:
json
{
"code": 20,
"message": "Recalculation transaction is blocked"
}Request examples
The request data contains all common parameters for Place bet with following additions:
- the
typevalue is2. - the
amountfield now holds the amount that should be payed out to a user (don't confuse with the bet amount from Place bet request). - a new field
resultTypeis added. This field is informing about bet settlement result and can have following values:'won' | 'lost' | 'refund' | 'cashout'. - the
tokenfield is included only forcashoutrequests because this types of requests are issued by user and therefore must be re-authenticated.
json
{
"token": "5caa4cabce523c2f7610c50ce9819bfb",
"type": 2,
"transactionId": "b26153f9-ef3a-4768-b6c8-0861acdecb7a",
"userId": "1999",
"coefficient": 1.2,
"amount": 12.12,
"currency": "USD",
"resultType": "won",
"bonusId": 10,
"bonusTemplateId": 2,
"gameType": "sportsbook",
"requestId": "d9195aef-9492-43dd-88d0-dc1732a37f4e",
"ticketType": "single",
"boosterCoefficient": 1
}TIP
See place bet page for field descriptions.
Response examples
TIP
See place bet page for additional info.