Skip to content

3.1 Bet Ticket Query API

http
GET /api/v1/exchange/report/bets

Paginated, multi-condition query of exchange orders and their associated trades. Data comes from the historical store and may have a few seconds of sync delay; the most recent 6 months of data is retained. Requests must include the HMAC authentication header.

TIP

This API is rate-limited to 100 requests / minute (per api_key); exceeding it returns code:10060.

Request Parameters (Query String)

TIP

Provide one of two time ranges: order_start_time/end_time (order time) or settlement_start_time/end_time (settlement time). At least one pair is required, and the span must not exceed 90 days.

FieldRequiredTypeDescription
order_start_time / order_end_timeTRUEstringOrder time range (start_time ≥, end_time ≤), RFC3339 UTC, e.g. 2026-05-19T00:00:00Z; may be omitted if the settlement time range is provided
settlement_start_time / settlement_end_timeConditional*stringSettlement time range (start_time ≥, end_time ≤), RFC3339 UTC; may be omitted if the order time range is provided
langFALSEstringLANGUAGE_ZH_CN / LANGUAGE_EN (defaults to English)
order_idFALSEstringOrder number
trade_idFALSEstringTrade number; filters orders containing this trade
idempotency_keyFALSEstringIdempotency key
player_external_id / player_nameFALSEstringPlayer ID / name
sport_id / tournament_id / event_id / market_id / outcome_idFALSEstringEvent / tournament filters
sideFALSEstringEXCHANGE_SIDE_BACK / EXCHANGE_SIDE_LAY
statusFALSEstringOrder status (see enum)
settlement_statusFALSEstringSettlement status filter (see enum)
currencyFALSEstringCurrency filter; must match the currency bound to the agent; see supported currency list
page / page_sizeTRUEintegerPagination. page starts at 1, default 1; page_size default 10, max 200; values ≤0 or >200 fall back to 10

Response data

data contains items[] (orders) and pagination fields. Amount fields: the usd_ prefix denotes USD; no prefix denotes player currency.

json
{
  "code": 0,
  "message": "success",
  "data": {
    "items": [
      {
        "order_id": "019e0000-0000-0000-0000-000000000000",
        "idempotency_key": "00000000-0000-0000-0000-000000000000",
        "player_id": "00000000-0000-0000-0000-000000000000",
        "player_external_id": "player1",
        "player_name": "player1_name",
        "agent_id": "00000000-0000-0000-0000-000000000001",
        "agent_name": "agent_demo",
        "sport_id": "sr:sport:1",
        "sport_name": "足球",
        "tournament_id": "sr:tournament:16",
        "tournament_name": "World Cup",
        "event_id": "sr:match:00000000",
        "event_name": "Team A vs Team B",
        "event_start_time": "2026-06-13T01:00:00Z",
        "market_id": "1",
        "market_name": "Match Winner",
        "outcome_id": "1",
        "outcome_name": "Team A",
        "home_competitor_id": "sr:competitor:0001",
        "home_competitor": "Team A",
        "away_competitor_id": "sr:competitor:0002",
        "away_competitor": "Team B",
        "home_score": "1",
        "away_score": "0",
        "period_home_score": "1",
        "period_away_score": "0",
        "match_status": "6",
        "event_status": "1",
        "source_odds": "1.9",
        "source_back_odds": "1.9",
        "source_lay_odds": "2.23",
        "source_active": true,
        "side": "EXCHANGE_SIDE_BACK",
        "odds": "1.91",
        "currency": "EUR",
        "mid_rate": "0.86",
        "stake": "85",
        "usd_stake": "98.83",
        "deducted_amount": "85",
        "usd_deducted_amount": "98.83",
        "usd_filled": "98.83",
        "usd_unmatched": "0",
        "status": "EXCHANGE_ORDER_STATUS_FILLED",
        "trades": [
          {
            "account_id": "00000000-0000-0000-0000-000000000000",
            "name": "player1_name",
            "event_id": "sr:match:00000000",
            "market_id": "1",
            "outcome_id": "1",
            "order_id": "019e0000-0000-0000-0000-000000000000",
            "trade_id": "00000000-0000-0000-0000-000000000070",
            "side": "back",
            "role": "taker",
            "odds": "1.91",
            "usd_stake": "98.83",
            "usd_matched_delta": "98.83",
            "matched_delta": "85",
            "currency": "EUR",
            "mid_rate": "0.86",
            "fx_base": "85",
            "fx_usd_base": "98.83",
            "settlement_status": "EXCHANGE_TRADE_SETTLEMENT_STATUS_SETTLED",
            "settlement_result": "EXCHANGE_TRADE_SETTLEMENT_RESULT_WIN",
            "usd_settlement_pnl": "89.94",
            "usd_net_pnl": "85.44",
            "usd_commission": "4.50",
            "settlement_pnl": "77.35",
            "net_pnl": "73.48",
            "commission": "3.87",
            "commission_rate": "0.05",
            "status": "accepted",
            "trade_time": "2026-06-12T04:01:59Z",
            "settled_time": "2026-06-13T04:33:09Z"
          }
        ],
        "total_pnl": "73.48",
        "order_time": "2026-06-12T04:01:59Z",
        "updated_at": "2026-06-13T04:33:09Z",
        "client_ip": "0.0.0.0",
        "device_type": "PC",
        "device_id": "00000000000000000000000000000000",
        "url": "https://backoffice.example.com/#/orders?order_id=019e0000-0000-0000-0000-000000000000&key=xxxx&exp=0000000000"
      }
    ],
    "total": 6,
    "page": 1,
    "page_size": 20,
    "total_pages": 1
  }
}

items[] Fields

FieldTypeDescription
order_idstringOrder number, unique per order
idempotency_keystringIdempotency key
player_idstringPlatform-internal player UUID
player_external_idstringPlayer ID (merchant side)
player_namestringPlayer name
agent_idstringPlatform-internal agent UUID
agent_namestringAgent name
sport_idstringSport ID
sport_namestringSport name
tournament_idstringTournament ID
tournament_namestringTournament name
event_idstringEvent ID
event_namestringEvent name
event_start_timestringEvent start time (RFC3339 UTC)
market_idstringMarket ID
market_namestringMarket name
outcome_idstringOutcome ID
outcome_namestringOutcome name
specifiersstringMarket specifiers (e.g. hcp=1.25); empty string for markets without specifiers
extended_specifiersstringExtended market specifiers; present only for variant-type markets
home_competitor_id / away_competitor_idstringHome / away team ID
home_competitor / away_competitorstringHome / away team name
home_score / away_scorestringCurrent home / away score; returned only for in-progress or finished events
period_home_score / period_away_scorestringCurrent period / half score; returned only for in-progress or finished events
match_statusstringMatch status code
event_statusstringEvent status code (see enum)
source_oddsstringSource reference odds (European/decimal)
source_back_oddsstringSource Back odds (European/decimal)
source_lay_oddsstringSource Lay odds (European/decimal)
source_activebooleanWhether the market is active
sidestringBet side (EXCHANGE_SIDE_*)
oddsstringMatched odds (European/decimal)
currencystringPlayer currency
mid_ratestringExchange rate at order time (1 USD = mid_rate player currency)
stakestringStake (player currency)
usd_stakestringStake (USD)
deducted_amountstringActual deduction (player currency)
usd_deducted_amountstringActual deduction (USD)
usd_filledstringMatched amount (USD)
usd_unmatchedstringUnmatched amount (USD)
statusstringOrder status (see enum)
cancel_causestringCancellation reason; returned only when status = CANCELLED / PARTIAL_CANCELLED
tradesarrayTrade list for this order; contains only matched trades — empty array if the order has not been matched
total_pnlstringFinal net profit of this order (player currency, commission deducted); see formula; not returned before settlement completes
order_timestringOrder time (RFC3339 UTC)
updated_atstringLast update time (RFC3339 UTC)
client_ipstringClient IP at order time
device_typestringDevice type (e.g. PC)
device_idstringDevice identifier
urlstringBack-office ticket detail page link

trades[] Fields

An order can be split into multiple trades; each successful match generates one trade.

FieldTypeDescription
account_idstringPlayer account UUID (same as player_id)
namestringPlayer name
event_idstringEvent ID
market_idstringMarket ID
specifiersstringMarket specifiers (present only for variant-type markets)
outcome_idstringOutcome ID
order_idstringParent order number, unique per order
trade_idstringTrade number, unique per trade
sidestringSide back / lay; determines the sign of PnL
rolestringRole maker / taker; determines commission_rate
oddsstringTrade odds (European/decimal)
usd_stakestringStake (USD)
usd_matched_deltastringAmount matched this time (USD)
matched_deltastringAmount matched this time (player currency)
currencystringPlayer currency
mid_ratestringExchange rate (1 USD = mid_rate player currency)
fx_basestringMaximum exposure of this order (player currency); matches the order-level deducted_amount
fx_usd_basestringMaximum exposure of this order (USD); matches usd_deducted_amount
settlement_statusstringSettlement status (see enum)
settlement_resultstringSettlement result (see enum)
usd_settlement_pnlstringSettlement PnL (USD); see formula; not returned before settlement
usd_net_pnlstringNet profit after settlement (USD, commission deducted); see formula; not returned before settlement
usd_commissionstringCommission (USD); see formula
settlement_pnlstringSettlement PnL (player currency); see formula; not returned before settlement
net_pnlstringNet profit after settlement (player currency, commission deducted); see formula; not returned before settlement
commissionstringCommission (player currency); see formula
commission_ratestringCommission rate; taker = 0.05, maker = 0.03
void_reasonstringVoid reason; returned only when settlement_result = VOID
statusstringTrade status (accepted)
trade_timestringTrade time (RFC3339 UTC)
settled_timestringSettlement time (RFC3339 UTC); not returned before settlement

Amount Calculation Formulas

TIP

All player-currency amounts = the corresponding USD amount × mid_rate; for USD players mid_rate = 1, so the values are equal.

Settlement PnL usd_settlement_pnl

ScenarioFormula
back winusd_matched_delta × (odds − 1)
back lose−usd_matched_delta
lay win / loseOpposite of the counterparty back, = −back_pnl
push / full void (void_factor = 1)0
half void (void_factor = 0.5)The above result ÷ 2
dead heatWinning side result × dead_heat_factor; losing side unchanged

Commission usd_commission

Charged only on the winning side: when usd_settlement_pnl > 0, = usd_settlement_pnl × commission_rate; otherwise 0.

Net PnL usd_net_pnl

usd_net_pnl = usd_settlement_pnlusd_commission

Player Currency Conversion

settlement_pnl = usd_settlement_pnl × mid_rate

commission = usd_commission × mid_rate

net_pnl = settlement_pnlcommission

Order Total Net PnL total_pnl

total_pnl = Σ net_pnl of all matched trades in this order (player currency)

Enums

Order Status (prefix EXCHANGE_ORDER_STATUS_)

ValueDescriptionFund Status
PENDINGOrder placed, awaiting engine confirmationDeducted
OPENConfirmed by engine, resting order awaiting matchDeducted
PARTIALLY_FILLEDPartially matchedDeducted
FILLEDFully matchedDeducted
CANCELLEDCancelled (no matches)Fully refunded
PARTIAL_CANCELLEDCancelled (matched portion kept, remainder refunded)Unmatched portion refunded
FAILEDOrder failed, rejected by engineFully refunded

Settlement Status (prefix EXCHANGE_TRADE_SETTLEMENT_STATUS_)

ValueDescription
PENDINGAwaiting settlement
SETTLEDSettled
VOIDEDVoided

Settlement Result (prefix EXCHANGE_TRADE_SETTLEMENT_RESULT_)

ValueDescription
UNSPECIFIEDNot yet settled
WINFull win
HALF_WINHalf win
PUSHPush refund
HALF_LOSEHalf lose
LOSEFull lose
VOIDVoid

Event Status (event_status)

ValueLabelDescription
0not_startedMatch scheduled, not yet started
1liveMatch in progress
2suspendedMatch suspended
3endedMatch ended
4closedMatch result confirmed

Trade Status Combinations

Business meaning of the combinations of the three fields status / settlement_status / settlement_result:

statussettlement_statussettlement_resultBusiness Meaning
pendingPENDINGUNSPECIFIEDMatching
acceptedPENDINGUNSPECIFIEDMatched, awaiting event settlement
acceptedSETTLEDWINSettled, win
acceptedSETTLEDHALF_WINSettled, half win (e.g. 0.25 handicap)
acceptedSETTLEDPUSHSettled, push refund
acceptedSETTLEDHALF_LOSESettled, half lose
acceptedSETTLEDLOSESettled, lose
acceptedVOIDEDVOIDBet voided and refunded
rejectedPENDINGUNSPECIFIEDMatching failed, refunded

BFX EXCHANGE · BE THE GAME CHANGER