Portale per sviluppatori

Portale per sviluppatori / Guida per gli operatori

Documentazione tecnica in inglese

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:

FieldMeaning
player_id, currencyas given when the session was created
tokenyour own session token, unchanged (or null)
session_idour session id
game_codethe game
operator_idyour operator id: the operator the call was signed for. Refuse the call unless it is yours (section 1.2).
sandboxtrue 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.

FieldMeaning
free_roundtrue
award_idour id of the award (fra_…)
award_referenceyour own reference for the award
free_round_number, free_rounds_totale.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 fieldMeaning
jackpot_win_idPrize id (jpw_…), for reconciliation.
jackpot_pool_idProgressive pool (jp_…).
jackpot_pool_typenetwork (opt-in, shared across operators) or local (one operator).
jackpot_tierTier 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:

json
{ "balance": "987.50" }

Refusing

Answer with an error body (HTTP 200 or the matching 4xx, either works):

json
{ "error": { "code": "INSUFFICIENT_FUNDS", "message": "optional text for your logs" } }
CodeUse it forWhat we do
INSUFFICIENT_FUNDSbet: not enough balanceFinal. The round does not start. No rollback is sent.
LIMIT_REACHEDbet: a deposit/loss/session limit blocks itFinal. No rollback.
PLAYER_BLOCKEDbet: the account may not playFinal. No rollback.
TOKEN_INVALID, TOKEN_EXPIREDbet: your session for this player is overFinal. No rollback.
CURRENCY_MISMATCH, GAME_NOT_ALLOWEDbet: not permittedFinal. No rollback.
DUPLICATE_TRANSACTIONwin/rollback you already processed, identical repeat only (rule 6)Treated as success. (Returning the normal success body is better.)
TRANSACTION_MISMATCHa 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_SETTLEDa 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_FOUNDrollback of a bet you never receivedTreated 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

  1. Idempotency. If you see a transaction_id you 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.
  2. 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.
  3. 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_FOUND and remember that bet id: if the bet arrives later, refuse it with any error code (we recommend TRANSACTION_NOT_FOUND) and move no money. Otherwise a late bet would take money for a round that never happened.
  4. 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.
  5. Answer fast. We wait 6 seconds. Aim for under 500 ms; the player is watching.
  6. A transaction id is bound to its details. Store method, player_id, currency, amount, round_id and reference_transaction_id with every transaction. An identical repeat changes nothing and gets the normal success response. A repeat with any different detail changes nothing and is refused with TRANSACTION_MISMATCH, never DUPLICATE_TRANSACTION (which we read as success).
  7. Check the session token on every bet. Accept a bet only if token is a live session of yours for that same player_id; otherwise refuse it with TOKEN_INVALID (unknown, or another player's) or TOKEN_EXPIRED. Never check the token on wins or rollbacks (rule 4).
  8. 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's player_id, currency, round_id or amount differs from that bet, change nothing and answer TRANSACTION_MISMATCH. If you already paid a win for that round, change nothing and answer ROUND_ALREADY_SETTLED. A second rollback of the same bet (under a new transaction_id) refunds nothing and answers success with the current balance.

What we do when you do not answer

CallOur behaviour
betNever 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, rollbackRetried 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.