Info
Rules your wallet must follow
Four rules keep the money right on both sides when calls time out, repeat or arrive late: three are required, one is recommended. The conformance suite checks each of them.
The four rules#
- Deduplicate by
provider_tx_id, and by nothing else, for at least 120 days. A repeated id changes no balance and is answered 409 (or 200) with the stored transaction indata, itsprovider_tx_idincluded.actionandaction_idare not keys: a round'sdepositmust be applied even though awithdrawwithaction: "bet"came before it. - Recommended: remember a rollback of a withdraw you never saw. Answer it 408 (or 200), and if that withdraw arrives later (a request that was still on its way when we gave up), refuse it with any code but 200 and 409. A wallet that answers 408 and does not follow it gets a warning, not a failure, in Test connection and in the full run (see the conformance suite). After a rollback answered 200 we send nothing again, so if you answer 200 you must refuse the late withdraw: applying it fails the run. The late withdraw below says what remains without it.
- Accept
depositandrollbackwhatever the state of the token or session. They belong to rounds that were already played. A 401 or 403 to either is not final: we keep sending the call and raise an alert on our side. - Keep amounts as integers. Never convert them through floating point: see Amounts.
A 409 must name the transaction#
We take a 409 as "already processed" only when data.provider_tx_id is our id. A bare 409, or one naming another transaction, proves nothing: we read it as an unknown outcome (a withdraw is rolled back, a deposit or rollback is sent again) and raise an alert. Without this rule a wallet that deduplicates on something other than provider_tx_id could answer 409 to a deposit it never applied, and a win would be settled unpaid.
How we read your answers#
| 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 |
Extra fields are ignored. On an unknown outcome a withdraw is rolled back, and a deposit or rollback is sent again with the same provider_tx_id.
Retries and timeouts#
| Method | Timeout | Retries |
|---|---|---|
auth | debit timeout | never |
info | debit timeout | never |
withdraw | debit timeout | never: an unknown outcome is rolled back |
deposit | credit timeout | until accepted: 1 s, 2 s, 4 s … at most 5 min apart, for ever; an alert after 10 attempts |
rollback | credit timeout | as deposit, plus two re-checks after a 408 (below) |
playerNotificationCallback | credit timeout | twice (after 1 s and 3 s) |
The debit timeout is 2,000 ms unless agreed otherwise (500–5,000 ms), the credit timeout 5,000 ms (1,000–10,000 ms). Aim to answer in under 1 second at the 99th percentile. Every attempt carries the same provider_tx_id and a new signature with a fresh timestamp.
The late withdraw#
A withdraw we gave up on (no answer within the timeout, a network error, an HTTP 5xx, or a body that is not an answer of yours: not JSON, or without an integer code, such as the page of a proxy in front of your wallet) may still reach you after our rollback. So after such a withdraw, a first 408 to its rollback is not final: we send the same rollback again 30 seconds later, and if you answer that one 408 too, once more 5 minutes after it. If the withdraw arrived in between, answer 200 and return the stake. Only a third 408 ends it. A withdraw you did answer with a code (405, 413, 500, or a 200 or 409 we could not use) has finished on your side, and its first 408 is final.
A withdraw that reaches you later still is covered by rule 2, which is recommended. Without it one gap remains: a withdraw you apply more than 5 minutes 30 seconds after we gave up on it takes the stake for a bet we already declared void, and we do not learn of it.
Order and balance#
- We send the
withdraw,depositandrollbackcalls of one game session one at a time: the next starts only after the previous one ended. So your balances for a session come in the order you applied them. infoand the notification are not money movements and may come in between.- The game shows the newest balance it has received; a 409 carries no balance figure for it.
The conformance suite#
Our conformance suite runs the scenarios below against a wallet; each one passes, passes with a warning, or fails. It is not a tool you install: our integration team carries out the full run against your staging wallet during onboarding. For the run we need a test player with a balance, a currency of your brand and a fresh one-time token for that player from your side.
Two scenarios check a recommendation (rule 2) and can pass with a warning. rollback-then-withdraw-refused: if you answered the rollback 408, then your wallet applies the withdraw that arrives after it, takes it once, and returns it when we send the same rollback again, the scenario passes with a warning. If you answered that rollback 200, the same outcome fails it: after a 200 the bet is void and we send nothing again, so the player's stake would be lost. Answer 408 to a rollback of a transaction you never saw, or refuse the late withdraw. timeout-abandoned-withdraw: if you answered the rollback of an abandoned withdraw 408, then took exactly that withdraw's amount when it arrived, and return it when we send the same rollback again (answered 200, the balance whole), the scenario passes with a warning; it is judged by your balance, not by the code of the late call. Any other outcome of either is a failure; in timeout-abandoned-withdraw in particular, a withdraw taken after you answered its rollback 200. A warning does not fail the run: the summary names it, and Test connection shows it in its summary and in the scenario's row. Test connection runs the first of the two only.
Test connection on your operator page in our back office runs the same checks whenever you want: every scenario marked below, against your configured wallet, signed with your client key, for the test player, currency and one-time token you enter. At most 5 seconds per call, 20 seconds in all, 5 runs per minute. The other four need parallel load or deliberately abandoned calls and are part of the integration team's run only.
smallest-amount takes our smallest amount from the test player's balance with a withdraw and gives it back with a deposit. Each call must move the balance by exactly that amount. In a crypto currency it is 10^-8 of the coin, one unit; in a fiat currency we ask only for a whole cent, or a whole yen or won. It is a failure, not a warning: in Test connection, in the full run and on the go-live checklist. A wallet that passed the suite of release 1.0.0 can fail it now: a wallet that keeps USDT with 6 decimals (it rounds, cuts or refuses a finer amount), or one with a minimum amount per transaction.
| Scenario | Checks | Test connection |
|---|---|---|
auth-ok | auth accepts a fresh token and answers with the player, balance and currency. | yes |
auth-bad-token | auth answers 401 to an unknown token. | yes |
auth-token-single-use | A token is accepted once. | yes |
sig-bad | A wrong signature is answered 413. | yes |
sig-raw-bytes | The signature is checked over the raw body bytes as sent. | yes |
sig-stale-ts | A timestamp more than 300 seconds off is answered 413. | yes |
http-status-200 | Answers come with HTTP status 200 and the outcome in code. | yes |
info-ok | info answers the balance as an integer. | yes |
withdraw-ok | A withdraw takes the amount and answers the new balance. | yes |
withdraw-replay | The same withdraw again is answered 409 (or 200) and changes no balance. | yes |
withdraw-insufficient | A withdraw above the balance is answered 402. | yes |
withdraw-units-exact | The amount moves exactly, as an integer. | yes |
smallest-amount | A withdraw and then a deposit of our smallest amount (10^-8 of the coin in a crypto currency; a cent, a yen or won in a fiat currency) each move the balance by exactly that. | yes |
deposit-ok | A deposit adds the amount. | yes |
deposit-replay | The same deposit again changes no balance. | yes |
deposit-freebet | A free-bet deposit (action: "freebet", no withdraw) is accepted. | yes |
deposit-dead-session | A deposit is accepted after the token expired. | yes |
rollback-ok | A rollback returns the stake. | yes |
rollback-replay | The same rollback again changes no balance. | yes |
rollback-unknown | A rollback of a withdraw you never saw is answered 408 (or 200). | yes |
rollback-then-withdraw-refused | A withdraw that arrives after its rollback is refused (rule 2, recommended). A withdraw applied once and returned by the same rollback sent again is a warning if the rollback was answered 408, and a failure if it was answered 200. | yes |
rollback-after-late-withdraw | A rollback answered 408, then the withdraw, then the same rollback again: the second answer is 200 and the stake comes back. | yes |
rollback-dead-session | A rollback is accepted after the token expired. | yes |
shared-action | A deposit after a withdraw with the same action (and, as a hostile variant, the same action_id) is applied, not answered 409. | yes |
duplicate-names-transaction | Every 409 carries data.provider_tx_id. | yes |
concurrent-identical-withdraws | The same withdraw sent many times at once is applied once. | no |
concurrent-distinct-withdraws | Different withdraws sent at once are all applied. | no |
timeout-abandoned-withdraw | A withdraw we give up on, its rollback and the withdraw arriving late leave the balance whole (rule 2, recommended). A rollback answered 408, exactly that withdraw taken, and the stake returned by the same rollback sent again is a warning. | no |
latency-info-p99 | info answers within 1 second at the 99th percentile. | no |
net-zero | The whole run leaves the test player's balance where it started. | yes |