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

# 获取 退货库存 详情

<Warning>
  此页面由 AI 自动翻译。API 技术规格以英文呈现为标准。如有任何疑问，请参阅[英文版本](/api-reference/returninventory/get-return-inventory-details)。
</Warning>

依据 `returnInventoryId` 获取单条退件库存记录的完整内容。常在收到 webhook（例如 `inventoryCreated`）后调用，以读取当前状态。

## 库存图片

响应中包含 `returnRequestLineItemImages[]` 数组，列出附加到库存对应行项目上的图片。**该端点返回的是 S3 key，而不是 URL** —— 要展示或拉取图片，请用您所在环境的主机名与 key 拼接出 URL。

### 条目结构

每条记录提供同一张图片的四种尺寸变体，便于您按 UI 用途选用：

| 字段                  | 典型用途                 |
| ------------------- | -------------------- |
| `s3SmallFileKey`    | 列表视图的缩略图             |
| `s3MediumFileKey`   | 详情视图的预览              |
| `s3LargeFileKey`    | 全屏预览                 |
| `s3OriginalFileKey` | 原始上传（最大；仅在需要未缩放图时使用） |

### 构造 URL

按环境选择主机名：

| 环境      | 图片主机名                            |
| ------- | -------------------------------- |
| 沙箱（UAT） | `rr-dev-files.returnshelper.com` |
| 生产      | `file.returnhelpercentre.com`    |

公式：

```
URL = "https://" + <图片主机名> + "/" + <key>
```

生产环境示例：

```
s3MediumFileKey = "img/returns/202606/27_1000040536_lmpiohbx.5n3_medium.jpg"
                  ↓ 拼接
URL             = "https://file.returnhelpercentre.com/img/returns/202606/27_1000040536_lmpiohbx.5n3_medium.jpg"
```

key 已经包含完整的 S3 路径。拼接出来的 URL 公网可访问，不需要认证头，也不会过期；URL 与图片内容均可在客户端安全缓存。

<Warning>
  **请将路径视为不透明。** Return Helper 历史上使用过多种路径前缀（例如 `img/returns/...` 与 `images/returns/...`）；只有**主机名**是稳定的。请勿解析、校验或对路径/文件名做任何模式匹配。
</Warning>

无图片时的空状态：`returnRequestLineItemImages: []`。

<Note>
  本端点返回的是查询那一刻的当前状态。如需在仓库人员添加、替换或删除图片时实时收到通知，请订阅 [`changeLineItemImage`](/zh-Hans/webhooks#image-updated) webhook，而非反复轮询本端点。
</Note>

## 相关

* [按 Line Item Id 获取退货库存](/zh-Hans/api-reference/returninventory/get-return-inventory-by-line-item-id) —— 响应结构相同，但以 line item ID 查询。
* [Image Updated webhook](/zh-Hans/webhooks#image-updated) —— 图片变更的实时通知。
* [VAS Updated webhook](/zh-Hans/webhooks#vas-update) —— VAS 结果图片的实时通知。


## OpenAPI

````yaml get /api/ReturnInventory/GetReturnInventory
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/ReturnInventory/GetReturnInventory:
    get:
      tags:
        - ReturnInventory
      summary: Get return inventory details
      operationId: ReturnUserApi_GetReturnInventory
      parameters:
        - name: returnInventoryId
          in: query
          required: false
          schema:
            type: integer
            format: int64
          description: Return inventory identifier
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserReturnInventoryResponse'
        '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:
    UserReturnInventoryResponse:
      type: object
      properties:
        returnInventoryId:
          type: integer
          format: int64
          description: Return inventory identifier
    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

````