> ## 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 the number of warehouse-SKU rows that match the same filters accepted by Search SKU inventory. The same SKU across N warehouses counts as N rows. Use it to size pagination before walking the cursor. Accepts only the optional `warehouseIdList` and `skuList` filters — there is no `pageSize`, `cursor`, or `isForward`.

<Warning>
  此頁面由 AI 自動翻譯。API 技術規格以英文呈現為標準。如有任何疑問，請參閱[英文版本](/api-reference/skuinventory/search-sku-inventory-total-count)。
</Warning>

<Note>
  此為 **Enterprise 專屬** 功能，僅對 Return Helper Enterprise 客戶啟用。如需了解此服務的定價，請聯絡 [enterprise-solution@returnhelper.com](mailto:enterprise-solution@returnhelper.com)。
</Note>

回傳符合[搜尋 SKU 庫存](/zh-Hant/api-reference/skuinventory/search-sku-inventory)相同篩選條件的「倉庫-SKU」列數。可在走訪游標前用來估算分頁規模。

<h2 id="what-is-counted">
  計算內容
</h2>

`totalNumberOfRecords` 計算的是\*\*「倉庫-SKU」列\*\*，而非相異的 SKU 值。同一個 SKU 若存放於三個倉庫，會計為三列。這與 Search SKU inventory 在相同篩選條件下所分頁走訪的內容完全一致。

<h2 id="related">
  相關
</h2>

* [搜尋 SKU 庫存](/zh-Hant/api-reference/skuinventory/search-sku-inventory) — 分頁走訪符合的「倉庫-SKU」列。


## OpenAPI

````yaml get /api/skuInventory/searchTotalCount
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/searchTotalCount:
    get:
      tags:
        - SkuInventory
      summary: Count SKU inventory rows
      description: >-
        Enterprise-only. Returns the number of warehouse-SKU rows that match the
        same filters accepted by Search SKU inventory. The same SKU across N
        warehouses counts as N rows. Use it to size pagination before walking
        the cursor. Accepts only the optional `warehouseIdList` and `skuList`
        filters — there is no `pageSize`, `cursor`, or `isForward`.
      operationId: ReturnUserApi_SearchSkuInventoryTotalCount
      parameters:
        - name: warehouseIdList
          in: query
          required: false
          schema:
            type: string
          description: >-
            Comma-separated list of warehouse IDs to filter by (e.g.
            `1001,1002`). Same rules as Search SKU inventory: positive integers,
            no duplicates, at most 100 entries, each owned by the authenticated
            account. Omit to count 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`).
            Same rules as Search SKU inventory: at most 100 entries, each
            matching the SKU pattern (alphanumerics plus `#`, `-`, `_`; maximum
            32 characters), matched after trim and uppercase normalization. Omit
            to count all SKUs. Optional.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SkuInventorySearchTotalCountResponse'
        '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:
    SkuInventorySearchTotalCountResponse:
      type: object
      description: >-
        Total-count companion to Search SKU inventory. `totalNumberOfRecords` is
        returned as a top-level field alongside the standard `correlationId` and
        `meta` envelope.
      properties:
        totalNumberOfRecords:
          type: integer
          format: int32
          description: >-
            Number of matching warehouse-SKU rows for the same filters (the same
            SKU across N warehouses counts as N rows), not the number of
            distinct SKU values.
    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'
    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

````