Refund of the bet to the player
Overview
| Request type | URL |
|---|---|
| POST | <server-partner>/refund |
This method allows to refund the player's bet.
Notice
The request is executed by the provider.
Parameters
Request
Optional fields are excluded from hash calculations.
Optional* fields are included in hash calculations only if they are provided.
| Name | Type | Description | |
|---|---|---|---|
| amount | string | Transaction amount | |
| currency | string | The currency in which the game will be played | |
| partnerId | bigint | Unique partner identifier | |
| playerId | string | Unique player identifier in the partner’s system | |
| gameId | bigint | Unique identifier of the game | |
| roundId | bigint | Unique identifier of the betting round | |
| betTransactionId | bigint | Unique identifier of the betting transaction in the partner's system | |
| transactionId | bigint | Unique identifier of the provider's refund transaction | |
| sessionId | string | optional* | Unique game session identifier in the partner's system |
| hash | string | Signature (sha256 from encryption string) | |
| finished | boolean | optional | Flag indicating whether the round is finished |
String to hash
"refund" + amount + currency + partnerId + playerId + gameId + roundId + betTransactionId + transactionId + sessionId* + apiKey
Response
| Name | Type | Description |
|---|---|---|
| balance | string | Player's current balance |
| transactionId | string | Unique identifier of the refund transaction in the partner’s system |
Example
Request
js
{
amount: '10.00',
currency: 'USD',
partnerId: 1,
playerId: '432',
gameId: 3,
roundId: 7686,
betTransactionId: 1333882828,
transactionId: 37,
sessionId: '123',
finished: false,
hash: '3d304f5134260424a0777a91745565cf3e8b80226d0e1aa66bb0835ffe59839a'
}Response
js
{
status: 'success'
data: {
balance: '10113.63',
transactionId: '1333882830'
}
}Errors
Possible error messages:
| Message | Description |
|---|---|
| RequiredParamsNotFound | Incorrect number of parameters in the request |
| InvalidParamType | Incorrect parameter type |
| CurrencyNotFound | Currency with such code not found |
| BetNotFound | Bet was not found |
| IncorrectHash | Incorrectly calculated hash |
| ServerError | Server error |
In case of a BetNotFound error, the retry requests will not be sent.