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

# 取得所有可存取的 Warehouses

<Warning>
  此頁面由 AI 自動翻譯。API 技術規格以英文呈現為標準。如有任何疑問，請參閱[英文版本](/api-reference/warehouse/get-all-warehouses-accessible-to-user)。
</Warning>

列出您帳戶可存取的所有倉庫，包含地址、聯絡方式與能力中繼資料。多數整合在設定階段呼叫一次，將倉庫對映到顯示名稱，並取得 API 其他端點所需的 `warehouseId`。

請注意：生產環境與沙盒環境的 `warehouseId` **並不相同**。

## 何時呼叫

* 整合設定階段，用以在賣家介面中填充倉庫選擇器。
* 當您帳戶獲授權使用新倉庫時（例如開通新區域），用以重新整理本地快取。

## 回應備註

* `countryCode` 以**小寫 ISO3** 形式回傳（例如 `usa`、`gbr`、`chn`）。請使用這些值填入 `shipFromCountry` 或 `fromCountryCode` 等欄位。
* 完整地址（`street1`、`street2`、`street3`、`city`、`state`、`postalCode`）一併回傳，可用於在退貨單或客戶面單上預填收件資訊。
* `description` 為可讀名稱，可能會變動。請將 `warehouseId`（整數）作為本地資料庫的穩定主鍵。

## 相關

* [依始發國家取得倉庫](/zh-Hant/api-reference/warehouse/get-warehouses-by-origin-country) — 同樣資料，依指定始發國家篩選。
* [依 ID 取得倉庫詳情](/zh-Hant/api-reference/warehouse/get-warehouse-details-by-id-1) — 依 `warehouseId` 取得單一倉庫紀錄。


## OpenAPI

````yaml get /api/Warehouse/GetAllWarehouse
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/Warehouse/GetAllWarehouse:
    get:
      tags:
        - Warehouse
      summary: Get all warehouses accessible to user
      operationId: ReturnUserApi_GetAllWarehouse
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralList_WarehouseResponse'
        '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:
    GeneralList_WarehouseResponse:
      type: object
      properties:
        warehouses:
          type: array
          items:
            $ref: '#/components/schemas/WarehouseResponse'
          description: List of warehouses
    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'
    WarehouseResponse:
      type: object
      properties:
        warehouseId:
          type: integer
          format: int32
          description: Warehouse unique identifier
        countryCode:
          type:
            - string
            - 'null'
          description: Lowercase ISO3 country code (e.g. "usa")
        contactName:
          type:
            - string
            - 'null'
          description: Contact name
        companyName:
          type:
            - string
            - 'null'
          description: Company name
        phone:
          type:
            - string
            - 'null'
          description: Phone number
        email:
          type:
            - string
            - 'null'
          description: Email address
        fax:
          type:
            - string
            - 'null'
          description: Fax number
        street1:
          type:
            - string
            - 'null'
          description: Address line 1
        street2:
          type:
            - string
            - 'null'
          description: Address line 2
        street3:
          type:
            - string
            - 'null'
          description: Address line 3
        state:
          type:
            - string
            - 'null'
          description: State / province
        city:
          type:
            - string
            - 'null'
          description: City
        postalCode:
          type:
            - string
            - 'null'
          description: Postal code
        addressType:
          type:
            - string
            - 'null'
          description: Address type
        description:
          type:
            - string
            - 'null'
          description: >-
            Free-text warehouse description. There is no separate warehouseName
            field — use warehouseId as the stable reference key.
        warehouseRmaPrefix:
          type:
            - string
            - 'null'
          description: Warehouse RMA prefix used in inbound parcel identifiers
    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

````