API reference: calls you receive
Deposit
We pay a win. A deposit is sent until you accept it and is never rolled back.
POST {wallet-url}/deposit
- Called
- for every win above 0; for a lost round only if zero-amount deposits are on
- Timeout
- your credit timeout: 5,000 ms unless agreed otherwise (1,000–10,000 ms)
- Retries
- until accepted: 1 s, 2 s, 4 s … up to 5 min apart, for ever
- Idempotency key
provider_tx_id
Add amount to the balance. A deposit belongs to a round that was already played: accept it whatever the state of the token or the session, also after the session ended. In Crash each bet that cashes out gets its own deposit when it cashes out, not at the end of the round.
Request#
| Field | Type | Presence | Meaning |
|---|---|---|---|
user_id | string (1–128 chars) | required | Your player reference: the user of the launch. |
currency | string | required | The session currency (the round's currency). |
amount | integer (≥ 0) | required | The win in units. 0 only when zero-amount deposits are switched on for you (off by default). |
provider | string | required | Our provider key. |
provider_tx_id | string | required | Our transaction id, <roundId>:credit: a string, not a number. Unique for ever, the same on every attempt. |
game | "dice" | "limbo" | "mines" | "plinko" | "crash" | "chicken" | "keno" | "tower" | "hilo" | required | The game identifier. |
action | "bet" | "freebet" | required | bet for the win of a paid round (also for a stake we return when an unplayed multi-step round expired); freebet for the win of a free-bet round, whoever granted the free bet. |
action_id | string | required | The payout's id, <roundId>:win, different from the bet's, so the deposit never looks like a repeat of the withdraw. |
session_token | string | required | Our token for this game session: 64 lower-case hex characters, made at launch and sent in every later call of the session, also after it ended. It is not a credential. |
platform | "mobile" | "desktop" | required | mobile or desktop, from the browser that opened the launch. |
withdraw_provider_tx_id | string | optional | The round's withdraw, <roundId>:debit. Absent for a free-bet round, which has no withdraw. |
The ids we send#
| Field | Value | Length |
|---|---|---|
provider_tx_id | <roundId>:credit | 43 characters |
action_id | <roundId>:win | 40 characters |
withdraw_provider_tx_id | <roundId>:debit | 42 characters |
Every id is a JSON string, never a number. <roundId> is a UUID written as 36 characters: lower-case hex digits (0–9, a–f) and four hyphens. A suffix is a colon and lower-case letters, so each id always has the length shown. The longest id we send in any call is <roundId>:rollback, 45 characters. Store our ids as strings of at least 45 characters and compare them exactly: a numeric column, or a shorter one, cannot hold them.
Answer#
| Field | Type | Presence | Meaning |
|---|---|---|---|
code | integer | required | The outcome: see the codes. Always answer with HTTP status 200. |
message | string | optional | A short text for people. We do not read it, except on a 412 to withdraw. |
data | object | required with code 200 | The result. Required with code 200 (and, on a money method, with 409). |
data.user_id | string | optional | Must equal ours if present. |
data.operator_tx_id | any JSON | optional | Your transaction id, any JSON value. We keep it for support. |
data.provider | string | optional | Ignored. |
data.provider_tx_id | string | optional | Our provider_tx_id. Must equal ours if present; required on a 409, where it shows that the stored transaction is ours. |
data.old_balance | integer | optional | The balance before the call, in units. Checked to be an integer, not used. |
data.new_balance | integer | required in data | The balance after the call, in units. Shown rounded down. From a 409 it is not used as a figure: it may be older than the balance already shown. |
data.currency | string | optional | Must equal ours if present. |
Examples#
Request
{
"user_id": "u_829301",
"currency": "USD",
"amount": 10530,
"provider": "banzaro",
"provider_tx_id": "0192f3c1-7a5b-7cc3-9d2e-1f2a3b4c5d6e:credit",
"game": "dice",
"action": "bet",
"action_id": "0192f3c1-7a5b-7cc3-9d2e-1f2a3b4c5d6e:win",
"session_token": "5f2b8c1d9e3a4f60718293a4b5c6d7e8f9012345678901234567890123456789",
"platform": "mobile",
"withdraw_provider_tx_id": "0192f3c1-7a5b-7cc3-9d2e-1f2a3b4c5d6e:debit"
}Free-bet win
{
"user_id": "u_829301",
"currency": "USD",
"amount": 10530,
"provider": "banzaro",
"provider_tx_id": "0192f3c1-7a5b-7cc3-9d2e-1f2a3b4c5d6e:credit",
"game": "dice",
"action": "freebet",
"action_id": "0192f3c1-7a5b-7cc3-9d2e-1f2a3b4c5d6e:win",
"session_token": "5f2b8c1d9e3a4f60718293a4b5c6d7e8f9012345678901234567890123456789",
"platform": "mobile"
}Accepted
{
"code": 200,
"message": "ok",
"data": {
"user_id": "u_829301",
"operator_tx_id": "560",
"provider": "banzaro",
"provider_tx_id": "0192f3c1-7a5b-7cc3-9d2e-1f2a3b4c5d6e:credit",
"old_balance": 44672,
"new_balance": 55202,
"currency": "USD"
}
}Already processed (409)
{
"code": 409,
"message": "already processed",
"data": {
"user_id": "u_829301",
"operator_tx_id": "560",
"provider": "banzaro",
"provider_tx_id": "0192f3c1-7a5b-7cc3-9d2e-1f2a3b4c5d6e:credit",
"old_balance": 44672,
"new_balance": 55202,
"currency": "USD"
}
}Error (500)
{
"code": 500,
"message": "internal error"
}Codes and what we do#
| Code | Meaning | What we do |
|---|---|---|
200 | Paid. | The round is settled. |
401 | Invalid token. | Sent again, and an alert: a deposit must be accepted whatever the token's state. |
403 | Expired token. | As 401. |
409 | Already processed. | With our provider_tx_id in data: settled. Without it: an unknown outcome, sent again, and an alert. |
413 | Our signature did not verify. | Sent again, and an alert. |
500 | Any other error (402, 405, 408 and 412 are not deposit codes and count as 500). | Sent again. |
When there is no usable answer#
An unknown outcome means the call may or may not have been applied. For deposit: we send it again, with the same provider_tx_id.
| What arrived | Read as |
|---|---|
| No answer within the timeout, a network error, a redirect (never followed) | unknown outcome |
| HTTP status 500 or higher, whatever the body says | unknown outcome |
HTTP status below 500 with a JSON body and an integer code | the code counts, whatever the HTTP status |
A body that is not JSON, has no integer code, or has code 200 without the required data fields of the right type (amounts by the integer rule) | unknown outcome |
Code 200 whose data.provider_tx_id, data.user_id or data.currency differs from ours | unknown outcome |
A money method answered 409 without our provider_tx_id in data | unknown outcome, and an alert on our side |
| A code this method does not list | read as 500 |
A deposit that is never accepted#
After 10 attempts we raise an alert and keep sending. Our support staff can mark the payment as confirmed by hand once you have credited it on your side.