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

# Order History

> Read paginated terminal order states.

Read paginated terminal order states. This is an unsigned `POST /account` query with
`type: "orderHistory"`, not a separate endpoint.

## Query target

Use a master, sub-account, or physical isolated-account public key.

Use [Open Orders](https://docs.bulk.trade/api-reference/account/open-orders.md) for live orders, including parked conditionals. Terminal history is not a stream of every intermediate order update.

## Pagination

Rows are newest-first. Start with optional inclusive `startSlot` and `endSlot`
bounds and `limit` (1–5000; default 5000). Continue with `page.nextCursor`,
keeping `user` and `type` unchanged; you may change `limit` but must omit slot
bounds. Stop when `hasMore` is false. Newer events need a new first-page request.

HTTP `206` can carry partial or unknown coverage. Neither an empty page nor
`hasMore: false` proves complete history. On `409`, preserve the coverage gap;
on `410`, restart and deduplicate; on `503`, back off and retry. See the shared
[history rules](https://docs.bulk.trade/api-reference/getAccount.md#history-queries) for errors and coverage.


## OpenAPI

````yaml api-reference/account/openapi-order-history.yaml POST /account
openapi: 3.0.3
info:
  title: Bulk Trade API - Order History
  version: 1.0.0
servers:
  - url: https://mainnet-api1.bulk.trade/api/v1
    description: Mainnet
  - url: https://exchange-api.bulk.trade/api/v1
    description: Testnet
security: []
paths:
  /account:
    post:
      summary: Order History
      description: >-
        Read paginated terminal order states. No signature required. Use a
        master, sub-account, or physical isolated-account public key. First-page
        slot bounds are inclusive. A continuation keeps type and user, uses the
        returned cursor, and cannot include slot bounds.
      operationId: queryAccountOrderHistory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - type
                - user
              not:
                anyOf:
                  - required:
                      - cursor
                      - startSlot
                  - required:
                      - cursor
                      - endSlot
              properties:
                type:
                  type: string
                  enum:
                    - orderHistory
                  default: orderHistory
                user:
                  type: string
                  description: >-
                    Paste the account public key (base58). No account is
                    selected for you.
                limit:
                  type: integer
                  minimum: 1
                  maximum: 5000
                  default: 5000
                  description: Optional page size for history queries
                  example: 2
                startSlot:
                  type: integer
                  format: int64
                  minimum: 0
                  description: >-
                    Optional inclusive lower slot bound for the first history
                    page
                endSlot:
                  type: integer
                  format: int64
                  minimum: 0
                  description: >-
                    Optional inclusive upper slot bound for the first history
                    page
                cursor:
                  type: string
                  description: >-
                    Opaque history continuation; cannot be combined with slot
                    bounds
            example:
              type: orderHistory
              user: ''
              limit: 2
      responses:
        '200':
          description: >-
            Typed history page; inspect page coverage independently of
            pagination; illustrative example, not live data for the supplied
            account
          content:
            application/json:
              example:
                data: []
                page:
                  nextCursor: null
                  hasMore: false
                  asOfSlot: 13000
                  startSlot: 12000
                  endSlot: 13000
                  coverage: complete
              schema:
                type: object
                required:
                  - data
                  - page
                properties:
                  data:
                    type: array
                    items:
                      allOf:
                        - type: object
                          description: Terminal order history record
                          required:
                            - orderId
                            - symbol
                            - side
                            - orderType
                            - tif
                            - price
                            - vwap
                            - originalSize
                            - executedSize
                            - reduceOnly
                            - status
                            - slot
                            - timestamp
                            - sequence
                            - iso
                          properties:
                            orderId:
                              type: string
                              description: Order ID (base58)
                            symbol:
                              type: string
                              description: Market symbol
                            side:
                              type: string
                              enum:
                                - buy
                                - sell
                              description: Order side
                            orderType:
                              type: string
                              enum:
                                - limit
                                - market
                                - stop
                                - stopLimit
                                - takeProfit
                                - range
                                - trigger
                                - trailing
                              description: Order type
                            tif:
                              type: string
                              enum:
                                - gtc
                                - ioc
                                - postOnly
                                - postOnlySlide
                                - postOnlyJoin
                              description: Time in force
                            price:
                              type: number
                              description: Order price
                            vwap:
                              type: number
                              description: >-
                                Volume-weighted average fill price (0 if no
                                fills)
                            originalSize:
                              type: number
                              description: Original order size
                            executedSize:
                              type: number
                              description: Amount filled
                            reduceOnly:
                              type: boolean
                              description: Whether order was reduce-only
                            status:
                              type: string
                              enum:
                                - filled
                                - partiallyFilled
                                - cancelled
                                - cancelledRiskLimit
                                - cancelledSelfCrossing
                                - cancelledReduceOnly
                                - cancelledIoc
                                - rejectedInvalid
                                - rejectedRiskLimit
                                - rejectedCrossing
                                - rejectedDuplicate
                              description: Terminal order status
                            trigger:
                              allOf:
                                - type: object
                                  required:
                                    - px
                                  properties:
                                    isAbove:
                                      type: boolean
                                      description: >-
                                        Optional trigger direction when encoded;
                                        omitted when unavailable
                                    px:
                                      type: number
                                      description: Trigger threshold price
                                    lim:
                                      type: number
                                      description: >-
                                        Optional post-trigger limit price;
                                        omitted for market execution
                                    oco:
                                      type: string
                                      description: Optional linked OCO sibling order ID
                                    pxHi:
                                      type: number
                                      description: >-
                                        Optional upper trigger threshold for
                                        range/OCO
                                    limHi:
                                      type: number
                                      description: >-
                                        Optional upper post-trigger limit for
                                        range/OCO
                                    trb:
                                      type: integer
                                      format: uint32
                                      description: >-
                                        Trailing distance in bps (trailing
                                        orders only)
                                    stb:
                                      type: integer
                                      format: uint32
                                      description: >-
                                        Favorable reset step in bps (trailing
                                        orders only)
                              nullable: true
                              description: >-
                                Trigger metadata for conditional/trigger orders,
                                otherwise `null`
                            reason:
                              type: string
                              nullable: true
                              description: Rejection/cancellation reason (optional)
                            slot:
                              type: integer
                              format: int64
                              description: Slot number when order became terminal
                            timestamp:
                              type: integer
                              format: int64
                              description: Timestamp (nanoseconds)
                            sequence:
                              type: integer
                              format: int64
                              description: Event sequence inside slot
                            iso:
                              type: boolean
                              description: >-
                                `true` if this row belongs to a per-instrument
                                isolated account, otherwise `false`
                            isoPubkey:
                              type: string
                              nullable: true
                              description: >-
                                Present only when `iso=true`; isolated-lane
                                account pubkey (base58)
                        - type: object
                          required:
                            - orderId
                            - symbol
                            - side
                            - orderType
                            - tif
                            - price
                            - vwap
                            - originalSize
                            - executedSize
                            - reduceOnly
                            - status
                            - iso
                            - slot
                            - timestamp
                            - sequence
                  page:
                    type: object
                    required:
                      - nextCursor
                      - hasMore
                      - asOfSlot
                      - startSlot
                      - endSlot
                      - coverage
                    properties:
                      nextCursor:
                        type: string
                        nullable: true
                        description: >-
                          Opaque exclusive continuation; null exactly when
                          hasMore is false
                      hasMore:
                        type: boolean
                      asOfSlot:
                        type: integer
                        format: int64
                        minimum: 0
                      startSlot:
                        type: integer
                        format: int64
                        minimum: 0
                      endSlot:
                        type: integer
                        format: int64
                        minimum: 0
                      coverage:
                        type: string
                        enum:
                          - complete
                          - partial
                          - unknown
                        description: >-
                          Coverage of the effective inclusive range. Backfill
                          proof is fixed at its inclusive cutoff and is not
                          advanced by newer live rows.
                      minAvailableSlot:
                        type: integer
                        format: int64
                        minimum: 0
                        description: >-
                          Earliest authoritative slot for this direct or
                          aggregate history scope; primary and parent-alias
                          retention floors are independent. Omitted when
                          unknown.
        '206':
          description: >-
            Incomplete history page when partial reads are enabled; inspect page
            coverage
          headers:
            X-Bulk-History-Status:
              description: Coverage status
              schema:
                type: string
                enum:
                  - partial
                  - unknown
            X-Bulk-History-Min-Available-Slot:
              description: Earliest authoritative available slot; omitted when unknown
              schema:
                type: integer
                format: int64
                minimum: 0
          content:
            application/json:
              schema:
                $ref: d0e74251-295a-4373-aadc-8200eb95db6f
        '400':
          description: >-
            Invalid current-state request or malformed history query, limit,
            slot range, or cursor
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: object
                    required:
                      - code
                      - message
                    properties:
                      code:
                        type: string
                        enum:
                          - INVALID_HISTORY_QUERY
                          - INVALID_HISTORY_LIMIT
                          - INVALID_SLOT_RANGE
                          - CURSOR_INVALID
                          - ACCOUNT_NOT_FOUND
                          - HISTORY_NOT_COVERED
                          - CURSOR_EXPIRED
                          - HISTORY_STATE_NOT_READY
                          - HISTORY_BUSY
                          - HISTORY_STORAGE_ERROR
                      message:
                        type: string
        '404':
          description: >-
            The current-state account or history scope was not found. History
            requests return the structured error envelope when a JSON body is
            present.
          content:
            application/json:
              schema:
                $ref: 382277fe-60e2-4c03-abb2-4590c067fa9f
        '408':
          description: >-
            Response timeout (60 seconds for orders, 5 seconds for current-state
            snapshot requests). An order may still execute; reconcile before
            submitting a replacement.
        '409':
          description: Strict coverage cannot satisfy the requested history range
          content:
            application/json:
              schema:
                $ref: 382277fe-60e2-4c03-abb2-4590c067fa9f
        '410':
          description: >-
            History scope, coverage, backfill, or retention changed after cursor
            issuance
          content:
            application/json:
              schema:
                $ref: 382277fe-60e2-4c03-abb2-4590c067fa9f
        '429':
          description: >-
            Request or action rate limit reached. Back off before retrying; the
            body may be plain text or empty.
        '500':
          description: >-
            Current-state request failure or history storage/decoding failure.
            History requests return the structured error envelope when a JSON
            body is present.
          content:
            application/json:
              schema:
                $ref: 382277fe-60e2-4c03-abb2-4590c067fa9f
        '503':
          description: >-
            History state is not ready, bounded read capacity is saturated, or
            the API is locked
          content:
            application/json:
              schema:
                oneOf:
                  - e2b049eb-3a6c-4567-b10c-cfe9eb6e5adf
                  - type: object
                    required:
                      - code
                      - error
                    properties:
                      code:
                        type: string
                        enum:
                          - API_LOCKED
                      error:
                        type: string
      security: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.