> ## 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/p2p/inventory — 可上架的 CS2 库存

> 列出您的 CS2 物品，每个副本一行，并说明每件物品现在能否在 CSBoard P2P 市场上架，以及不能上架的原因。

这是通过 API 上架的第一步。它返回我们在您的 Steam 库存中见到的每一件 CS2 物品，每个副本一行——`asset_id` 用来区分同一款皮肤的两个副本。`listable` 表示该副本现在能否发布；不能发布时，`reasons` 会说明原因。`listed` 标记已经有挂单的副本。

请把本响应中的 `operational_asset_id` 和 `asset_revision` 原样传给 [`POST /v1/p2p/listings`](/zh-Hans/api-reference/post-p2p-listings)。

**需要身份验证。** 请将密钥作为 `Authorization: Bearer csb_pub_...` 发送。免费——任何有效密钥均可，无余额要求。

## 库存读取

发布挂单需要一份最新的 Steam 库存读取结果。`inventory_proof` 会告诉您当前状态：

| `inventory_proof.status` | 含义 | 该怎么做 |
| - | - | - |
| `ready` | 我们持有最新的读取结果。 | 上架 `listable: true` 的行。 |
| `pending` | 本次调用发起了一次新的读取。 | 在 `retry_after_ms` 之后再次调用。 |
| `blocked` | 我们无法读取您的库存。 | 修复 `code` 指出的问题——例如库存未公开或缺少交易链接——然后再次调用。 |

## 示例请求

```bash theme={null}
curl https://csboard.com/v1/p2p/inventory \
  -H "Authorization: Bearer csb_pub_..."
```

## 示例响应

```json theme={null}
{
  "data": [
    {
      "operational_asset_id": "5b0c1f7e-3d2a-4c8e-9a61-2f4d8b7e1c30",
      "asset_revision": "sha256:fd0e6de607b774aaaf4d9cdb7e014c003ba614b03f0460b01e8c94bce034bac5",
      "asset_id": "38451927734",
      "market_hash_name": "AK-47 | Redline (Field-Tested)",
      "context_id": "2",
      "listable": true,
      "reasons": [],
      "listed": false,
      "listing_id": null,
      "listing_status": null,
      "snapshot_completed_at": "2026-10-02T11:58:03.000Z"
    },
    {
      "operational_asset_id": "c81e2d44-9b07-4f1a-b3d5-6e2a90f4c7b8",
      "asset_revision": "sha256:a5b10a9006f6ebb68f8b9e81c85b5a6d1bf0f32737fc3f57a597dd01e66e0523",
      "asset_id": "38451927990",
      "market_hash_name": "Glock-18 | Water Elemental (Minimal Wear)",
      "context_id": "16",
      "listable": false,
      "reasons": [
        { "code": "hold_not_ended", "message": "The Steam trade hold has not ended yet." }
      ],
      "listed": false,
      "listing_id": null,
      "listing_status": null,
      "snapshot_completed_at": "2026-10-02T11:58:03.000Z"
    }
  ],
  "inventory_proof": {
    "status": "ready",
    "completed_at": "2026-10-02T11:58:03.000Z",
    "asset_count": 2
  }
}
```

## 错误代码

| HTTP 状态码 | 代码 | 含义 |
| - | - | - |
| 401 | `missing_api_key` / `invalid_api_key` | API 密钥缺失或无效。 |
| 403 | `account_banned` | 该账户已被封禁。 |
| 403 | `ip_not_allowed` | 请求来自该密钥 IP 白名单之外的地址。 |
| 429 | `rate_limit_exceeded` | 超过该密钥的每分钟限额。请等待 `Retry-After` 响应头中的秒数。 |
| 503 | `p2p_disabled` | P2P 市场目前已关闭。 |


## OpenAPI

````yaml GET /p2p/inventory
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: 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:
  /p2p/inventory:
    get:
      tags:
        - P2P
      summary: Your inventory, ready to list
      description: >-
        Every CS2 item we have seen in your Steam inventory, one row per copy,
        with whether it can be listed right now and why not. Free — any valid
        key, no balance requirement. If we hold no current read of your
        inventory this call starts one and answers `inventory_proof.status =
        pending`; call again after `retry_after_ms`.
      operationId: getP2PInventory
      responses:
        '200':
          description: Your items and the state of the inventory read.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/P2PInventoryItem'
                  inventory_proof:
                    $ref: '#/components/schemas/P2PInventoryProof'
                required:
                  - data
                  - inventory_proof
              example:
                data:
                  - operational_asset_id: 5b0c1f7e-3d2a-4c8e-9a61-2f4d8b7e1c30
                    asset_revision: >-
                      sha256:fd0e6de607b774aaaf4d9cdb7e014c003ba614b03f0460b01e8c94bce034bac5
                    asset_id: '38451927734'
                    market_hash_name: AK-47 | Redline (Field-Tested)
                    context_id: '2'
                    listable: true
                    reasons: []
                    listed: false
                    listing_id: null
                    listing_status: null
                    snapshot_completed_at: '2026-10-02T11:58:03.000Z'
                  - operational_asset_id: c81e2d44-9b07-4f1a-b3d5-6e2a90f4c7b8
                    asset_revision: >-
                      sha256:a5b10a9006f6ebb68f8b9e81c85b5a6d1bf0f32737fc3f57a597dd01e66e0523
                    asset_id: '38451927990'
                    market_hash_name: Glock-18 | Water Elemental (Minimal Wear)
                    context_id: '16'
                    listable: false
                    reasons:
                      - code: hold_not_ended
                        message: The Steam trade hold has not ended yet.
                    listed: false
                    listing_id: null
                    listing_status: null
                    snapshot_completed_at: '2026-10-02T11:58:03.000Z'
                inventory_proof:
                  status: ready
                  completed_at: '2026-10-02T11:58:03.000Z'
                  asset_count: 2
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Forbidden — the key's IP allowlist or an account ban.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                account_banned:
                  summary: Account banned
                  value:
                    code: account_banned
                    detail: This account is banned.
                ip_not_allowed:
                  summary: Request from outside the key's IP allowlist
                  value:
                    code: ip_not_allowed
                    detail: >-
                      This API key is restricted to an IP allowlist and
                      203.0.113.7 is not on it. Update it at
                      https://csboard.com/profile?tab=api
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/P2PDisabled'
components:
  schemas:
    P2PInventoryItem:
      type: object
      properties:
        operational_asset_id:
          type: string
          description: Send this to `POST /p2p/listings`.
        asset_revision:
          type: string
          description: Send this to `POST /p2p/listings` unchanged.
        asset_id:
          type: string
          description: Steam asset id — tells two copies of the same skin apart.
        market_hash_name:
          type: string
        context_id:
          type: string
          enum:
            - '2'
            - '16'
          description: Steam inventory context the copy was seen in.
        listable:
          type: boolean
          description: '`true` when this copy can be published right now.'
        reasons:
          type: array
          description: >-
            Why it cannot be published — empty when `listable` is `true`.
            Typical codes: `snapshot_stale`, `not_tradable`, `on_hold`,
            `hold_not_ended`, `already_listed`, `reserved`, `active_trade`.
          items:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
        listed:
          type: boolean
          description: Already has a listing.
        listing_id:
          type:
            - string
            - 'null'
        listing_status:
          type:
            - string
            - 'null'
          description: Status of that listing, as in `P2PListing.status`.
        snapshot_completed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the inventory read that last saw this copy finished.
    P2PInventoryProof:
      type:
        - object
        - 'null'
      description: >-
        Whether we hold a current read of your Steam inventory. Publishing needs
        `ready`. On `pending`, call `GET /p2p/inventory` again after
        `retry_after_ms`. On `blocked`, `code` says what to fix on your side.
      properties:
        status:
          type: string
          enum:
            - ready
            - pending
            - blocked
        completed_at:
          type: string
          format: date-time
          description: '`ready` only.'
        asset_count:
          type:
            - integer
            - 'null'
          description: '`ready` only.'
        started_at:
          type: string
          format: date-time
          description: '`pending` only.'
        retry_after_ms:
          type: integer
          description: '`pending` only — when to ask again.'
        code:
          type: string
          description: >-
            `blocked` only: `no_steam_link`, `no_trade_url`,
            `private_inventory`, `invalid_trade_url`, `empty_inventory`,
            `inventory_too_large`, `bot_service_unavailable` or
            `build_timed_out`.
        message:
          type: string
          description: '`blocked` only.'
    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
  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: >-
        Rate limit exceeded. Includes a Retry-After header (60 seconds on the
        per-key limits).
      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
            detail: Rate limit of 100 requests/min exceeded.
    P2PDisabled:
      description: The P2P market is switched off.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            p2p_disabled:
              summary: P2P market unavailable
              value:
                code: p2p_disabled
                detail: The P2P market is not available right now.
  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.

````

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