Retrieve normalized transaction history including settled bets, pending bets, and account activity.
Base URL: https://api.b337.ai
POST /v3/transactionsis the new home for this endpoint. It uses the same async contract as/v3/place_bet: a 202 response in ~100ms with acorrelation_id, then poll/api/bet_status(or receive a signed webhook atcallback_url) for the actual transaction list. Theresultpayload is identical to whatGET /v2/transactionsreturned synchronously - so existing parsing code only needs to know where to read it from.The method changed from
GET(query params) toPOST(JSON body) so that the v3 endpoint can acceptcallback_url- same convention as every other v3 endpoint.
POST /v3/transactions {#v3-transactions}| Field | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Active session ID |
days_back | int | No | Number of days of history. Default 7. Must be > 0 |
limit | int | No | Maximum transactions to return. Default 50. Must be > 0 |
callback_url | string | No | If set, the result is POSTed to this URL when ready (http:// or https://). If absent, poll for the result. |
{ "session_id": "uuid", "days_back": 7, "limit": 20 }
Standard v3 async envelope:
{ "status": "pending", "correlation_id": "9b3c…uuid…", "session_id": "uuid", "bookie": "tab", "username": "user@example.com", "submitted_at": "2026-05-14T10:00:00.000Z", "timeout_at": "2026-05-14T10:05:00.000Z", "callback_url": null }
Retrieve the result by polling POST /api/bet_status with the
correlation_id, or via webhook if you passed callback_url. Signature
verification, retry behaviour, and status values are identical to every
other v3 endpoint - see the
Async API (v3) guide.
The polling endpoint
/api/bet_statusworks for anycorrelation_id- place_bet, withdraw-balance, price_check, transactions.
result payloadThe result field on the poll response (and the webhook body) carries
exactly what /v2/transactions used to return inline:
{ "success": true, "transactions": [ { "id": "bet_12345678", "type": "bet", "status": "won", "stake": 10.00, "odds": 3.50, "pnl": 25.00, "is_bonus_bet": false, "placed_at": "2026-02-03T10:00:00Z", "settled_at": "2026-02-03T12:30:00Z", "selections": [ { "event": "Flemington R3", "selection": "Horse Name", "market": "win", "odds": 3.50, "result": "won" } ] }, { "id": "bet_12345679", "type": "bet", "status": "lost", "stake": 5.00, "odds": 2.10, "pnl": -5.00, "is_bonus_bet": true, "placed_at": "2026-02-03T09:00:00Z", "settled_at": "2026-02-03T11:00:00Z", "selections": [ { "event": "Randwick R1", "selection": "Another Horse", "market": "place", "odds": 2.10, "result": "lost" } ] }, { "id": "bet_12345680", "type": "bet", "status": "pending", "stake": 20.00, "odds": 4.50, "pnl": 0, "is_bonus_bet": false, "placed_at": "2026-02-03T14:00:00Z", "settled_at": null, "selections": [ { "event": "Caulfield R5", "selection": "Fast Runner", "market": "win", "odds": 4.50, "result": "pending" } ] } ], "total_count": 45, "has_more": true }
| Field | Type | Description |
|---|---|---|
| id | string | Unique transaction/bet ID |
| type | string | Transaction type ("bet", "deposit", "withdrawal") |
| status | string | Status ("won", "lost", "pending", "void") |
| stake | float | Amount wagered |
| odds | float | Final odds (null for pending) |
| pnl | float | Profit/loss amount |
| is_bonus_bet | bool | Whether bonus bet was used |
| placed_at | string | When bet was placed (ISO 8601) |
| settled_at | string | When bet was settled (null if pending) |
| selections | array | Array of selection objects |
| Field | Type | Description |
|---|---|---|
| event | string | Event name (e.g., "Flemington R3") |
| selection | string | Selection name (runner, team, etc.) |
| market | string | Market type ("win", "place", etc.) |
| odds | float | Odds for this selection |
| result | string | Result ("won", "lost", "pending") |
result)| Field | Type | Description |
|---|---|---|
| success | bool | Whether the request succeeded |
| transactions | array | Array of transaction objects |
| total_count | int | Total transactions matching criteria |
| has_more | bool | Whether more transactions are available |
| Status | Description |
|---|---|
won | Bet won - pnl is positive |
lost | Bet lost - pnl is negative (or 0 for bonus bets) |
pending | Bet not yet settled |
void | Bet was voided/refunded |
cashed_out | Bet was cashed out early |
import requests, time API_KEY = "your-api-key" BASE_URL = "https://api.b337.ai" HEADERS = {"X-API-Key": API_KEY, "Content-Type": "application/json"} # 1. Submit (202 in ~100ms) submit = requests.post( f"{BASE_URL}/v3/transactions", headers=HEADERS, json={"session_id": "uuid", "days_back": 7, "limit": 20}, ).json() cid = submit["correlation_id"] timeout_at = submit["timeout_at"] deadline = time.mktime(time.strptime(timeout_at[:19], "%Y-%m-%dT%H:%M:%S")) # 2. Poll /api/bet_status until done while time.time() < deadline: r = requests.post( f"{BASE_URL}/api/bet_status", headers=HEADERS, json={"correlation_ids": [cid]}, ).json() entry = r["statuses"][0] if entry["status"] == "completed": payload = entry["result"] # Calculate stats - payload shape is identical to /v2/transactions txns = payload["transactions"] total_pnl = sum(t["pnl"] for t in txns) wins = sum(1 for t in txns if t["status"] == "won") losses = sum(1 for t in txns if t["status"] == "lost") pending = sum(1 for t in txns if t["status"] == "pending") print(f"P&L: ${total_pnl:+.2f}") print(f"Record: {wins}W - {losses}L ({pending} pending)") break if entry["status"] in ("timeout", "unknown"): print(f"Failed: {entry['status']}") break time.sleep(2)
⚠️ Deprecated - sunset 2026-05-17.
GET /v2/transactionsstill works but now returns deprecation response headers:Deprecation: true Sunset: Sun, 17 May 2026 00:00:00 GMT Link: </v3/transactions>; rel="successor-version"After 17 May 2026 it will return HTTP 410. Migrate to
POST /v3/transactions- same payload shape, just wrapped in the async envelope. Note the method changed from GET to POST and the params moved from query string to JSON body.
GET /v2/transactions?session_id=xxx&days_back=7&limit=20
| Parameter | Type | Required | Description |
|---|---|---|---|
| session_id | string | Yes | Active session ID |
| days_back | int | No | Number of days of history (default: 7, max: 30) |
| limit | int | No | Maximum transactions to return (default: 50, max: 500) |
Returns the same payload shape shown under result payload
above, but inline in the HTTP response body (no correlation_id / no
poll step).
curl -X GET "https://api.b337.ai/v2/transactions?session_id=xxx&days_back=7&limit=20" \ -H "X-API-Key: your-api-key"