Guides
There are two kinds of failure, and they arrive in different places:
200 with
"status": "pending"), but the bookie did not take the bet. These arrive
later, in the result of /api/bet_status
(or your webhook), with success: false and a machine-readable
outcome_code.Most errors are the standard FastAPI shape - one detail field, usually a
string:
A body that fails schema validation (for example a missing X-API-Key
header) is 422:
An unexpected server error is 500:
Every response is JSON - never an HTML error page.
| Status | Meaning | Typical detail |
|---|---|---|
200 | OK. On async routes this means accepted - read "status": "pending" and poll | - |
400 | Bad request body | "session_id is required", "callback_url must be a public http(s) URL" |
401 | Unknown API key | "Invalid API key" |
403 | Key is valid but not allowed | "No valid subscription", "Betting is not enabled on this account.", "Session does not belong to user", "Session is not active", "Session <id> is a copy session (copy_session): …" (bet on the account's open session instead) |
404 | Not found | "Session not found" |
409 | The same idempotency_key while the first request is still being accepted | "idempotency_key in flight; poll bet_status" |
410 | Retired endpoint (/v2/place_bet, /v2/promos, /v2/bonus_bets, /v2/promo_tokens, GET /v2/transactions, ...) | names the /v3 successor |
422 | Validation failure, or a bet the server refuses on shape (e.g. a sports bet on a racing-only bookie) | see above |
429 | Too many requests, or a deliberate back-off. Honour the Retry-After header | "Back-off: the bookie refused this account's recent bets ..." |
500 | Server error | see above |
503 | A dependency is temporarily unavailable (e.g. your PC is offline, a cache is not loaded) | "PC is not online. Please ensure the client is running." |
The API key goes in the X-API-Key header - not Authorization.
outcome_codeA bet that was accepted but failed at the bookie looks like this in
/api/bet_status:
Branch on outcome_code, not on the human text. Common values:
outcome_code | Meaning |
|---|---|
odds_below_target, odds_moved | Price is under your target_odds or moved |
insufficient_funds | Balance too low |
stake_below_min, stake_above_max | Stake outside the bookie's limits |
race_closed, event_suspended, selection_closed, runner_scratched | Market shut or runner gone |
event_not_carried, market_not_carried, selection_not_carried, line_not_offered | This bookie doesn't offer it |
no_promo_token, promo_not_eligible, promo_expired | Promo/bonus problem |
account_limited, account_disabled | The bookie has restricted the account |
transport_error, timeout, bookie_server_error | Transient - nothing is live |
placement_uncertain, duplicate_bet | The bet may already be on. Never re-send. |
Everything except placement_uncertain and duplicate_bet means nothing is
live and a re-send is safe. A poll status of timeout or unknown is not
a bet failure: treat it as unknown and check your transactions before
re-sending, or use an idempotency_key so a re-send can never double up.
success: true is not always a confirmed betplacement_uncertain can also arrive on a result with success: true and
confirmed_bet: false. That is a bet the bookmaker is holding rather
than one it accepted: Ladbrokes and Neds answer "Processing" when a trader
reviews the bet, and the trader can still accept it or reject it minutes
later. Never re-send it, and do not treat it as live yet: check the bookmaker
account (or the bet's result later).
What happens next is not sent to you as a second result: this poll result stays as it is. The bot listens for the trader's decision for up to 30 minutes after placing. If the trader rejects the whole bet, it is removed from your bet history and any credits charged for it are refunded. If the trader accepts it (or accepts part of the stake), it stays and settles normally: its profit or loss is worked out from the stake the bookmaker actually took, while the stake shown on the bet stays at what you sent. If no decision is heard in that time, the bet stays as recorded: check it at the bookmaker.
stake_above_max: the refusal carries the bookie's maximumFor most bookmakers (Sportsbet included), a stake over the bookmaker's maximum
on /v3/place_bet is refused in full - nothing is placed and the engine
does not resend at a smaller amount. (Sportsbet's own website auto-fills the
maximum into the betslip for you to confirm; the betting API does not do
that.) If the bookmaker stated its maximum, the refusal carries it as a number
in result.max_stake (on the poll and in your webhook):
To take the reduced amount, resend the bet yourself at or below max_stake.
If max_stake is absent, the bookmaker did not state a number. A stated
maximum of $0 surfaces as account_limited instead - no stake will clear it.
On /v3/place_bet_strategy, retry_below_max can do a one-step resize for
you - see Betting Strategies.
The one exception is bet365: when bet365 names its maximum on a cash
single, the engine places the bet once at that maximum instead of refusing it.
The success result then carries stake_capped_to_max: true and
stake_requested (what you asked for) beside the stake actually booked.
It never applies to bets funded from Bet Credits, and a bet365 maximum of
$0.00 is still reported as account_limited.
You choose what happens instead with two optional /v3/place_bet fields:
cap_round_down: 5 places the maximum rounded down to a multiple of 5
($133.33 becomes $130.00; the success result also carries max_stake, bet365's
own number), and on_max_stake: "reject" places nothing and returns the
refusal with max_stake, like every other bookmaker, so you can resend a
round stake. If rounding down leaves less than $0.10, nothing is placed.
PlayUp / NextBet neither refuse nor ask: on a sports bet over the
account's limit the bookmaker itself accepts part of the stake and confirms the
bet at the smaller amount. The result is a success, stake is the amount
actually booked, and it also carries stake_reduced: true and
stake_requested (what you asked for). The bet stands at the booked amount and
cannot be cancelled, so compare stake with what you sent before treating a
two-sided position (an arb or a hedge) as balanced.
500/503 and network errors with a short back-off.429, wait for Retry-After seconds.idempotency_key on /v3/place_bet so a blind retry returns the
original correlation_id (idempotent_replay: true) instead of placing a
second bet.400/401/403/404/410/422 unchanged - fix the request.Pass a trace_id (max 200 chars) on /v3/place_bet; it is echoed on the
submit response, the poll and the webhook, so you can tie a failure back to
your own request.