OPERATOR GUIDE
The wallet API (you implement this)
We call POST {your wallet URL}/balance, /bet, /win, /rollback, signed with your wallet secret. Bodies are JSON. Amounts are decimal strings in the session currency ("12.50"), never numbers.
Ignore fields you do not know. We add fields to these calls over time (always optional, never changing the meaning of existing ones). Verify the signature over the raw bytes, then read the fields you need and ignore the rest. Treat an unknown error.code from our API as final unless the HTTP status is 5xx or 429.
Fields common to every call:
| Field | Meaning |
|---|---|
player_id, currency | as given when the session was created |
token | your own session token, unchanged (or null) |
session_id | our session id |
game_code | the game |
operator_id | your operator id: the operator the call was signed for. Refuse the call unless it is yours (section 1.2). |
sandbox | true on every call for a sandbox account (absent otherwise). Refuse such calls on a production ledger. |
POST /balance
Returns the player's balance.
POST /bet — take the stake
Extra fields: transaction_id, round_id, amount, round_closed: false.
POST /win — credit a game result or a separate prize
Extra fields: transaction_id, round_id, amount, reference_transaction_id, round_closed: true. An ordinary paid round settles with one game win referencing its bet, even when the result is "0.00" (or a rollback if the bet was cancelled). kind is omitted on ordinary game and free-round wins. A SPILVON Jackpot prize is an additional win, not part of that game payout.
A free round (section 6.1) has no bet: its win arrives on its own, with reference_transaction_id: null and these extra fields. Pay it like any win, idempotently by transaction_id. Count it as a promotional payout, not as a return on a wager.
| Field | Meaning |
|---|---|
free_round | true |
award_id | our id of the award (fra_…) |
award_reference | your own reference for the award |
free_round_number, free_rounds_total | e.g. 3 and 10: the third round of ten |
SPILVON Jackpot. Accept kind: "jackpot" as a standalone credit in the player's currency, with reference_transaction_id: null and round_closed: true. The round_id identifies the triggering play for support, not a debit to find or a key to deduplicate. Do not require a prior bet, a live session or an open round. A round can have a game win and several distinct tier prizes.
| Jackpot field | Meaning |
|---|---|
jackpot_win_id | Prize id (jpw_…), for reconciliation. |
jackpot_pool_id | Progressive pool (jp_…). |
jackpot_pool_type | network (opt-in, shared across operators) or local (one operator). |
jackpot_tier | Tier name, e.g. grand. |
Credit amount exactly once per win transaction_id, and return the post-credit balance. If the acknowledgement is lost, return success or DUPLICATE_TRANSACTION on an identical retry. A jackpot credit is never cancelled or rolled back: even a refusal leaves it pending, retried with the same transaction id until acknowledged. Reconcile it as a prize, not a second game payout (§6.3).
POST /rollback — undo a bet
Extra fields: transaction_id, round_id, amount, reference_transaction_id (the bet to undo), round_closed: true. Refund the bet identified by reference_transaction_id. Sent when we could not confirm that a bet succeeded, or when a player cancels a bet before the game starts.
Success response (all four)
200 with the player's balance after the operation:
{ "balance": "987.50" }Refusing
Answer with an error body (HTTP 200 or the matching 4xx, either works):
{ "error": { "code": "INSUFFICIENT_FUNDS", "message": "optional text for your logs" } }| Code | Use it for | What we do |
|---|---|---|
INSUFFICIENT_FUNDS | bet: not enough balance | Final. The round does not start. No rollback is sent. |
LIMIT_REACHED | bet: a deposit/loss/session limit blocks it | Final. No rollback. |
PLAYER_BLOCKED | bet: the account may not play | Final. No rollback. |
TOKEN_INVALID, TOKEN_EXPIRED | bet: your session for this player is over | Final. No rollback. |
CURRENCY_MISMATCH, GAME_NOT_ALLOWED | bet: not permitted | Final. No rollback. |
DUPLICATE_TRANSACTION | win/rollback you already processed, identical repeat only (rule 6) | Treated as success. (Returning the normal success body is better.) |
TRANSACTION_MISMATCH | a transaction_id you know, with different details; a rollback that does not match its bet (rules 6, 8) | Outcome unknown: retried, and raised to our operations team. |
ROUND_ALREADY_SETTLED | a rollback for a round whose win you already paid (rule 8) | Outcome unknown: retried, and raised to our operations team. |
INVALID_SIGNATURE (with HTTP 401) | a call that fails your signature check, or whose operator_id is not yours (section 1.2) | Outcome unknown. |
TRANSACTION_NOT_FOUND | rollback of a bet you never received | Treated as success: there is nothing to undo. |
| anything else, any 5xx, a timeout, a redirect, a body we cannot read | — | Outcome unknown. A bet is rolled back; a win or rollback is retried. |
The five rules that make a wallet correct
- Idempotency. If you see a
transaction_idyou have already processed, change nothing and return the same success response. We re-send wins and rollbacks until you acknowledge them; a retry must never pay twice. - A bet is all or nothing. Either debit the full amount and answer success, or refuse with a code from the table. Never partially debit.
- Rollback of an unknown bet. If a rollback arrives for a bet you have not seen (your server was slow and our request timed out), answer
TRANSACTION_NOT_FOUNDand remember that bet id: if the bet arrives later, refuse it with any error code (we recommendTRANSACTION_NOT_FOUND) and move no money. Otherwise a late bet would take money for a round that never happened. - Wins and rollbacks are always accepted, even if the player has logged out, the session has expired or the account is blocked. It is the player's money.
- Answer fast. We wait 6 seconds. Aim for under 500 ms; the player is watching.
- A transaction id is bound to its details. Store method,
player_id,currency,amount,round_idandreference_transaction_idwith every transaction. An identical repeat changes nothing and gets the normal success response. A repeat with any different detail changes nothing and is refused withTRANSACTION_MISMATCH, neverDUPLICATE_TRANSACTION(which we read as success). - Check the session token on every bet. Accept a bet only if
tokenis a live session of yours for that sameplayer_id; otherwise refuse it withTOKEN_INVALID(unknown, or another player's) orTOKEN_EXPIRED. Never check the token on wins or rollbacks (rule 4). - A rollback refunds its bet, exactly. Credit the player and currency stored with the bet named by
reference_transaction_id, never the values in the rollback request. If the request'splayer_id,currency,round_idoramountdiffers from that bet, change nothing and answerTRANSACTION_MISMATCH. If you already paid awinfor that round, change nothing and answerROUND_ALREADY_SETTLED. A second rollback of the same bet (under a newtransaction_id) refunds nothing and answers success with the current balance.
What we do when you do not answer
| Call | Our behaviour |
|---|---|
bet | Never retried. On anything but a clear success or a clear refusal the bet is cancelled, the player sees an error, and a rollback is sent. |
win, rollback | Retried with the same transaction_id: after 2 s, 5 s, 15 s, 1 min, 5 min, 15 min, then every hour, until you acknowledge. After five failed attempts it is flagged for our operations team, who will contact you. |