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

# SKU 在庫を検索

> Enterprise-only. Returns warehouse-scoped SKU inventory rows for the authenticated account, using cursor-based pagination. Each row carries the total `quantity` and the `availableQuantity` for one SKU in one warehouse; the same SKU held in different warehouses appears as separate rows. Omitting both `warehouseIdList` and `skuList` returns rows across every warehouse owned by the account.

<Warning>
  このページはAIによって自動翻訳されています。API技術仕様は英語が正式です。不明点がある場合は[英語版](/api-reference/skuinventory/search-sku-inventory)を参照してください。
</Warning>

<Note>
  これは **Enterprise 専用** 機能で、Return Helper Enterprise のお客様のみ有効です。本サービスの料金については、[enterprise-solution@returnhelper.com](mailto:enterprise-solution@returnhelper.com) までお問い合わせください。
</Note>

アカウントの SKU 在庫を倉庫単位で返します。カーソルベースのページネーションを使用します。各行は、ある SKU のある倉庫における合計 `quantity` と `availableQuantity` の両方を報告します。

<h2 id="rows-are-keyed-by-warehouse-and-sku">
  行は倉庫と SKU をキーとする
</h2>

同じ SKU が複数の倉庫に存在する場合は、**別々の行**として返されます（倉庫ごとに 1 行）。レスポンスの 1 行は `warehouseId` + `sku` の組み合わせで一意に識別され、`searchTotalCount` は相異なる SKU 値の数ではなく「倉庫-SKU」行数を数えます。単一の倉庫のみを見るには `warehouseIdList` を渡してください。

<Warning>
  この端点の**旧バージョン**が発行したカーソルは**拒否**されます。古いカーソル値をキャッシュしている場合は、`cursor` を付けずにページネーションを再開してください。バージョン付きカーソルは後方互換ではなく、古い API ID カーソル値が倉庫 ID として再解釈されることもありません。
</Warning>

<h2 id="pagination">
  ページネーション
</h2>

このエンドポイントは**カーソルベースのページネーション**を使用します。各レスポンスには `nextCursor` と `previousCursor` が含まれます。

* `nextCursor` は次のページのカーソルです。最後のページに達した場合は `null` になります。
* `previousCursor` は前のページのカーソルです。最初のページでは `null` になります。

前方向にページ送りするには、`nextCursor` の値を `cursor` クエリパラメータとして渡し、`isForward=true` を指定します。1 つのページネーションシーケンス内では、同じ `pageSize`（および任意の `warehouseIdList` / `skuList` フィルタ）を維持してください。

<Note>
  `availableQuantity` は**事前の可用性チェック**のための**サマリー**値であり、**予約ではありません**。投影の遅延によりリアルタイムの返品在庫と一時的に異なることがあり、保留中の VAS を持ち実際には resend 対象外のレコードを数える場合もあります。[SKU で Resend を作成](/ja/api-reference/resend/create-resend-by-sku)が、リクエスト時に MySQL に対して権威的かつロックされた割り当てを行います。
</Note>

<h2 id="related">
  関連
</h2>

* [SKU 在庫の件数を取得](/ja/api-reference/skuinventory/search-sku-inventory-total-count) — 同じフィルタに一致する「倉庫-SKU」行の総数。
* [SKU で Resend を作成](/ja/api-reference/resend/create-resend-by-sku) — 返品在庫 ID ではなく SKU 数量で resend を作成します。


## OpenAPI

````yaml get /api/skuInventory/search
openapi: 3.1.0
info:
  title: Return Helper API
  description: API documentation for Return Helper — covering User and Public endpoints.
  version: 1.0.0
servers:
  - url: https://api.returnshelper.com/uat/user
    description: Sandbox — User API
  - url: https://api.returnshelper.com/uat/public
    description: Sandbox — Public API
  - url: https://api.returnhelpercentre.com/v1/user
    description: Production — User API
  - url: https://api.returnhelpercentre.com/v1/public
    description: Production — Public API
  - url: https://api.returnhelperchina.com/user
    description: Production — User API (China)
security:
  - ApiKey: []
    ApiToken: []
paths:
  /api/skuInventory/search:
    get:
      tags:
        - SkuInventory
      summary: Search SKU inventory
      description: >-
        Enterprise-only. Returns warehouse-scoped SKU inventory rows for the
        authenticated account, using cursor-based pagination. Each row carries
        the total `quantity` and the `availableQuantity` for one SKU in one
        warehouse; the same SKU held in different warehouses appears as separate
        rows. Omitting both `warehouseIdList` and `skuList` returns rows across
        every warehouse owned by the account.
      operationId: ReturnUserApi_SearchSkuInventory
      parameters:
        - name: pageSize
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 1000
          description: >-
            Number of warehouse-SKU rows to return per page. Required. Minimum
            1, maximum 1000.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: >-
            Opaque, versioned cursor token encoding cursor version, warehouse
            ID, and SKU. Pass the `nextCursor` (or `previousCursor`) from a
            previous response to fetch the adjacent page. Omit to fetch the
            first page. Cursors issued by the previous (pre-redesign) version of
            this endpoint are rejected — restart pagination without a cursor.
        - name: isForward
          in: query
          required: false
          schema:
            type: boolean
          description: >-
            Pagination direction. Set `true` to page forward through results
            using the returned `nextCursor`. Defaults to `false` when omitted.
            Optional.
        - name: warehouseIdList
          in: query
          required: false
          schema:
            type: string
          description: >-
            Comma-separated list of warehouse IDs to filter by (e.g.
            `1001,1002`). When provided, each value must be a positive integer,
            the list must contain no duplicates, the number of entries must not
            exceed 100, and every warehouse must be owned by the authenticated
            account. Omit to return rows across all owned warehouses. Optional.
        - name: skuList
          in: query
          required: false
          schema:
            type: string
          description: >-
            Comma-separated list of SKUs to filter by (e.g. `SKU-006,SKU-001`).
            When provided, the number of entries must not exceed 100 and each
            SKU must match the SKU pattern (alphanumerics plus `#`, `-`, `_`;
            maximum 32 characters). SKUs are matched after trim and uppercase
            normalization. Omit to return all SKUs. Optional.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkuInventorySearchResponse'
        '401':
          description: >-
            Authentication failed. Returned when the `x-rr-apikey` or
            `x-rr-apitoken` header is missing or invalid. The body uses the
            standard `ApiResponse` envelope with `meta.error.message` describing
            the auth failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      security:
        - ApiKey: []
          ApiToken: []
      servers:
        - url: https://api.returnshelper.com/uat/user
          description: Sandbox — User API
components:
  schemas:
    SkuInventorySearchResponse:
      type: object
      description: >-
        Cursor-paginated list of SKU inventory records. The business payload
        (`nextCursor`, `previousCursor`, `data`) is returned as top-level fields
        alongside the standard `correlationId` and `meta` envelope.
      properties:
        nextCursor:
          type:
            - string
            - 'null'
          description: >-
            Cursor token for the next page, or `null` when there is no next
            page. Pass it back as `cursor` with `isForward=true` to page
            forward.
        previousCursor:
          type:
            - string
            - 'null'
          description: >-
            Cursor token for the previous page, or `null` when there is no
            previous page.
        data:
          type: array
          items:
            $ref: '#/components/schemas/SkuInventoryItem'
          description: SKU inventory records for the current page
    ApiResponse:
      type: object
      description: >-
        Universal response envelope. Successful responses include the business
        payload as additional top-level fields alongside `correlationId` and
        `meta`. Failed responses (auth errors, validation errors) only populate
        `correlationId` and `meta`, with `meta.errorCode` and `meta.error`
        describing the failure.
      properties:
        correlationId:
          type:
            - string
            - 'null'
          description: >-
            Unique correlation ID for tracing the request through Return Helper
            systems.
        meta:
          $ref: '#/components/schemas/ApiResponseMeta'
    SkuInventoryItem:
      type: object
      description: >-
        A single warehouse-scoped SKU inventory row. The same SKU held in more
        than one warehouse is returned as separate rows (one per warehouse).
      properties:
        sku:
          type: string
          description: Stock keeping unit (SKU) identifier.
        warehouseId:
          type: integer
          format: int32
          description: >-
            Identifier of the warehouse that holds this SKU. Rows are keyed by
            warehouse and SKU together.
        quantity:
          type: integer
          description: Total inventory quantity for this SKU in this warehouse.
        availableQuantity:
          type: integer
          description: >-
            Quantity currently available for resend for this SKU in this
            warehouse, derived from each underlying return inventory record's
            `handlingStatusCode`. Always less than or equal to `quantity`. This
            is a summary figure for an early availability check, not a
            reservation — see the Create resend by SKU page for how allocation
            is finalised.
        modifyOn:
          type: string
          format: date-time
          description: >-
            Timestamp of the most recent inventory change for this warehouse-SKU
            row (ISO 8601, UTC).
    ApiResponseMeta:
      type: object
      description: >-
        Application-level metadata for every API response. Inspect `status` and
        `errorCode` to detect soft-error responses (validation failures arrive
        as HTTP 200 with `meta.status: 400`).
      properties:
        status:
          type: integer
          description: >-
            Application-level status code. For successful operations this
            mirrors the HTTP status (e.g. 200). For validation failures it
            reports the logical status (e.g. 400) even though the wire HTTP
            status is 200.
        data:
          type: object
          additionalProperties:
            type: string
          description: Reserved free-form metadata key/value pairs. Usually empty.
        errorCode:
          type:
            - string
            - 'null'
          description: >-
            Machine-readable error code (e.g. `VALIDATION_FAILED`). Non-null
            only when the operation failed.
        error:
          type: object
          additionalProperties: true
          description: >-
            Field-level or message-level error detail keyed by request property
            name. Empty object on success.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-rr-apikey
      description: Your API key
    ApiToken:
      type: apiKey
      in: header
      name: x-rr-apitoken
      description: Your API token — keep this private

````