Appearance
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:
| Path | Carries |
|---|---|
POST <WALLET_URL>/bet | bet |
POST <WALLET_URL>/win | win, cashout, cashout_partial |
POST <WALLET_URL>/rollback | refund, win_reversal, uncancel, resettle_adjust |
Branch on type, not on the path. The paths are kept for wallets built on version 1.
Transaction types
type | direction | When | transaction_ref |
|---|---|---|---|
bet | debit | A bet is placed | bet:<ticket> |
win | credit | A ticket settles won (or void: the stake comes back) | win:<ticket> |
cashout | credit | The player sells the whole ticket | cashout:<ticket> |
cashout_partial | credit | The player sells part of the ticket; it keeps running on the rest | cashout:<ticket>:partial:<cumulative> |
refund | credit | A bet is cancelled and its stake returned — also an unconfirmed debit, see below | refund:<ticket>, betrefund:<ticket> |
win_reversal | debit | A paid ticket is cancelled | rollback:<ticket> |
uncancel | debit | A cancellation is reversed: the refunded stake is taken again | uncancel:<ticket> |
resettle_adjust | debit or credit | A settled ticket's result is corrected — see Re-settlement | resettle:<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:
- 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). - The corrected result settles it again. If it pays, the payout is a
resettle_adjust,credit— not a secondwin.
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 debitsand 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:
| Step | Call | Paid so far |
|---|---|---|
| Settles won | win win:77, 20.00 | 20.00 |
| Corrected (reopened) | resettle_adjust debit resettle:77:1, 20.00, ticket_status: open | 0.00 |
| Settles lost | none (n = 2 used, nothing to pay) | 0.00 |
| Corrected again (reopened) | none (n = 3 used, nothing was paid) | 0.00 |
| Settles won | resettle_adjust credit resettle:77:4, 20.00, ticket_status: won | 20.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"
}| Field | Sent on | Notes |
|---|---|---|
version | all | "2" |
type, direction | all | See Transaction types |
transaction_ref | all | The idempotency key |
original_transaction_ref | reversals | The ref being reversed |
operator_id | all | Your site id |
ticket_id, user_id | all | Strings |
amount, currency | all | The money this call moves |
stake, potential_win | bet | stake equals amount: what the whole coupon costs (a 2/3 system at 5 per bet costs 15) |
win_amount | win, cashout* | Equals amount |
bet_type | all | single, combi, system, betbuilder |
system | system bets | "2/3"; several sizes: "2,3/4" |
total_odds | when known | Decimal string |
is_live | when known | True when any leg was live when placed |
ticket_status | after a settlement | open, won, lost, void, cashed_out, cancelled — the ticket's status after this call |
selections | all | The legs, below |
created_at / settled_at | bet / win, cashout* | RFC 3339, UTC |
selections[]
| Field | Notes |
|---|---|
event_id | Match id |
sport_id, category_id, tournament_id | Its place in the catalogue |
market_id, market_type_id, outcome_id | The pick; market_type_id matches the catalogue's market types |
odds | Decimal string, at least two decimals |
is_live | Whether this leg was live when placed |
event_start | Scheduled start, RFC 3339 UTC |
result | After 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:
- Look up the public key by
X-Oddyne-Key-Id. Unknown → refuse. - Refuse a timestamp more than 300 seconds from your clock.
- 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:
- Create a second key and register it with your wallet alongside the first.
- Wait 30 seconds — calls now carry the new key id.
- 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 answer | Means | We |
|---|---|---|
200 + "status":"ok" | Applied (or already applied, for a replay) | Done |
200 or 4xx + "status":"error" | A definite no | Do not resend. A refused bet is a refused bet |
5xx, no answer within 5 s, connection error, unreadable body | Unknown | Resend 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
betis 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_code | The player sees |
|---|---|
INSUFFICIENT_FUNDS | Balance too low for the stake (place_bet.insufficient_funds) |
PLAYER_BLOCKED | The account cannot bet now (place_bet.player_blocked) |
LIMIT_EXCEEDED | The stake exceeds a limit on the account (place_bet.limit_exceeded) |
CURRENCY_MISMATCH | The currency does not match the account (place_bet.currency_mismatch) |
INVALID_SIGNATURE | A generic refusal (place_bet.wallet_rejected); we are alerted |
| anything else | A 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:
| # | Call | What it proves |
|---|---|---|
| 1 | bet | The debit is accepted. |
| 2 | bet — same transaction_ref | Idempotency. Your reply must carry the same transaction_id and must not debit again. |
| 3 | refund | The stake is returned, naming the debit via original_transaction_ref. |
| 4 | refund — same ref | Idempotency. |
| 5 | win | The credit is accepted. |
| 6 | win — same ref | Idempotency. |
| 7 | win_reversal | The 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 sametransaction_refcame back with a differenttransaction_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.