Skip to content

Cashout API

Cashout - responsible for calculation cashout amount and performing settlement as cashout for bets, response from this service indicates cashout availability for player.

Get cashout amount

Get possible cashout amount for each bet number

Request parameters

Description Get possible cashout amount for each bet number
Stage https://apg-s2s.online
Prod https://apg-s2s.com
Path /v1/sport/v1/bet/cashout
Method GET
Headers Authorization [S2S API auth]
Content-Type: application/json
X-Operator-Id (will be provided by GR8 Tech)
X-Brand (will be provided by GR8 Tech)
X-Player-Id
Response Codes 200, 400, 429

Request

Params Data Types Description of property
betIds Array of Strings array of betIds to getAmount
margin String version of margin calculation formula to use

Response

200 - OK

Params Data Types Description of property
betId Strings bet identificator in uuid format
isAvailable Boolean show if cashout is available
amount Double cashout amount value
isAvailableOpenBet Boolean is openbet available
isPartialCashoutAvailable Boolean is partial cashout available (new field)
partialCashoutOdd Double partial cashout odd value (new field)

Example:

[
  {
    "betId": "1e82309c-9027-45ee-ba3d-0a667b83bc5a",
    "isAvailable": true,
    "amount": 499,
    "isPartialCashoutAvailable": true,
    "partialCashoutOdd": 0.998001,
    "isAvailableOpenBet": true
  }
]

400 - Bad Request

Example:


"The 'X-Operator-Id' header is required. The 'X-Player-Id' header is required. The 'X-Brand' header is required"
{
    "betIds": [
        "The value 'null' is not valid."
    ]
}

Perform cashout

Performs cashout for the bet with expected amount and change price policy

Description Performs cashout for the bet with expected amount and change price policy
Stage https://apg-s2s.online
Prod https://apg-s2s.com
Path /v1/sport/v1/bet/cashout
Method POST
Headers Authorization [S2S API auth]
Content-Type: application/json
X-Operator-Id (will be provided by GR8 Tech)
X-Brand (will be provided by GR8 Tech)
X-Player-Id
Response Codes 200, 400, 429

Request

Params Data Types Description of property Place
margin Strings version of margin calculation formula to use query
betId Strings betIds in uuid format body
amount Double cashout amount value body
priceChangePolicy String [ Rise, None, Any ] body

Example:

{
    "betId": "33f0042d-ce58-4036-95e5-b3f8e1ef5a8f",
    "amount": 99.0,
    "priceChangePolicy": 2 //Any
}

Response

200 - OK

Params Data Types Description of property
betId Strings bet identificator in uuid format
amount Double cashout amount value
result String request result - Unknown = 0, Success = 1, NotAllowed = -1

Example:

{
    "betId": "33f0042d-ce58-4036-95e5-b3f8e1ef5a8f",
    "amount": 99.0,
    "result": "Success"
}

400 - Bad Request

Example:

{
  "betId": [
    "Error converting value {null} to type 'System.Guid'. Path 'betId', line 2, position 15.",
    "Required property 'betId' expects a value but got null. Path '', line 5, position 1."
  ]
}
{
  "Amount": [
    "Amount is lower or equal zero."
  ]
}
{
  "priceChangePolicy": [
    "Error converting value \"\" to type 'GR8Tech.SportsBook.Contracts.Bet.Enums.PriceChangePolicy'. Path 'priceChangePolicy'"
  ]
}

Perform forced cashout

Performs cashout for the bet with expected amount and change price policy

Description Performs cashout for the bet with expected amount and change price policy
Stage https://apg-s2s.online
Prod https://apg-s2s.com
Path /v1/sport/v0/bet/forced-cashout
Method POST
Headers Authorization [S2S API auth]
Content-Type: application/json
X-Operator-Id (will be provided by GR8 Tech)
X-Brand (will be provided by GR8 Tech)
X-Player-Id
Response Codes 200, 400, 422, 429

Request

Params Data Types Description of property Place
betId Strings betIds in uuid format body
amount Double cashout amount value body

Example:

{
    "betId": "33f0042d-ce58-4036-95e5-b3f8e1ef5a8f",
    "amount": 99.0
}

Response

200 - OK

Params Data Types Description of property
betId Strings bet identificator in uuid format
amount Double cashout amount value
result String request result - Success = 1, Unknown = 0, NotAllowed = -1

Example:

{
    "betId": "33f0042d-ce58-4036-95e5-b3f8e1ef5a8f",
    "amount": 99.0,
    "result": "Success"
}

400 - Bad Request - return problem details object 422 - Unprocessable entity - if betId is not valid or markets was closed

Perform partial cashout (new endpoint)

Perfomrs partial cashout for the bet with requested part of bet amount and expected amount and change price policy

Description Performs cashout for the bet with expected amount and change price policy
Stage https://apg-s2s.online
Prod https://apg-s2s.com
Path /v1/sport/v1/bet/partial-cashout
Method POST
Headers Authorization [S2S API auth]
Content-Type: application/json
X-Operator-Id (will be provided by GR8 Tech)
X-Brand (will be provided by GR8 Tech)
X-Player-Id
Response Codes 200, 400, 429

Request

Params Data Types Description of property Place
margin String version of margin calculation formula to use query
betId String betIds in uuid format body
betAmount Double part of amount or remaining amount of bet body
amount Double cashout amount value (amount to be paid to the player) body
priceChangePolicy String [ Rise, None, Any ] body

Example:

{
    "betId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "betAmount": 10,
    "amount": 25,
    "priceChangePolicy": "Rise"
}

Response

200 - OK

Params Data Types Description of property
betId String bet identificator in uuid format
amount Double cashout amount value
result String request result - Unknown = 0, Success = 1, NotAllowed = -1

Example:

{
    "betId": "33f0042d-ce58-4036-95e5-b3f8e1ef5a8f",
    "amount": 25.0,
    "result": "Success"
}

400 - Bad Request

Example:

"The 'X-Operator-Id' header is required. The 'X-Player-Id' header is required. The 'X-Brand' header is required"
{
  "betId": [
    "Error converting value \"\" to type 'System.Guid'. Path 'betId', line 2, position 13."
  ]
}

{
  "Amount": [
    "Amount is lower or equal zero."
  ],
  "BetAmount": [
    "BetAmount is lower or equal zero."
  ]
}
{
  "priceChangePolicy": [
    "Error converting value \"\" to type 'GR8Tech.SportsBook.Contracts.Bet.Enums.PriceChangePolicy'. Path 'priceChangePolicy'."
  ]
}

Templates for partial cashout integration

S2S API auth