> ## Documentation Index
> Fetch the complete documentation index at: https://docs.55-tech.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get bets

> Retrieve bets by various filters with keyset pagination. At least one filter must be provided.

**Filters (OR logic):**
- `betIds` — Comma-separated list of bet IDs
- `orderIds` — Comma-separated list of order IDs
- `userRef` — User reference string

**Pagination:**
- Results are ordered by betId descending (newest first)
- Use `afterBetId` from `nextCursor` in the response to fetch the next page
- `hasMore` indicates if more results are available

**Bet Status Values:** PENDING, PLACED, CONFIRMED, REJECTED, CANCELLED, FAILED, VOID

**Settlement Status Values:** UNSETTLED, WON, LOST, VOID, HALF_WON, HALF_LOST, PUSH, CASHOUT



## OpenAPI

````yaml /zh/abp-api/openapi.json get /bets
openapi: 3.1.0
info:
  title: ABP v2 - Automated Bet Placing API
  description: >

    Place bets across 32 bookmakers through a single API.


    ## Authentication


    All endpoints require the `x-api-key` header (except `/health`, `/ready`,
    `/status`, `/metrics`).


    **Swagger UI**: Click the **Authorize** button (lock icon) at the top right,
    enter your API key, and click **Authorize**.


    ## Quick Start


    1. **List your accounts**: `GET /accounts`

    2. **Get live odds**: `GET /betslip?fixtureId=...&outcomeId=...&playerId=0`

    3. **Place an order**: `POST /place-orders`

    4. **Track results**: `GET /orders` or subscribe to WebSocket updates


    ## WebSocket


    Connect to `/ws` for real-time order, bet, and settlement updates.


    ```json

    {"type": "login", "apiKey": "your-api-key", "channels": []}

    ```


    Send an empty `channels` array to receive all updates. Available channels:
    `orders`, `bets`, `settlements`, `accounts`, `balance`, `betslip`,
    `fixtures`, `currencies`, `status`, `emergency`.


    Send `{"type": "ping"}` every 30 seconds to keep the connection alive.
  version: '2.0'
servers:
  - url: https://v2.55-tech.com
    description: Production
security:
  - apiKey: []
tags:
  - name: Orders
    description: Place, retrieve, and cancel betting orders
  - name: Bets
    description: Query individual bets placed with bookmakers
  - name: Betslip
    description: Get live odds and metadata for fixtures
  - name: Accounts
    description: Manage bookmaker accounts
  - name: Markets
    description: Get available markets and odds types
  - name: Bookmakers
    description: List supported bookmakers
  - name: Analytics
    description: Positions and profit/loss analytics
paths:
  /bets:
    get:
      tags:
        - Bets
      summary: Get bets
      description: >-
        Retrieve bets by various filters with keyset pagination. At least one
        filter must be provided.


        **Filters (OR logic):**

        - `betIds` — Comma-separated list of bet IDs

        - `orderIds` — Comma-separated list of order IDs

        - `userRef` — User reference string


        **Pagination:**

        - Results are ordered by betId descending (newest first)

        - Use `afterBetId` from `nextCursor` in the response to fetch the next
        page

        - `hasMore` indicates if more results are available


        **Bet Status Values:** PENDING, PLACED, CONFIRMED, REJECTED, CANCELLED,
        FAILED, VOID


        **Settlement Status Values:** UNSETTLED, WON, LOST, VOID, HALF_WON,
        HALF_LOST, PUSH, CASHOUT
      operationId: get_bets
      parameters:
        - name: betIds
          in: query
          required: false
          schema:
            type: string
            nullable: true
          description: Comma-separated bet IDs
          example: 1,2,3
        - name: orderIds
          in: query
          required: false
          schema:
            type: string
            nullable: true
          description: Comma-separated order IDs
          example: 100,101,102
        - name: userRef
          in: query
          required: false
          schema:
            type: string
            nullable: true
          description: User reference to filter by
          example: bettor1234
        - name: afterBetId
          in: query
          required: false
          schema:
            type: integer
            nullable: true
          description: 'Cursor for pagination: fetch bets with betId less than this value'
          example: 1000
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            minimum: 1
            maximum: 1000
          description: Maximum number of bets to return per page
      responses:
        '200':
          description: Successfully retrieved bets
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetsResponse'
              example:
                status: success
                bets:
                  - betId: 67890
                    orderId: 12345
                    bookmaker: pinnacle
                    betStatus: CONFIRMED
                    settlementStatus: UNSETTLED
                    clientName: demo
                    testBet: false
                    requestUuid: eb45b192-317b-42d5-9f65-af497b9fa8c1
                    bookmakerBetId: '3332684214'
                    placedPrice: 1.97
                    placedStake: 10
                    placedCurrency: USD
                    placedAt: '2026-02-07T17:29:32+00:00'
                    userRef: bettor1234
                    account: pinnacle_main
                    sentData:
                      stake: 10
                      price: 1.95
                    receivedData:
                      betId: '3332684214'
                      status: accepted
                      price: 1.97
                    currencyInfo:
                      currency: USD
                      currencyValue: 1
                      updatedAt: '2026-02-07T17:29:32+00:00'
                  - betId: 67889
                    orderId: 12344
                    bookmaker: betfair-ex
                    betStatus: CONFIRMED
                    settlementStatus: WON
                    clientName: demo
                    testBet: false
                    requestUuid: fb5f2dd9-c855-4ba9-8ef9-4c2278ca2f1d
                    bookmakerBetId: '234567890'
                    placedPrice: 1.94
                    placedStake: 50
                    placedCurrency: GBP
                    placedAt: '2026-02-07T16:00:00+00:00'
                    settledAt: '2026-02-07T18:30:00+00:00'
                    userRef: bettor1234
                    account: betfair_user
                    currencyInfo:
                      currency: GBP
                      currencyValue: 0.73
                      updatedAt: '2026-02-07T17:29:32+00:00'
                count: 2
                hasMore: true
                nextCursor: 67889
        '400':
          description: Invalid filter parameters or missing required filter
        '401':
          description: Unauthorized — missing or invalid API key
        '503':
          description: Database unavailable
components:
  schemas:
    BetsResponse:
      type: object
      properties:
        status:
          type: string
          description: Always 'success'
        bets:
          type: array
          items:
            $ref: '#/components/schemas/BetResponse'
        count:
          type: integer
          description: Number of bets in this response
        hasMore:
          type: boolean
          description: Whether more bets are available
        nextCursor:
          type: integer
          nullable: true
          description: Pass as afterBetId to fetch the next page
    BetResponse:
      type: object
      properties:
        betId:
          type: integer
          description: Bet ID
        orderId:
          type: integer
          description: Parent order ID
        bookmaker:
          type: string
          description: Bookmaker slug
        betStatus:
          type: string
          enum:
            - PENDING
            - PLACED
            - CONFIRMED
            - REJECTED
            - CANCELLED
            - FAILED
            - VOID
          description: Bet status
        settlementStatus:
          type: string
          enum:
            - UNSETTLED
            - WON
            - LOST
            - VOID
            - HALF_WON
            - HALF_LOST
            - PUSH
            - CASHOUT
          description: Settlement status
        clientName:
          type: string
          description: Client name
        testBet:
          type: boolean
          description: Whether this is a test bet
        requestUuid:
          type: string
          description: UUID from parent order
        bookmakerBetId:
          type: string
          nullable: true
          description: Bet ID returned by the bookmaker
        betRequestId:
          type: string
          nullable: true
          description: Internal bet request tracking ID
        placedPrice:
          type: number
          nullable: true
          description: Actual odds the bet was placed at
        placedStake:
          type: number
          nullable: true
          description: Stake sent to bookmaker
        placedCurrency:
          type: string
          nullable: true
          description: Currency the bet was placed in
        placedAt:
          type: string
          nullable: true
          description: ISO 8601 placement timestamp
        declineReason:
          type: string
          nullable: true
          description: Reason if bet was declined
        userRef:
          type: string
          nullable: true
          description: User reference from parent order
        account:
          type: string
          nullable: true
          description: Account username used for this bet
        sentData:
          type: object
          nullable: true
          description: Full request payload sent to the bookmaker
        receivedData:
          type: object
          nullable: true
          description: Full response received from the bookmaker
        currencyInfo:
          type: object
          nullable: true
          description: >-
            Exchange rate snapshot for placedCurrency: { currency,
            currencyValue, updatedAt }. Null when no rate is available.
          properties:
            currency:
              type: string
            currencyValue:
              type: number
            updatedAt:
              type: string
        settledAt:
          type: string
          nullable: true
          description: ISO 8601 settlement timestamp
        settlementAmount:
          type: number
          nullable: true
          description: Settlement payout amount
        settlementReason:
          type: string
          nullable: true
          description: Reason for settlement
        oddsInfo:
          type: object
          nullable: true
          description: Odds snapshot at bet time
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Contact contact@55-tech.com to obtain a key.

````