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

更新单条退件库存记录的处理决定——告诉仓库该如何处置已收到的包裹。多在仓库登记包裹后调用；从此库存便会沿着所选处理路径（上架、销毁、召回、补寄等）继续。

## 何时调用

* 客服或运营团队决定处理方式后。

## 必填字段

* **`returnInventoryId`** — 长整型；必须存在且属于您的账户。在仓库登记包裹时，由 `newInventoryCreated` webhook 事件推送；请在自有侧缓存以备后续操作。webhook 流是库存 ID 的真实数据源。
* **`handlingCode`** — 字符串，必须是 [取得所有处理类型](/zh-Hans/api-reference/handling/get-all-handling-types) 返回的值之一。**不能**直接使用 `rsd`（补寄）或 `tbc`（待确认）——这两类有专属端点。常用值：`ohd`（暂存）、`rtn`（退回）、`rst`（上架）、`dsp`（销毁）。

特殊例外：若当前 `handlingStatusCode` 为 `pending` 且新处理为 `ohd`（暂存），调用始终允许——便于在调查期间将库存挂起。

下列情况**无法**更新处理：

* 库存所属行项目存在待处理的 VAS（增值服务）请求。请先透过 [取得所有 VAS](/zh-Hans/api-reference/vas/get-all-value-added-services) 与 VAS 端点取消或完成 VAS。

## 副作用

* 库存记录上的 `handlingCode` 与 `handlingStatusCode` 会被更新。
* 若新处理**不是** `ohd` 或 `oth`（其他），将锁定 RMA 映射，禁止对该库存进行 RMA 交换。

## 相关

* [取消退件库存处理](/zh-Hans/api-reference/returninventory/cancel-return-inventory-handling) — 在仓库执行前撤销处理决定。
* [按退件库存 ID 创建召回](/zh-Hans/api-reference/recall/create-recall-by-return-inventory-ids) — 透过专属召回流程处理被召回的库存。
* [建立补寄订单](/zh-Hans/api-reference/resend/create-resend-order) — 走补寄路径（同样无法直接透过本端点到达）。
* [Webhooks](/zh-Hans/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

````