Skip to content

CashOut

CashOut is a player's opportunity to cancel their bet and get the money back before a sport event ends. CashOut is calculated based on a player's chance to win or lose and changes throughout the entire sport event in Live or Prematch mode. The lower the odds of an outcome are, the higher a player's chance to win is, and the greater the amount of CashOut is.

Important

The CashOut function is available for all types of sports, single bets in Live and Prematch modes of sporting events. But you can also fine-tune the CashOut and disable it for certain sport events if necessary.

Chance - is the probability of a player's bet to win or lose in a sport event; it depends on outcome coefficients.

Full scheme of the bet and cash-out lifecycle

Restrictions

During the cash-out process, it could be declined with the reason of a problem. Such reasons are included within restrictions that occur during cash-out processing (similarly to bet restrictions).

Currently, the following cash-out restriction types are supported:

  • bet_status
  • bet_selection_existence
  • selection_value
  • sport_event_status
  • sport_event_type
  • sport_event_existence
  • sport_event_bet_stop
  • market_status
  • market_existence
  • market_defective
  • odd_status
  • odd_existence
  • cash_out_bet_type
  • bet_cash_out_selections_mismatch
  • cash_out_unavailable
  • cash_out_amount_limit
  • cash_out_refund_amount
  • cash_out_order_status
  • cash_out_order_freebet
  • bet_provider
  • player_limit

For more details, please refer to CashOutOrderRestriction schema.

Callback API

Note

You can find the basic implementation of the callback server written in Node.js in our GitHub repository at databet-cloud/callback-server-example.

Important

Please ensure that all callbacks are processed idempotently. Due to our at-least once guarantee, it's possible for a callback to be delivered to the server more than once. Always use the request_id to distinguish and manage each callback appropriately. If a request is duplicated, it is crucial to respond with the same response code and content as the initial response. Consistency in handling and responding to repeated requests ensures seamless operation.

Cash-out callbacks SHOULD be implemented on the integration side only if such functionality is required. A cash-out could be either accepted or declined.

cURL examples

Replace the {callback-api-server} with your callback API server URL and run the following commands to test cash-out callbacks:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
curl -X 'POST' \
http://{callback-api-server}/bet/cash-out-orders/accepted \
-H 'accept: */*' \
-H 'Foreign-Params: {   "some_token": "some_token_value",   "internal_player_id": "123" }' \
-H 'Content-Type: application/json' \
-d '{
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "bet_id": "AAAAAAAAAAAAAAAAAaVSZ1rf1k0BuhAAAOAdRQAY",
    "cash_out_order_id": "129965e5-4279-4a85-a454-89f58192799d",
    "amount": "5",
    "refund_amount": "5.5"
}'
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
curl -X 'POST' \
http://{callback-api-server}/bet/cash-out-orders/declined \
-H 'accept: */*' \
-H 'Foreign-Params: {   "some_token": "some_token_value",   "internal_player_id": "123" }' \
-H 'Content-Type: application/json' \
-d '{
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "bet_id": "AAAAAAAAAAAAAAAAAaVSZ1rf1k0BuhAAAOAdRQAY",
    "cash_out_order_ids": [
        "129965e5-4279-4a85-a454-89f58192799d"
    ]
}'

Swagger