Wallet errors
The error codes your wallet answers with. Use these codes so every provider's game shows the player the right reason.
Answer a refusal with a 4xx status (not 408 or 429) and { "error": "<CODE>", "message": "…" }. Codes are compared without regard to case. A code we do not recognise still refuses the movement and reaches the provider as a generic refusal.
| error | HTTP | Retry | Meaning | Your action | Shown to the provider as |
|---|---|---|---|---|---|
| INSUFFICIENT_FUNDS | 402 or 409 | no | The balance does not cover the bet. | Refuse the bet, change nothing. | the provider's own insufficient-funds code; NOT_ENOUGH_MONEY is read the same way |
| BET_LIMIT | 403 or 409 | no | The stake breaks a limit you apply: responsible-gaming, per-bet or loss limit. | Refuse the bet. Any code containing LIMIT is read as a limit. | a limit, where the provider has one; otherwise a refusal |
| PLAYER_BLOCKED | 403 | no | The player is blocked or self-excluded on your side (SELF_EXCLUDED is accepted too). | Refuse bets. Still credit win and rollback: they settle money already staked. | the matching code, where the provider has one; otherwise a refusal |
| PLAYER_NOT_FOUND | 404 | no | You have no player with this player_id. | Refuse. It points at a session opened with a wrong player_id. | the matching code, where the provider has one; otherwise a refusal |
| CURRENCY_MISMATCH | 409 | no | The currency is not the player's wallet currency. | Refuse. Never convert: a session is one currency from open to close. | the matching code, where the provider has one; otherwise a refusal |
| SESSION_CLOSED | 409 | no | You no longer accept bets on this session. | Refuse bets only. Wins and rollbacks may arrive after a session closes or expires and must be credited. | passed on as a refusal |
| INVALID_SIGNATURE | 401 | no | X-Agg-Signature does not verify with the key named in X-Agg-Key-Id. | Refuse before parsing the body. During a key rotation accept either of your two keys. | passed on as a refusal |
| VALIDATION_FAILED | 400 | no | A field you need is missing or malformed. | Refuse and tell us: the body is ours to fix. | passed on as a refusal |
Not errors
| Situation | Answer |
|---|---|
| The same transaction_id again | 200 with the body of the first answer; move nothing. A duplicate is not an error. |
| A rollback for a transaction you never saw | 200 with the current balance; remember the id as cancelled and refuse that bet if it arrives later. |
| A win for a round whose bet you refused | 200: credit it. See the win page for when this happens. |
| Your wallet is down or overloaded | 5xx, 408, 429 or no answer. We retry, then roll the movement back. |
