> ## 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.

# POST /v1/orders/:id/claim — забрать заказ из холда

> Запускает доставку заказа, находящегося в холде (эскроу), после снятия блокировки. Часть заказов доставляется автоматически, часть требует явного claim.

Часть заказов попадает в состояние **холда**: предмет находится под эскроу-блокировкой маркетплейса и не может быть доставлен, пока блокировка не снята. Заказ в холде виден как `status: "hold"` с меткой `hold_until` в `GET /v1/orders` и `GET /v1/orders/{id}`.

После того как `hold_until` прошёл:

* **Часть заказов доставляется автоматически** — делать ничего не нужно, вызов этого эндпоинта вернёт `claimed: false` (безвредный no-op).
* **Часть заказов нужно забрать вручную (claim)** — вызываете этот эндпоинт, чтобы запустить трейд. Без claim они остаются в холде бесконечно.

Снаружи отличить одно от другого нельзя, поэтому безопасный паттерн: **после `hold_until` вызвать claim один раз.** Если заказ был авто-типа — получите no-op; если требовал claim — он запустится.

<Note>
  Не хотите поллить и клеймить каждый заказ? Включите на уровне аккаунта флаг [`autoclaim`](/ru/api-reference/post-orders) в `true` — и каждый заказ из холда будет забираться автоматически в момент снятия блокировки, без вызовов claim.
</Note>

## Рекомендуемый флоу

1. Создайте покупку через `POST /v1/orders` или `POST /v1/market/buy`.
2. Поллите `GET /v1/orders/{id}`. Пока заказ `status: "hold"` — смотрите `hold_until`.
3. Как только `hold_until` в прошлом — `POST /v1/orders/{id}/claim`.
4. При `claimed: true` маркетплейс отправляет Steam-трейд на ваш trade URL. **Ваш бот обязан принять его за \~15 минут**, иначе трейд отменяется и баланс возвращается.

## Ответы кратко

| Статус                 | Значение                                                                              |
| ---------------------- | ------------------------------------------------------------------------------------- |
| `200` `claimed: true`  | Трейд запущен, возвращён `steam_trade_offer_id`. Принять за \~15 мин.                 |
| `200` `claimed: false` | Заказ доставляется автоматически, делать ничего не нужно.                             |
| `409 not_claimable`    | Заказ не в состоянии холда (уже доставляется/завершён/провален).                      |
| `425 hold_not_cleared` | Ещё внутри окна холда — повторить после возвращённого `hold_until`.                   |
| `502 delivery_failed`  | Маркетплейс отклонил запуск. Если холд отменён на стороне маркета — `refunded: true`. |
| `404 order_not_found`  | Такого заказа на этом аккаунте нет.                                                   |

<Warning>
  Claim идемпотентен, пока запуск в процессе — повторный вызов вернёт конфликт, а не двойную доставку. Ретрай после сетевого таймаута безопасен.
</Warning>


## OpenAPI

````yaml POST /orders/{id}/claim
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: Account
    description: Your balance, settled funds, and trading status.
paths:
  /orders/{id}/claim:
    post:
      tags:
        - Trading
      summary: Claim a held order
      description: >-
        Release delivery of a held (escrow) order once its hold has cleared.
        Held orders appear with `status: "hold"` and a `hold_until` timestamp;
        after `hold_until` passes some orders deliver automatically while others
        require this explicit claim. On a successful claim the marketplace sends
        a Steam trade offer to your trade URL that your bot must accept within
        ~15 minutes or it is cancelled and refunded. Idempotent: a duplicate
        call while one is in flight returns a conflict, never a double-send.
        Prefer the account-wide `autoclaim` setting if you would rather never
        call this per order.
      operationId: claimOrder
      parameters:
        - name: id
          in: path
          required: true
          description: CSBoard order id of the held order to claim.
          schema:
            type: string
      responses:
        '200':
          description: >-
            Claim accepted. `claimed: true` means the trade was released now;
            `claimed: false` means this order delivers automatically and no
            action was needed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  order_id:
                    type: string
                  status:
                    type: string
                    enum:
                      - delivering
                      - hold
                  claimed:
                    type: boolean
                  steam_trade_offer_id:
                    type:
                      - string
                      - 'null'
                    description: Present when claimed just released a trade offer.
                  detail:
                    type: string
                    description: Present on the auto-delivering no-op case.
                required:
                  - order_id
                  - status
                  - claimed
              examples:
                released:
                  summary: Manual hold released
                  value:
                    order_id: ord_01J9Z3K8Q2
                    status: delivering
                    claimed: true
                    steam_trade_offer_id: '5512345678'
                auto:
                  summary: Auto-delivering hold (no-op)
                  value:
                    order_id: ord_01J9Z3K8Q2
                    status: hold
                    claimed: false
                    detail: >-
                      This order delivers automatically once its hold clears; no
                      claim needed.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: No order with that id on this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: order_not_found
                detail: No such order on this account.
        '409':
          description: >-
            The order is not in a claimable (held) state, or cannot be claimed
            right now.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: not_claimable
                detail: Order status is 'completed'; only held orders can be claimed.
        '425':
          description: The item is still under its hold window. Retry after `hold_until`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  hold_until:
                    type:
                      - string
                      - 'null'
                    format: date-time
                  detail:
                    type: string
              example:
                code: hold_not_cleared
                hold_until: '2026-07-02T20:00:00Z'
                detail: Item is still under its hold window; retry after hold_until.
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          description: >-
            Withdraw was attempted but the marketplace rejected it. If the hold
            was cancelled upstream your balance was refunded (`refunded: true`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  detail:
                    type: string
                  refunded:
                    type: boolean
              example:
                code: delivery_failed
                detail: The hold was cancelled upstream; your balance was refunded.
                refunded: true
components:
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: unauthorized
            message: Missing or invalid API key.
    RateLimited:
      description: Rate limit exceeded. Includes a Retry-After header.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: rate_limit_exceeded
            message: Too many requests.
  schemas:
    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).
      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
  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.

````