> ## 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` で 1 件の返品在庫レコードの完全な内容を取得します。webhook（例：`inventoryCreated`）を受信した直後に呼び出して現在の状態を読み取る用途が一般的です。

## 在庫画像

レスポンスには、在庫の line item に紐づく画像を列挙する `returnRequestLineItemImages[]` 配列が含まれます。**このエンドポイントは URL ではなく S3 キーを返します** — 画像を表示・取得するには、お客様の環境のホスト名と S3 キーを連結して URL を組み立ててください。

### エントリの構造

各エントリは同一画像の 4 つのサイズ別バリアントを返却するため、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"
```

キーには S3 の完全なパスがすでに含まれています。組み立てた URL は公開アクセス可能で、認証ヘッダー不要、かつ期限切れもありません。URL と画像コンテンツの両方をクライアント側で安全にキャッシュできます。

<Warning>
  **パスは不透明なものとして扱ってください。** Return Helper は過去に複数のパスプレフィックス（`img/returns/...` や `images/returns/...` など）を使用してきました。**ホスト名のみ**が安定です。パスやファイル名を解析・検証・パターンマッチしないでください。
</Warning>

画像が添付されていない場合の空状態：`returnRequestLineItemImages: []`。

<Note>
  このエンドポイントは問い合わせ時点の現在状態を返します。倉庫担当者が画像を追加・置換・削除したタイミングでリアルタイム通知が必要な場合は、このエンドポイントをポーリングするのではなく [`changeLineItemImage`](/ja/webhooks#image-updated) webhook を購読してください。
</Note>

## 関連

* [Line Item Id で返品在庫を取得](/ja/api-reference/returninventory/get-return-inventory-by-line-item-id) — レスポンス構造は同じですが、line item ID で問い合わせます。
* [Image Updated webhook](/ja/webhooks#image-updated) — 画像変更のリアルタイム通知。
* [VAS Updated webhook](/ja/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

````