Skip to content

Wallet Callbacks ​

Money flows through seamless-wallet callbacks that you implement. You expose a wallet base URL; when a player bets, wins, cashes out or has a bet cancelled, we POST to your wallet URL and you move the money on your own ledger.

This page describes contract version 2: every call says what it is (type) and which way the money moves (direction), money and ids are strings, and every call is signed.

Configuring your wallet URL ​

Set your wallet base URL in the Operator Backoffice → Integration page. That value is <WALLET_URL>; the sportsbook POSTs to three paths under it:

PathCarries
POST <WALLET_URL>/betbet
POST <WALLET_URL>/winwin, cashout, cashout_partial
POST <WALLET_URL>/rollbackrefund, win_reversal, uncancel, resettle_adjust

Branch on type, not on the path. The paths are kept for wallets built on version 1.

Transaction types ​

typedirectionWhentransaction_ref
betdebitA bet is placedbet:<ticket>
wincreditA ticket settles won (or void: the stake comes back)win:<ticket>
cashoutcreditThe player sells the whole ticketcashout:<ticket>
cashout_partialcreditThe player sells part of the ticket; it keeps running on the restcashout:<ticket>:partial:<cumulative>
refundcreditA bet is cancelled and its stake returned — also an unconfirmed debit, see belowrefund:<ticket>, betrefund:<ticket>
win_reversaldebitA paid ticket is cancelledrollback:<ticket>
uncanceldebitA cancellation is reversed: the refunded stake is taken againuncancel:<ticket>
resettle_adjustdebit or creditA settled ticket's result is corrected — see Re-settlementresettle:<ticket>:<n>

direction is from the player's balance: debit takes money, credit gives it. amount is always positive; for resettle_adjust the direction is the sign. Treat the ref formats as opaque — do not parse them.

A lost ticket sends no call: no money moves. If you need lost tickets (for wagering requirements), tell us — a non-money settlement notification is on the roadmap.

Re-settlement ​

A provider can correct a result after the ticket settled — a score typo, a wrong goalscorer. The ticket is then settled again, as many times as it is corrected, and every money movement of a correction is one resettle_adjust:

  1. The correction reopens the ticket (ticket_status: "open") and takes back what it paid: resettle_adjust, debit, for the amount paid. Nothing is sent when it had paid nothing (it was lost).
  2. The corrected result settles it again. If it pays, the payout is a resettle_adjust, credit — not a second win.

n in resettle:<ticket>:<n> counts up per ticket. It can skip a number (a step that moved no money still takes one), so do not expect it to be contiguous.

What a ticket has paid is always:

paid = win (if any)  +  Σ resettle_adjust credits  −  Σ resettle_adjust debits

and it equals what the ticket's current ticket_status pays. Example — a single at 10 × 2.00, won, corrected to lost, corrected back to won:

StepCallPaid so far
Settles wonwin win:77, 20.0020.00
Corrected (reopened)resettle_adjust debit resettle:77:1, 20.00, ticket_status: open0.00
Settles lostnone (n = 2 used, nothing to pay)0.00
Corrected again (reopened)none (n = 3 used, nothing was paid)0.00
Settles wonresettle_adjust credit resettle:77:4, 20.00, ticket_status: won20.00

A resettle_adjust debit can leave the player's balance negative if they already spent the winnings; how you treat that is your policy. Answer "status":"ok" once you have recorded it — refusing it does not undo the correction.

Idempotency (required) ​

Every call carries a unique transaction_ref. Your wallet MUST be idempotent: a repeated transaction_ref returns the same result (the same transaction_id) and does not move money again. We resend after a timeout, so the same ref will arrive more than once — key your ledger writes on it.

A reversal (refund, win_reversal, uncancel) carries original_transaction_ref, the ref of the call it reverses.

Request ​

All fields are snake_case. Money is a decimal string at the currency's scale ("12.50", "1200" for JPY, "1.250" for KWD) — parse it as a decimal, never as a binary float. Ids are strings: market ids are 64-bit and may be negative.

json
{
  "version": "2",
  "type": "bet",
  "direction": "debit",
  "transaction_ref": "bet:2122911833504366592",
  "operator_id": "<SITE_ID>",
  "ticket_id": "2122911833504366592",
  "user_id": "<PLAYER_ID>",
  "amount": "10.00",
  "currency": "EUR",
  "stake": "10.00",
  "potential_win": "38.85",
  "total_odds": "3.885",
  "bet_type": "combi",
  "is_live": true,
  "selections": [
    { "event_id": "126946", "sport_id": "1", "category_id": "9", "tournament_id": "17",
      "market_id": "-5920830497385748337", "market_type_id": "1", "outcome_id": "3",
      "odds": "1.85", "is_live": true, "event_start": "2026-11-21T19:00:00Z" },
    { "event_id": "126947", "sport_id": "1", "category_id": "9", "tournament_id": "17",
      "market_id": "9007199254740993", "market_type_id": "18", "outcome_id": "12",
      "odds": "2.10", "is_live": false, "event_start": "2026-11-21T21:00:00Z" }
  ],
  "created_at": "2026-11-21T19:20:00Z"
}

A win after settlement adds the outcome:

json
{
  "version": "2", "type": "win", "direction": "credit",
  "transaction_ref": "win:2122911833504366592", "ticket_id": "2122911833504366592",
  "operator_id": "<SITE_ID>", "user_id": "<PLAYER_ID>",
  "amount": "38.85", "win_amount": "38.85", "currency": "EUR",
  "bet_type": "combi", "total_odds": "3.885", "is_live": true, "ticket_status": "won",
  "selections": [ { "event_id": "126946", "…": "…", "result": "won" },
                  { "event_id": "126947", "…": "…", "result": "won" } ],
  "settled_at": "2026-11-21T21:52:10Z"
}
FieldSent onNotes
versionall"2"
type, directionallSee Transaction types
transaction_refallThe idempotency key
original_transaction_refreversalsThe ref being reversed
operator_idallYour site id
ticket_id, user_idallStrings
amount, currencyallThe money this call moves
stake, potential_winbetstake equals amount: what the whole coupon costs (a 2/3 system at 5 per bet costs 15)
win_amountwin, cashout*Equals amount
bet_typeallsingle, combi, system, betbuilder
systemsystem bets"2/3"; several sizes: "2,3/4"
total_oddswhen knownDecimal string
is_livewhen knownTrue when any leg was live when placed
ticket_statusafter a settlementopen, won, lost, void, cashed_out, cancelled — the ticket's status after this call
selectionsallThe legs, below
created_at / settled_atbet / win, cashout*RFC 3339, UTC

selections[] ​

FieldNotes
event_idMatch id
sport_id, category_id, tournament_idIts place in the catalogue
market_id, market_type_id, outcome_idThe pick; market_type_id matches the catalogue's market types
oddsDecimal string, at least two decimals
is_liveWhether this leg was live when placed
event_startScheduled start, RFC 3339 UTC
resultAfter a settlement: open, won, lost, void, half_won, half_lost

A field we cannot know is left out: is_live, event_start and category_id are absent on tickets placed before contract v2. Do not require them.

Signatures ​

Every call is signed with an Ed25519 key of your site, so your wallet can tell our calls from anyone who learns its URL. Verify every call before moving money.

X-Oddyne-Key-Id:    wk_3f9a1c0d2b7e4a51
X-Oddyne-Timestamp: 1795000000
X-Oddyne-Signature: v1=<base64 signature>

The signed string is five lines joined by \n:

v1
<X-Oddyne-Timestamp>
POST
<path with query, exactly as received — e.g. /bet>
<lowercase hex SHA-256 of the raw request body>

To verify:

  1. Look up the public key by X-Oddyne-Key-Id. Unknown → refuse.
  2. Refuse a timestamp more than 300 seconds from your clock.
  3. Hash the raw body bytes (before any JSON parsing), build the string, verify.
js
import { createHash, createPublicKey, verify } from 'node:crypto'

// keys: { "wk_3f9a…": "<base64 public key from the backoffice>" }
export function verifyOddyne(method, pathWithQuery, headers, rawBody, keys) {
  const id = headers['x-oddyne-key-id'], ts = headers['x-oddyne-timestamp']
  const sig = (headers['x-oddyne-signature'] || '').replace(/^v1=/, '')
  if (!keys[id] || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false
  const hash = createHash('sha256').update(rawBody).digest('hex')
  const msg = ['v1', ts, method.toUpperCase(), pathWithQuery, hash].join('\n')
  // An Ed25519 public key as SPKI DER: the fixed 12-byte prefix + the 32 raw bytes.
  const der = Buffer.concat([Buffer.from('302a300506032b6570032100', 'hex'), Buffer.from(keys[id], 'base64')])
  const key = createPublicKey({ key: der, format: 'der', type: 'spki' })
  return verify(null, Buffer.from(msg), key, Buffer.from(sig, 'base64'))
}

Answer a call that fails verification with HTTP 401 and {"status":"error","error_code":"INVALID_SIGNATURE"}.

Keys and rotation ​

Create the site's key in the backoffice or with the Admin API, and register its public key and key id with your wallet. The private key never leaves us.

The newest active key signs; a change takes effect within 30 seconds. To rotate without a gap:

  1. Create a second key and register it with your wallet alongside the first.
  2. Wait 30 seconds — calls now carry the new key id.
  3. Retire the old key, then remove it from your wallet.

A site without any key sends unsigned calls. Once your wallet requires signatures, keep at least one active key.

Response ​

Every call is answered the same way:

json
{ "status": "ok", "transaction_id": "your-ledger-tx-id" }
json
{ "status": "error", "error_code": "INSUFFICIENT_FUNDS", "error_message": "balance 4.20" }

How we read your answer:

Your answerMeansWe
200 + "status":"ok"Applied (or already applied, for a replay)Done
200 or 4xx + "status":"error"A definite noDo not resend. A refused bet is a refused bet
5xx, no answer within 5 s, connection error, unreadable bodyUnknownResend the same call (below)

200 with an error body is a refusal — 200 alone is not acceptance.

Resending:

  • Credits (win, cashout*, refund) and reversals are resent with backoff (5 s, doubling up to 10 minutes) until you answer. A winner is never left unpaid because your wallet was down.
  • A bet is resent only for 2 minutes. Past that, see below.

A definite refusal of a credit or a reversal is not resent automatically: it is flagged to us for reconciliation. Refuse money-out only when it is truly wrong (an unknown player) — and note that an invalid signature after a botched key rotation refuses credits too.

Unconfirmed debits ​

When a bet gets no definite answer within 2 minutes, the bet is refused to the player and we send a refund with transaction_ref betrefund:<ticket> and original_transaction_ref bet:<ticket>, for the full stake:

  • if you did take the stake: return it;
  • if you never saw the bet: answer "status":"ok" and move nothing.

Either way the player ends whole. A refund of a stake you never took is a success, not an error.

Error codes ​

Use these error_codes on a refused bet; the player's coupon shows the matching message:

error_codeThe player sees
INSUFFICIENT_FUNDSBalance too low for the stake (place_bet.insufficient_funds)
PLAYER_BLOCKEDThe account cannot bet now (place_bet.player_blocked)
LIMIT_EXCEEDEDThe stake exceeds a limit on the account (place_bet.limit_exceeded)
CURRENCY_MISMATCHThe currency does not match the account (place_bet.currency_mismatch)
INVALID_SIGNATUREA generic refusal (place_bet.wallet_rejected); we are alerted
anything elseA generic refusal (place_bet.wallet_rejected)

Test your integration ​

When your callbacks are implemented, prove them from the backoffice before a player does: Integration → Wallet integration test. It signs its calls with your site's key exactly as the money path does, in seven steps:

#CallWhat it proves
1betThe debit is accepted.
2bet — same transaction_refIdempotency. Your reply must carry the same transaction_id and must not debit again.
3refundThe stake is returned, naming the debit via original_transaction_ref.
4refund — same refIdempotency.
5winThe credit is accepted.
6win — same refIdempotency.
7win_reversalThe credit is reversed.

Every debit and every credit is reversed, so a correct wallet ends exactly where it started. You choose the player id, the currency and the amount.

Each step reports its verdict with the HTTP status, the round-trip time, your transaction_id / error_code, and the exact request body.

This moves real money on your ledger

Use a test player account. If a reversal fails, the balance is left off zero and the report says by how much, so you can close it by hand.

What the verdicts mean ​

  • Pass — the call answered as this page requires.
  • Unproven — the call succeeded but returned no transaction_id, so idempotency could not be checked. Return one on success and it becomes a pass.
  • Fail — the contract was broken. The most serious one is NOT IDEMPOTENT: the same transaction_ref came back with a different transaction_id, meaning you booked it twice. We will resend after a timeout, so this double-charges the player.
  • Skipped — a step it depends on failed. A reversal is never sent for a debit that was refused.

Timing ​

Each call gets the same 5-second budget the live money path uses. A wallet that is too slow here is too slow in production, so treat the round-trip time as a real number.

Finding the calls in your logs ​

Every request in a run carries a transaction_ref of the form oddyne-probe:<runId>:<step>; the run id is shown at the top of the report. The selections[] array holds one synthetic leg with zeroed ids — do not reject on it.

Integration documentation for the Oddyne Sportsbook.