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

# GET /v1/orders — 列出您的购买历史

> 使用键集分页翻阅您的 CSBoard 购买历史。可按时间区间和状态过滤；每个订单包含逐件商品的交付详情。

orders 端点返回您的购买历史，按时间倒序排列，使用键集分页。可按时间窗口和状态过滤，然后通过将 `meta.next_cursor` 作为 `cursor` 传回，遍历更早的页面。每个订单都附带逐件商品明细及其交付状态。

**需要身份验证。** 请将密钥作为 `Authorization: Bearer csb_pub_...` 发送。

## 查询参数

**limit** `integer` (default: 50)

每页结果数。最小 `1`，最大 `100`。

**start\_unix\_time** `integer`

仅返回在该 Unix 时间戳（秒）当时或之后创建的订单。

**end\_unix\_time** `integer`

仅返回在该 Unix 时间戳（秒）当时或之前创建的订单。

**status** `string`

按订单状态过滤。可选值：`completed`、`hold`、`delivering`、`pending`、`cancelled`、`failed` 之一。

**cursor** `string`

来自上次响应中 `meta.next_cursor` 的键集游标。传入以获取下一页。

## 响应字段

**data** `Order[]` *required*

本页订单数组。

**Order object**

**order\_id** `string` *required*

CSBoard 订单 id。

**steam\_id** `string | null`

商品交付到的 Steam ID（如已知）。

**status** `string` *required*

可选值：`completed`、`hold`、`delivering`、`pending`、`cancelled`、`failed` 之一。

**custom\_id** `string | null`

您在下单时设置的自定义 id（如有）。

**currency** `string` *required*

始终为 `"USD"`。

**charged\_total\_usd** `number` *required*

订单的扣款总额，单位美元。

**item\_count** `integer` *required*

订单中的商品数量。

**hold\_until** `datetime | null`

订单中冻结商品的解冻时间，否则为 `null`。

**delivery\_type** `string`

`instant`（机器人在几分钟内发送交易）或 `manual`（由真人发送交易，最长可能需要 12 小时；在此期间订单可能一直处于 `delivering` 且没有交易报价）。玩家（P2P）挂单始终为 `manual`。

**delivery\_deadline\_at** `datetime | null`

交付截止时间：`manual` 交付为购买后 12 小时，其他情况为供应商的接受窗口。仅在 `status` 为 `pending` 或 `delivering` 时有值；之后以及持有中的订单（它们等待 `hold_until`）为 `null`。如果卖家未能按时交付，订单会被自动取消并退款。如需提前停止等待，请使用 [`POST /v1/orders/{id}/cancel`](https://api.csboard.com/zh-Hans/api-reference/post-orders-cancel)。

**fail\_reason** `string | null`

订单失败的原因，是用于程序分支判断的代码——参见 [订单失败的原因](#fail-reasons)。在 `status` 为 `failed` 或 `cancelled` 时有值，否则为 `null`。该列表可能会扩充：遇到不认识的值时请按 `unavailable` 处理。

**fail\_side** `string | null`

需要采取行动的一方：`recipient`（接收皮肤的账户）、`seller`（卖家）、`buyer`（您）或 `market`（市场）。`status` 不是 `failed` 或 `cancelled` 时为 `null`。

**fail\_message** `string | null`

一句英文说明：发生了什么、该怎么做。可展示给用户；程序逻辑请依据 `fail_reason`，因为措辞可能会变。`status` 不是 `failed` 或 `cancelled` 时为 `null`。

**created\_at** `datetime` *required*

ISO 8601 创建时间戳。

**updated\_at** `datetime | null`

最后一次更新的 ISO 8601 时间戳，否则为 `null`。

**items** `OrderItem[]` *required*

逐件商品明细。

**OrderItem object**

**market\_hash\_name** `string | null`

**price\_usd** `number | null`

**status** `string` *required*

可选值：`hold`、`delivering`、`delivered`、`returned` 之一。

**tradable\_at** `datetime | null`

该商品脱离 Steam 交易冻结的时间，否则为 `null`。

**return\_reason** `string | null`

当 `status` 为 `returned` 时，说明商品被退回的原因。可选值：`trade_timeout`、`declined`、`expired`、`rolled_back`、`unavailable` 之一。

**steam\_trade\_offer\_id** `string | null`

**steam\_trade\_offer\_finished\_at** `datetime | null`

**meta** `object` *required*

**meta object**

**next\_cursor** `string | null` *required*

作为 `cursor` 传回以获取下一页。最后一页为 `null`。

**per\_page** `integer` *required*

本次响应所用的页面大小。

## 示例请求

```bash theme={null}
curl "https://csboard.com/v1/orders?status=completed&limit=50" \
  -H "Authorization: Bearer csb_pub_..."
```

## 示例响应

```json theme={null}
{
  "data": [
    {
      "order_id": "ord_01J9Z3K8Q2",
      "steam_id": "76561198000000000",
      "status": "completed",
      "custom_id": "batch-2026-06-29-01",
      "currency": "USD",
      "charged_total_usd": 26.47,
      "item_count": 2,
      "hold_until": null,
      "delivery_type": "instant",
      "delivery_deadline_at": null,
      "fail_reason": null,
      "fail_side": null,
      "fail_message": null,
      "created_at": "2026-06-29T17:12:04Z",
      "updated_at": "2026-06-29T17:15:40Z",
      "items": [
        {
          "market_hash_name": "AK-47 | Redline (Minimal Wear)",
          "price_usd": 14.37,
          "status": "delivered",
          "tradable_at": "2026-07-06T12:00:00Z",
          "return_reason": null,
          "steam_trade_offer_id": "5512345678",
          "steam_trade_offer_finished_at": "2026-06-29T17:15:40Z"
        }
      ]
    }
  ],
  "meta": { "next_cursor": "eyJpZCI6Im9yZF8wMUo5WjNLOFEyIn0=", "per_page": 50 }
}
```

## 订单失败的原因

状态为 `failed` 或 `cancelled` 的订单会用三个字段说明原因。其他任何状态下，这三个字段都为 `null`。

* `fail_reason` —— 用于程序分支判断的代码，取值见下表。
* `fail_side` —— 需要采取行动的一方：`recipient`、`seller`、`buyer` 或 `market`。
* `fail_message` —— 一句英文说明：发生了什么、该怎么做。可展示给用户；程序逻辑请依据 `fail_reason`。

| `fail_reason` | `fail_side` | 发生了什么、该怎么做 |
| - | - | - |
| `recipient_inventory_private` | `recipient` | 收货方的 Steam 库存未公开，因此无法发送交易。请将库存设为公开后重新购买。 |
| `recipient_inventory_full` | `recipient` | 收货方的 CS2 库存已满。请腾出空位后重新购买。 |
| `invalid_trade_url` | `recipient` | 交易链接无效，或其 token 已更改。请从 [steamcommunity.com/my/tradeoffers/privacy](https://steamcommunity.com/my/tradeoffers/privacy) 获取当前链接后重新购买。 |
| `recipient_cannot_trade` | `recipient` | 该账户目前无法交易：交易封禁、交易冷却或 Steam 令牌（Steam Guard）限制。在 Steam 解除限制之前，为该账户重新购买都会失败。 |
| `recipient_too_many_offers` | `recipient` | 收货方有过多待处理的交易报价。请先接受或拒绝它们，再重新购买。 |
| `offer_declined` | `recipient` | 收货方拒绝了交易报价。 |
| `offer_expired` | `recipient` | 交易报价未在规定时间内被接受。 |
| `seller_did_not_deliver` | `seller` | 卖家未按时发送物品。请购买其他挂单。 |
| `seller_cancelled` | `seller` | 卖家取消了出售（P2P）。请购买其他挂单。 |
| `rolled_back` | `seller` | 交付后，该交易在 Steam 中被撤回（P2P）。 |
| `cancelled_by_buyer` | `buyer` | 订单已按您的请求取消。 |
| `listing_gone` | `market` | 在购买完成之前，该挂单已在别处售出。请购买其他挂单。 |
| `market_unavailable` | `market` | 该挂单所在的市场暂时不可用。请稍后重试。 |
| `unavailable` | `market` | 物品无法交付，且没有更具体的原因。 |

该列表可能会扩充。遇到不认识的 `fail_reason` 时，请按 `unavailable` 处理。逐件商品的 `return_reason` 保持不变。

一个失败的订单（仅保留与此相关的字段）：

```json theme={null}
{
  "order_id": "cmvob1jy500r67b01gygkufd8",
  "status": "failed",
  "fail_reason": "recipient_inventory_private",
  "fail_side": "recipient",
  "fail_message": "The recipient's Steam inventory is private, so the trade could not be sent. Set Inventory to Public in the recipient's Steam privacy settings and buy again.",
  "refund": {
    "amount_usd": 0.24,
    "refunded_at": "2026-10-25T20:53:26.386Z",
    "partial": false
  }
}
```

## 错误代码

| HTTP 状态码 | 代码 | 含义 |
| - | - | - |
| 401 | `missing_api_key` / `invalid_api_key` | API 密钥缺失或无效。 |
| 422 | `invalid_request` | 查询参数无效（例如 `limit` 超出范围）。 |
| 429 | `rate_limit_exceeded` | 请求过多。请按照 `Retry-After` 响应头中的秒数退避。 |


## OpenAPI

````yaml GET /orders
openapi: 3.1.0
info:
  title: CSBoard API
  version: 1.0.0
  description: >-
    Market data over the CSBoard marketplace — live listings, floats, stickers,
    minAsk prices, FX rates — plus opt-in buying straight from your balance.
    Free to read, key-gated, built for automation.
  contact:
    name: CSBoard
    url: https://csboard.com/docs
servers:
  - url: https://csboard.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Status
    description: Liveness and freshness probes.
  - name: Market data
    description: Read the live catalog, prices, and FX rates.
  - name: Trading
    description: Buy listings from your CSBoard balance. Opt-in, key-gated.
  - name: Instant Sell
    description: >-
      Sell CS2, Dota 2 and Rust items from any Steam inventory to the CSBoard
      network and get paid to your balance. Invite-only.
  - name: P2P
    description: >-
      List your own CS2 skins on the CSBoard P2P market. Free — any valid key,
      no balance requirement.
  - name: Account
    description: Your balance, settled funds, and trading status.
  - name: Webhooks
    description: Register an endpoint and receive signed order updates instead of polling.
paths:
  /orders:
    get:
      tags:
        - Trading
      summary: List purchase history
      description: >-
        Your purchase history, newest first, with keyset pagination. Filter by
        time window and status. Pass `meta.next_cursor` back as `cursor` to walk
        older pages; `next_cursor` is null on the last page.
      operationId: listOrders
      parameters:
        - name: limit
          in: query
          description: Results per page. 1–100. Default 50.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: start_unix_time
          in: query
          description: Only orders created at or after this Unix timestamp (seconds).
          schema:
            type: integer
        - name: end_unix_time
          in: query
          description: Only orders created at or before this Unix timestamp (seconds).
          schema:
            type: integer
        - name: status
          in: query
          description: Filter by order status.
          schema:
            type: string
            enum:
              - completed
              - hold
              - delivering
              - pending
              - cancelled
              - failed
        - name: cursor
          in: query
          description: Keyset cursor from a previous response's `meta.next_cursor`.
          schema:
            type: string
      responses:
        '200':
          description: A page of orders.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Order'
                  meta:
                    type: object
                    properties:
                      next_cursor:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Pass back as `cursor` for the next page. Null on the
                          last page.
                      per_page:
                        type: integer
                    required:
                      - next_cursor
                      - per_page
                required:
                  - data
                  - meta
              example:
                data:
                  - order_id: ord_01J9Z3K8Q2
                    steam_id: '76561198000000000'
                    status: completed
                    custom_id: batch-2026-06-29-01
                    currency: USD
                    charged_total_usd: 26.47
                    item_count: 2
                    hold_until: null
                    delivery_type: instant
                    delivery_deadline_at: null
                    fail_reason: null
                    fail_side: null
                    fail_message: null
                    created_at: '2026-06-29T17:12:04Z'
                    updated_at: '2026-06-29T17:15:40Z'
                    items:
                      - market_hash_name: AK-47 | Redline (Minimal Wear)
                        price_usd: 14.37
                        status: delivered
                        tradable_at: '2026-07-06T12:00:00Z'
                        return_reason: null
                        steam_trade_offer_id: '5512345678'
                        steam_trade_offer_finished_at: '2026-06-29T17:15:40Z'
                meta:
                  next_cursor: eyJpZCI6Im9yZF8wMUo5WjNLOFEyIn0=
                  per_page: 50
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: invalid_request
                detail: limit must be between 1 and 100.
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Order:
      type: object
      properties:
        order_id:
          type: string
        steam_id:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - completed
            - hold
            - delivering
            - pending
            - cancelled
            - failed
        custom_id:
          type:
            - string
            - 'null'
          description: Your own id, if you set one at purchase time.
        currency:
          type: string
          example: USD
        charged_total_usd:
          type: number
        item_count:
          type: integer
        hold_until:
          type:
            - string
            - 'null'
          format: date-time
        delivery_type:
          type: string
          enum:
            - instant
            - manual
          description: >-
            How the order ships. `instant`: a bot sends the Steam trade within
            minutes. `manual`: a person (or a slow desk) sends it, which can
            take up to 12 hours, so the order may stay `delivering` that long
            with no trade offer yet. A player's (P2P) lot is always `manual`.
        delivery_deadline_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The delivery deadline: 12 hours after purchase for `manual`
            delivery, the vendor's accept window otherwise. Set only while
            `status` is `pending` or `delivering`; `null` once the order is
            completed, cancelled or failed, and on a held order (it waits on
            `hold_until`). If the seller misses it, the order is cancelled and
            refunded automatically.
        fail_reason:
          type:
            - string
            - 'null'
          description: >-
            Why the order failed. Set when `status` is `failed` or `cancelled`,
            `null` otherwise. The recipient has to act on
            `recipient_inventory_private`, `recipient_inventory_full`,
            `invalid_trade_url`, `recipient_cannot_trade`,
            `recipient_too_many_offers`, `offer_declined` and `offer_expired`;
            the seller on `seller_did_not_deliver`, `seller_cancelled` and
            `rolled_back`; you on `cancelled_by_buyer`; the market on
            `listing_gone`, `market_unavailable` and `unavailable`. The list may
            grow: treat a value you do not know as `unavailable`.
          example: recipient_inventory_private
        fail_side:
          type:
            - string
            - 'null'
          enum:
            - recipient
            - seller
            - buyer
            - market
            - null
          description: >-
            Who has to act on the failure: `recipient` (the account the skins go
            to — fix it and buy again), `seller` or `market` (buy another
            listing), `buyer` (you cancelled). `null` unless `status` is
            `failed` or `cancelled`.
        fail_message:
          type:
            - string
            - 'null'
          description: >-
            One English sentence: what happened and what to do. Safe to show to
            a person; branch on `fail_reason`, since the wording can change.
            `null` unless `status` is `failed` or `cancelled`.
          example: >-
            The recipient's Steam inventory is private, so the trade could not
            be sent. Set Inventory to Public in the recipient's Steam privacy
            settings and buy again.
        refund:
          description: >-
            Refund credited for this order, or `null` if none. A `cancelled` or
            `failed` order is ALWAYS refunded — this field is the receipt, so
            you never have to infer it from the status or reconcile against your
            balance.
          oneOf:
            - $ref: '#/components/schemas/Refund'
            - type: 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrderItem'
      required:
        - order_id
        - status
        - currency
        - charged_total_usd
        - item_count
        - created_at
        - items
    Error:
      type: object
      description: >-
        All errors return { code, detail }. Some carry extra fields (e.g.
        price_moved adds current_total_usd, insufficient_balance adds
        required_usd/current_usd, item_unavailable adds unavailable_ids and, on
        CS2 buys, unknown_ids).
      properties:
        code:
          type: string
          description: >-
            Machine-readable error code, e.g. rate_limit_exceeded,
            trading_not_enabled, price_moved.
        detail:
          type: string
          description: Human-readable explanation.
      required:
        - code
    Refund:
      type: object
      description: >-
        Money credited back to your balance for this order. `null` when nothing
        was refunded.
      properties:
        amount_usd:
          type: number
          description: Total credited back, in USD.
          example: 1.28
        refunded_at:
          type: string
          format: date-time
          description: When the last refund credit landed.
        partial:
          type: boolean
          description: >-
            true when only part of the order was refunded (one leg of a
            multi-item order failed and the rest was delivered).
          example: false
      required:
        - amount_usd
        - refunded_at
        - partial
    OrderItem:
      type: object
      properties:
        market_hash_name:
          type:
            - string
            - 'null'
        price_usd:
          type:
            - number
            - 'null'
        status:
          type: string
          enum:
            - hold
            - delivering
            - delivered
            - returned
        tradable_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the item leaves Steam trade hold, or null.
        return_reason:
          type:
            - string
            - 'null'
          enum:
            - trade_timeout
            - declined
            - expired
            - rolled_back
            - unavailable
            - null
          description: Why the item was returned, if its status is `returned`.
        steam_trade_offer_id:
          type:
            - string
            - 'null'
        steam_trade_offer_finished_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - status
    RateLimitError:
      type: object
      description: >-
        The `429` body of a per-key bucket. Endpoint-specific limits send only
        `code` and `detail`.
      properties:
        code:
          type: string
          description: >-
            `rate_limit_exceeded` for the key's buckets. Endpoint-specific
            limits use their own code (`snapshot_rate_limited`, `rate_limited`).
        detail:
          type: string
          description: Human-readable explanation.
        bucket:
          type: string
          enum:
            - read
            - trading
            - buy_orders
          description: Which bucket is spent.
        limit_per_min:
          type: integer
          description: That bucket's ceiling per minute.
        retry_after_sec:
          type: integer
          minimum: 1
          maximum: 60
          description: >-
            Seconds until the window restarts — the same number as
            `Retry-After`.
      required:
        - code
  responses:
    Unauthorized:
      description: Missing or invalid API key (`missing_api_key` or `invalid_api_key`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: missing_api_key
            detail: >-
              Provide your API key via `Authorization: Bearer csb_pub_…`.
              Generate one at https://csboard.com/profile?tab=api
    RateLimited:
      description: >-
        A per-key limit is spent. The key's own buckets answer
        `rate_limit_exceeded` with `bucket` (`read`, `trading` or `buy_orders`),
        `limit_per_min` and `retry_after_sec`. `Retry-After` is the seconds left
        until the one-minute window restarts (1–60), not a flat 60.
        Endpoint-specific limits (`snapshot_rate_limited` on the price snapshot,
        `rate_limited` on Instant Sell) send only `code` and `detail`.
      headers:
        Retry-After:
          description: >-
            Seconds until the one-minute window restarts (1–60). Waiting that
            long is always enough.
          schema:
            type: integer
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-RateLimit-Bucket:
          $ref: '#/components/headers/X-RateLimit-Bucket'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
          example:
            code: rate_limit_exceeded
            detail: >-
              Read rate limit of 100 requests/min exceeded. The counter restarts
              in 23 s. For new listings use GET /v1/listings/stream instead of
              polling.
            bucket: read
            limit_per_min: 100
            retry_after_sec: 23
  headers:
    X-RateLimit-Limit:
      description: >-
        The ceiling per minute of the bucket this call spent (named in
        `X-RateLimit-Bucket`).
      schema:
        type: integer
      example: 3000
    X-RateLimit-Remaining:
      description: Calls left on that bucket in the current one-minute window.
      schema:
        type: integer
        minimum: 0
      example: 2987
    X-RateLimit-Reset:
      description: >-
        Seconds until the one-minute window restarts and the counter starts
        again.
      schema:
        type: integer
        minimum: 1
        maximum: 60
      example: 41
    X-RateLimit-Bucket:
      description: >-
        The bucket this call spent: `read` (reads and every other keyed call) or
        `trading` (buys, order reads, claims, cancels, balance). A `429` from
        the buy-order limit says `buy_orders`.
      schema:
        type: string
        enum:
          - read
          - trading
          - buy_orders
      example: trading
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send your key as a Bearer token on every request: `Authorization: Bearer
        csb_pub_...`. Generate keys in your CSBoard profile. Calls made with a
        key are metered only by that key's own limits — there is no per-IP limit
        on top — and every answer carries `X-RateLimit-Limit`,
        `X-RateLimit-Remaining`, `X-RateLimit-Reset` and `X-RateLimit-Bucket`
        for the bucket the call spent. See [Rate limits](/rate-limits).

````

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