JJagaro Docs
Operator integration

Wallet callback reference

Last updated 10/19/2026

Jagaro sends HTTP POST requests with JSON to the wallet URL configured for your operator. Verify the webhook signature before processing a request. Callback action names are lowercase. Amounts are decimal strings in major currency units.

Common request envelope

Every callback has action, authToken and data. Common data fields are operatorId, currency and game. Validate their binding to the authenticated player and your configured operator.

authToken is the platform-issued player credential supplied at launch. The init response does not replace it with a new session token.

init: authenticate and read balance

{
  "action": "init",
  "authToken": "YOUR_PLAYER_TOKEN",
  "data": {
    "operatorId": "YOUR_OPERATOR_ID",
    "currency": "USD",
    "game": "lucky-chicken"
  }
}

Return HTTP 200 with this JSON envelope:

{
  "status": 200,
  "duration": 4,
  "timestamp": 1792454400000,
  "data": {
    "code": "OK",
    "operatorId": "YOUR_OPERATOR_ID",
    "currency": "USD",
    "balance": "100.00",
    "userId": "player-123",
    "nickname": "Player"
  }
}

duration is processing time in milliseconds, a finite number from 0 to 60000. timestamp is a non-negative safe integer timestamp in milliseconds. status must be numeric 200. userId and nickname must be non-empty strings of at most 128 characters.

bet: debit the stake

{
  "action": "bet",
  "authToken": "YOUR_PLAYER_TOKEN",
  "data": {
    "transactionId": "bet-example-1",
    "userId": "player-123",
    "amount": "10.00",
    "roundId": "round-example-1",
    "operatorId": "YOUR_OPERATOR_ID",
    "currency": "USD",
    "game": "lucky-chicken"
  }
}

Debit amount once, atomically with recording its transaction receipt. roundId identifies the game round. Treat transaction identifiers as opaque strings: some have prefixes and are not UUIDs.

withdraw: credit the result

{
  "action": "withdraw",
  "authToken": "YOUR_PLAYER_TOKEN",
  "data": {
    "userId": "player-123",
    "operatorId": "YOUR_OPERATOR_ID",
    "currency": "USD",
    "result": "15.00",
    "coefficient": "1.50",
    "transactionId": "withdraw-example-1",
    "debitId": "bet-example-1",
    "gameId": "game-context-example",
    "isFinished": true,
    "game": "lucky-chicken"
  }
}

Credit exactly result. It is the total credit, including any returned stake, not profit to which another stake should be added. A result of "0.00" is valid and has no credit effect; persist its receipt and acknowledge it. Do not recompute the result from coefficient.

debitId refers to the original bet transaction. gameId is the settlement context identifier, whose scope depends on the game; do not assume it equals bet roundId. Use debitId for the debit relationship and transactionId for idempotency. isFinished signals finalisation of the supplied context; do not assume every game has one bet per session.

rollback: refund a debit

{
  "action": "rollback",
  "authToken": "YOUR_PLAYER_TOKEN",
  "data": {
    "userId": "player-123",
    "operatorId": "YOUR_OPERATOR_ID",
    "currency": "USD",
    "amount": "10.00",
    "transactionId": "rollback-example-1",
    "debitId": "bet-example-1",
    "gameId": "game-context-example",
    "isFinished": true,
    "game": "lucky-chicken"
  }
}

Refund or release the original debit exactly once. Validate its identity and amount. A rollback is a cancellation of a debit, not a reversal of a payout. Do not refund an absent debit. Preserve evidence of the absent debit and return the appropriate error code.

Responses to financial callbacks

For bet, withdraw and rollback, return HTTP 200 with the envelope below. Balance is the resulting wallet balance for this transaction.

{
  "status": 200,
  "duration": 4,
  "timestamp": 1792454400000,
  "data": {
    "code": "OK",
    "operatorId": "YOUR_OPERATOR_ID",
    "currency": "USD",
    "balance": "90.00"
  }
}

Both HTTP status and body status must be 200. All shown fields are required. data.message is optional and at most 512 characters. Do not add other fields, or userId/nickname to financial responses. Operator identity and currency must exactly match the request. Balance must be a non-negative decimal string valid for that currency, including on a business-error response. Init responses additionally require userId and nickname.

Business errors use the same complete envelope with a different data.code. These codes are supported:

CodeMeaning
OKConfirmed successful operation.
INSUFFICIENT_FUNDSStake cannot be funded.
INVALID_TOKENInvalid player credential.
ACCOUNT_LOCKEDPlayer account is locked.
ACCOUNT_INVALIDPlayer account is invalid.
INVALID_REQUESTRequest cannot be accepted.
CHECKS_FAILOperator checks did not pass.
DEBIT_TRANSACTION_NOT_FOUNDReferenced debit cannot be found.
TEMPORARY_ERRORTemporary failure; outcome requires recovery.
UNKNOWN_ERROROutcome is unresolved; requires recovery.

Unknown codes, extra fields, wrong bindings or malformed balances are invalid responses. Keep authentication/signature failures free of wallet effects. The recovery path for HTTP failures is described in Recovery, testing and FAQ.