---
updatedAt: 2026-09-09T02:50:00.000Z
agentTools:
  projectIndex: https://apidocs.bct.host/llms.txt
---

# Get Order History

Get all historical orders in chronological order (authentication required).

The rejection reason can take the following values:

| **Field valuses**                       | **Description**                           |
| --------------------------------------- | ----------------------------------------- |
| NORMAL\_CANCEL                          | User Requested Cancellation               |
| TIME\_EXPIRED                           | GTD Order Expired                         |
| REPLACE\_CANCEL                         | Canceled for Replacement                  |
| CANCEL\_BECAUSE\_FOK\_NOT\_FULL         | FOK Requirement Not Met                   |
| CANCEL\_BECAUSE\_IOC\_NOT\_FULL         | IOC Partial Fill Residual Canceled        |
| CANCEL\_BECAUSE\_POST\_ONLY\_WILL\_FILL | Post-Only Reject (Liquidity Taking)       |
| CANCEL\_BECAUSE\_SELF\_TRADE            | Self-Trade Prevention (STP) Triggered     |
| TRADE\_PRICE\_LIMIT                     | Price Collar / Limit Protection Triggered |

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HK Spot OpenAPI",
    "description": "Hong Kong Station Spot OpenAPI documentation v5. Uses Header + HMAC-SHA512 signature authentication mechanism.",
    "version": "5.0.0"
  },
  "servers": [
    {
      "url": "https://trade-hk.osl.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Spot - Order Module",
      "description": "Order management endpoints"
    }
  ],
  "paths": {
    "/api/v5/order/history": {
      "get": {
        "tags": [
          "Spot - Order Module"
        ],
        "summary": "Get Order History",
        "description": "Get all historical orders in chronological order (authentication required).",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "description": "Trading pair, optional; defaults to returning trade information for all trading pairs",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "query",
            "description": "Order ID, when provided, queries solely by symbol and orderId.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isPre",
            "in": "query",
            "description": "Forward/backward pagination query; default false represents backward pagination",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "lastIndex",
            "in": "query",
            "description": "Starting index for query; forward pagination requires min id on current page, backward pagination requires max id on current page",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "Number of records to query; default 100, max 500, min 1",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "startTime",
            "in": "query",
            "description": "Start time; start time must be earlier than end time",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "endTime",
            "in": "query",
            "description": "End time; end time must be later than start time, time interval cannot exceed 7 days",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Query successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SpotQueryOrder"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "api-key",
        "description": "API Key, obtained via the OpenAPI management page"
      }
    },
    "schemas": {
      "SpotQueryOrder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Primary key ID, can be passed in subsequent requests for pagination",
            "example": "2184213131143033600"
          },
          "orderId": {
            "type": "string",
            "description": "Order ID",
            "example": "2184213131143033600"
          },
          "clientOrderId": {
            "type": "string",
            "description": "Custom client order ID",
            "example": "574366a1-7ac1-4edc-a2c8-135d4b710847"
          },
          "accountUuid": {
            "type": "string",
            "description": "Account UUID",
            "example": "017ef1b6-22ae-44ba-b3e0-4116068c5e29"
          },
          "symbol": {
            "type": "string",
            "description": "Trading pair",
            "example": "BTCUSD"
          },
          "baseAsset": {
            "type": "string",
            "description": "Base asset",
            "example": "BTC"
          },
          "quoteAsset": {
            "type": "string",
            "description": "Quote asset",
            "example": "USD"
          },
          "orderType": {
            "type": "string",
            "description": "Order type (LIMIT/MARKET)",
            "example": "LIMIT",
            "enum": [
              "LIMIT",
              "MARKET"
            ]
          },
          "side": {
            "type": "string",
            "description": "Order side",
            "example": "BUY"
          },
          "price": {
            "type": "string",
            "description": "Order price",
            "example": "60000.00000000"
          },
          "quantity": {
            "type": "string",
            "description": "Order quantity",
            "example": "1000"
          },
          "amount": {
            "type": "string",
            "description": "Order value",
            "example": "10000"
          },
          "executedQty": {
            "type": "string",
            "description": "Executed quantity",
            "example": "0.00100000"
          },
          "executedAmount": {
            "type": "string",
            "description": "Executed amount/value",
            "example": "1000"
          },
          "timeInForce": {
            "type": "string",
            "description": "Time in force strategy",
            "example": "GTC",
            "enum": [
              "GTC",
              "IOC",
              "FOK",
              "POST_ONLY",
              "GTD"
            ]
          },
          "status": {
            "type": "string",
            "description": "Order status",
            "example": "NEW"
          },
          "cumTransactFee": {
            "type": "string",
            "description": "Cumulative transaction fee",
            "example": "0.00001000"
          },
          "feeAsset": {
            "type": "string",
            "description": "Fee asset currency",
            "example": "USD"
          },
          "lastPriceAtPlace": {
            "type": "string",
            "description": "Latest trade price at order placement",
            "example": "6.375"
          },
          "makerFeeRate": {
            "type": "string",
            "description": "Maker fee rate",
            "example": "0.002"
          },
          "takerFeeRate": {
            "type": "string",
            "description": "Taker fee rate",
            "example": "0.002"
          },
          "rejectReason": {
            "type": "string",
            "description": "Order rejection reason",
            "example": "Timeout matching",
            "nullable": true
          },
          "cancelQty": {
            "type": "string",
            "description": "Cancelled quantity (self-trade prevention)",
            "example": "10"
          },
          "cancelAmount": {
            "type": "string",
            "description": "Cancelled amount (self-trade prevention)",
            "example": "10"
          },
          "orderTime": {
            "type": "string",
            "description": "Place order timestamp",
            "example": "1786947822889"
          },
          "updateTime": {
            "type": "string",
            "description": "Update timestamp",
            "example": "1786947822889"
          },
          "expireTime": {
            "type": "string",
            "description": "Expiration time",
            "example": "1786953500000",
            "nullable": true
          }
        }
      }
    }
  },
  "x-readme": {}
}
```