Bet Slip Booking API
On this page
How to book a new code from a resolved plan
Use POST /v1/book with a stored plan_id to mint a new booking code from already-resolved picks. Plan mode uses the 10-minute stored plan, the server re-checks the odds before booking, and a successful book costs 2 API credits for the code.
POST /v1/book
{"bookmaker": "sportybet", "plan_id": "plan_...",
"strict": true, "accept_odds_change": false}Plan mode uses the stored plan. The server re-checks the odds before it books.
How to book a new code from direct picks
Use POST /v1/book with a direct picks list to resolve and book in one call without a stored plan. Direct mode sends 1 to 50 picks with event, market, outcome, and odds fields, and a successful book costs 2 API credits for the code.
{"bookmaker": "sportybet",
"picks": [
{"event_id": "sr:match:123", "market_id": "18",
"outcome_id": "12", "odds": "1.90"}
],
"strict": true, "accept_odds_change": false}{
"success": true,
"bookmaker": {"key": "sportybet", "name": "SportyBet"},
"code": "7B9A2F",
"verified": true,
"picks": [...],
"failures": [],
"total_odds": "1.90",
"billing": {"action": "book", "price": 2, "credits_used": 14}
}Direct mode resolves and books in one call.
How strict mode and odds changes affect a book
A Manage Bet Codes book runs in strict mode by default: all picks must resolve or the API returns no code. Set strict: false to create the code with the valid picks and report the failures, and keep accept_odds_change: false to reject any moved price before booking.
| Setting | Default | Effect |
|---|---|---|
strict | true | All picks must resolve, or the API returns no code. |
strict: false | - | Create the code with the valid picks. Report the failures. |
accept_odds_change | false | Reject a moved price. |
The server loads the code back. verified is true only when the load-back has games. A code that exists but fails the load-back returns 201 with verified: false and a warning.
How book fan-out and book pricing work
A Manage Bet Codes book sends 1 to 50 picks and costs 2 API credits for each created code. Add to: [] with 2 to 6 targets to mint one code per target, use a job with kind: "book" for more targets, and note that 1xBet uses one code for each brand while failed targets never fail the batch.
- Send 1 to 50 picks.
- Add
to: []for 2 to 6 targets. One code is created for each target. - Use a job with
kind: "book"for more targets. - A book costs 2 credits for each code. A failed target does not fail the batch.
- 1xBet uses one code for each brand.
- A book job accepts 20 picks, 10 targets, and 50 pick-target pairs.
Which errors can a book return
A book returns 404 plan_not_found for a missing discovery plan, 409 plan_expired for a plan older than 10 minutes, 422 games_not_bookable for unresolved picks in strict mode, 422 odds_changed for a moved price, 422 book_unsupported for a bookmaker that cannot create codes, and 422 book_failed when the bookmaker refuses the code.
| HTTP | Code | When |
|---|---|---|
| 404 | plan_not_found | No discovery plan exists for this key. |
| 409 | plan_expired | The plan is older than 10 minutes. |
| 422 | games_not_bookable | A strict book has unresolved picks. |
| 422 | odds_changed | The price moved beyond the tolerance. |
| 422 | book_unsupported | The bookmaker cannot create a code. |
| 422 | book_failed | The bookmaker refused the code. |