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

# Return Inventory Handling を更新

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

1 件の返品在庫レコードのハンドリング決定を更新します——つまり、倉庫が受領したパーセルをどう扱うかを指示します。多くは倉庫がパーセルをログ済みの後に呼び出されます。これ以降、在庫は選択されたハンドリング（再入庫、廃棄、リコール、再送など）の経路を辿ります。

## 呼び出すタイミング

* カスタマーサポートまたはオペレーションチームがハンドリングを決定した後。

## 必須フィールド

* **`returnInventoryId`** — long。存在し、アカウントに属していること。倉庫でパーセルがログされたタイミングの `newInventoryCreated` webhook イベントで配信されます。後続の処理に備え、自社側でキャッシュしてください。webhook ストリームが在庫 ID の真実のソースです。
* **`handlingCode`** — 文字列。[すべてのハンドリングタイプを取得](/ja/api-reference/handling/get-all-handling-types) が返す値のいずれかである必要があります。直接 `rsd`（再送）や `tbc`（未確定）には設定**できません**——専用エンドポイントを使ってください。よく使う値：`ohd`（保留）、`rtn`（リコール）、`rst`（再入庫）、`dsp`（廃棄）。

明示的な例外：現在の `handlingStatusCode` が `pending` で、新しいハンドリングが `ohd`（保留）の場合は常に許可されます——調査中に在庫を保留状態へ移すのに便利です。

次の場合はハンドリングを更新**できません**：

* 在庫の所属ラインアイテムに保留中の VAS（付加価値サービス）リクエストがある。先に [すべての VAS を取得](/ja/api-reference/vas/get-all-value-added-services) と VAS エンドポイントで VAS をキャンセルまたは完了させてください。

## 副作用

* 在庫レコードの `handlingCode` と `handlingStatusCode` が更新されます。
* 新しいハンドリングが `ohd` または `oth`（その他）**でない**場合、当該在庫の RMA スワップを防ぐため RMA マッピングがロックされます。

## 関連

* [返品在庫ハンドリングをキャンセル](/ja/api-reference/returninventory/cancel-return-inventory-handling) — 倉庫が実行する前にハンドリング決定を取り消します。
* [返品在庫 ID でリコール作成](/ja/api-reference/recall/create-recall-by-return-inventory-ids) — リコールされた在庫を専用のリコールパイプラインで流すには。
* [再送注文を作成](/ja/api-reference/resend/create-resend-order) — 再送経路（こちらも本エンドポイントから直接到達できません）。
* [Webhooks](/ja/webhooks) — `newInventoryCreated`、`vasUpdated`、在庫ハンドリング完了イベント、`notifyUserRmaSwapped` が在庫ライフサイクルをエンドポイントへ配信します。


## OpenAPI

````yaml post /api/ReturnInventory/UpdateReturnInventoryHandling
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/UpdateReturnInventoryHandling:
    post:
      tags:
        - ReturnInventory
      summary: Update return inventory handling
      operationId: ReturnUserApi_UpdateReturnInventoryHandling
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateReturnInventoryHandlingRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
        '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:
    UpdateReturnInventoryHandlingRequest:
      type: object
      properties:
        returnInventoryId:
          type: integer
          format: int64
          description: Return inventory ID to update handling for
        handlingCode:
          type: string
          description: Handling code to apply
      required:
        - returnInventoryId
        - handlingCode
    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

````