Withdraw
v1.0.0This method withdraws money from player balance. Method sends one transaction and returns transaction ID, player balance and status of transaction.
- Path: /withdraw
- Request Method: POST
- Content-Type: application/json; charset=utf-8
- Headers: X-Art-Client-ID, X-Art-Client-TS, X-Art-Client-Signature
Request
| Parameter | Type | Description |
|---|---|---|
| user_id | string | Player ID on operator side |
| currency | string [currency enum] | Bet currency (currency code) |
| amount | long | Amount that should be transferred from players balance |
| provider | string | Game provider |
| provider_tx_id | string | The transaction ID assigned by provider |
| game | string [game enum] | Identifies specific game. (game identificator) |
| action | string [action enum] | Enum: betrain |
| action_id | string | ID of action in game, which depends on game and “action” |
| session_token | string | Game session token |
| platform | string [platform enum] | Enum: mobiledesktop |
Response
| Parameter | Type | Description |
|---|---|---|
| code | integer [enum] | Response code |
| message | string | Response any logical message |
| data | object | only needed when code 200 or 409 |
| user_id | string | ID of a player on the operators side |
| operator_tx_id | string | Unique transaction ID on side of operator |
| provider | string | Game provider |
| provider_tx_id | string | The transaction ID received by provider |
| old_balance | long | Balance before deposit |
| new_balance | long | Balance after deposit |
| currency | string [currency enum] | Transaction currency |
Important!
Each request sent to the API requires validation using specific security headers. For details on implementing this, refer to Securing API Requests.
If request is timed out, game sends same transaction, with same provider_tx_id again. if transaction is already processed on the side of the operator, operator identifies duplication and adds in answer duplication error code with already processed information of transaction. The Transaction should be unique with provider_tx_id.
If operator processed transaction successfully, but after this, provider can't process it in the game, provider will rollback transaction with rollback method.
Amount/Balance example
Amount/Balance fiat is represented in units(1$ = 1000 unit) and always is an integer value. For example: with 5.32 USD and the value will be 5.32 * 10^3 = 5320
Amount/Balance crypto is represented in units(1BTC = 100000000 unit) and always is an integer value. For example: with 0.0532 BTC and the value will be 0.0532 * 10^8 = 5320000
Possible codes
- 200 - Success
- 401 - User token is invalid
- 402 - Insufficient fund
- 403 - User token is expired
- 405 - Internal error with no retry
- 409 - Duplicate transaction
- 412 - For stop the game and show the reality check window. In the window will shown the message from the response. (read more)
- 413 - Invalid Client-Signature
- 500 - Internal error
If code is 200 - operator should always return parameter data with information; HTTP status code should always be 200