Obtaining a player’s balance
Overview
| Request type | URL |
|---|---|
| GET | <server-partner>/balance |
This method allows you to get the current player's balance.
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 | |
|---|---|---|---|
| currency | string | Currency in which the game is played | |
| partnerId | bigint | Unique partner identifier | |
| playerId | string | Unique player identifier in the partner’s system | |
| hash | string | Signature (sha256 from encryption string) | |
| sessionId | string | optional* | Unique game session identifier in the partner’s system |
String to hash
“balance” + currency + partnerId + playerId + sessionId* + apiKey
Response
| Name | Type | Description |
|---|---|---|
| balance | string | Player's current balance |
Example
Request
js
{
currency: 'USD',
partnerId: 1,
playerId: '432',
sessionId: '123',
hash: 'bafb050a6f04d30d6b684f024a5e38c97f8de84b7c957bbd357e6da867cf2f3c'
}Response
js
{
status: 'success'
data: {
balance: '10103.63'
}
}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 |
| IncorrectHash | Incorrectly calculated hash |
| ServerError | Server error |