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

# 创建 Resend Order

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

建立补寄订单——将一个或多个已收到的退件库存项打包，再寄到客户地址。会触发异步面单生成；面单 URL 透过 webhook 推送。

## 前置条件

* 目标库存项已在您的账户中。`returnInventoryId` 由 `newInventoryCreated` webhook 事件推送——请在自有侧缓存。
* 同一次补寄的所有库存必须**位于同一仓库**。
* 每条库存当前的 `handlingStatusCode` 必须可推进至 `rsd`（补寄）——通常需为 `ohd`（暂存）。
* 任何项的所属行项目不可存在待处理 VAS。
* 每条库存必须实际在库（非运输中、亦未处于其他活跃流程）。
* 备好目的地地址。

## 必填字段

* **`resendShipment`** — 完整 Shipment payload（目的地址、联络人、尺寸、重量、服务类型）。国家代码为 **ISO3**。
  * `warehouseId` 为**必填**，且必须与 `returnInventoryIdList` 中各项目所属的仓库相同（同一次补寄的所有项目共用同一仓库）。省略将导致校验失败。
  * payload 内的 `shipmentServiceType` 是 **Shipment Service Type**（**不是** Return Service Type）— 有效代码请见 [获取 Warehouse 可用的 Shipment Service Types](/zh-Hans/api-reference/shipmentservicetype/get-available-shipment-service-types-for-warehouse)。传入 Return Service Type 代码会在校验阶段失败。
* **`returnInventoryIdList`** — 非空 `List<long>`。上限为 `ResendConfig.groupResendMaxRmaCount`（通常为个位数；如需打包更多请联络客服）。

## 选填字段

* **`description`** — 补寄订单的自由文本描述（上限 255 字符）。会保存至订单，并由[取得补寄订单详情](/zh-Hans/api-reference/resend/get-resend-order-details)返回。
* **`remarks`** — 补寄订单的商家备注（上限 5000 字符）。会保存至订单，并由[取得补寄订单详情](/zh-Hans/api-reference/resend/get-resend-order-details)返回。

<Note>两者对应 Portal 上 Create Resend 表单的 **Description** 与 **Remarks** 字段。均为选填——省略即表示该订单不设描述或备注。</Note>

## 副作用

* 每条库存的 `handlingCode` 会被设为 `rsd`。
* 待面单就绪后，仓库将出货。

<h2 id="label-generation-auto-vs-manual-service-types">
  标签生成：自动 vs 手动服务类型
</h2>

补寄是否自动生成运单标签，取决于您在 `resendShipment.shipmentServiceType` 中传入的 shipment service type。每个 shipment service type 都带有 `isEnableAutoCreateLabel` 标志——请从 [获取 Warehouse 可用的 Shipment Service Types](/zh-Hans/api-reference/shipmentservicetype/get-available-shipment-service-types-for-warehouse) 获取，并读取您打算使用的代码的 `isEnableAutoCreateLabel`。

<h3 id="auto-label-isenableautocreatelabel-true">
  自动标签（`isEnableAutoCreateLabel: true`）
</h3>

标签在创建后异步生成。补寄状态流转为：

`queued` → `label-success` → `completed`（若标签生成失败则 `queued` → `failed`）

仅当补寄处于 `label-success` 且在截止时间之前，才能通过 [取消补寄订单](/zh-Hans/api-reference/resend/cancel-resend-order) 取消。处于 `queued` 时**无法**取消，因为标签仍在生成中。

<h3 id="manual-label-isenableautocreatelabel-false">
  手动标签（`isEnableAutoCreateLabel: false`）
</h3>

不会自动生成标签；由仓库处理该补寄。补寄状态流转为：

`pending` → `in-progress` → `completed`

当补寄处于 `pending` 且在截止时间之前，可通过 [取消补寄订单](/zh-Hans/api-reference/resend/cancel-resend-order) 取消。

<h3 id="cancellation-cut-off">
  取消截止时间
</h3>

每个补寄都有取消截止时间，即**工作日的 08:00 UTC**，在补寄创建时设定。只要补寄处于其可取消状态（自动标签为 `label-success`，手动标签为 `pending`），您可在该截止时间之前取消。一旦超过截止时间，便无法再通过 API 取消。

<Note>若已超过截止时间但您仍需取消补寄，请联络我们的客服团队协助。截止时间过后无法保证能取消——包裹可能已经寄出。</Note>

## 相关

* [取得补寄订单详情](/zh-Hans/api-reference/resend/get-resend-order-details) — 仅在 webhook 提及您未缓存的补寄时调用。
* [取消补寄订单](/zh-Hans/api-reference/resend/cancel-resend-order) — 在仓库出货前撤销。
* [取得所有补寄状态](/zh-Hans/api-reference/resendstatus/get-all-resend-statuses) — 代码到标签的映射。
* [Webhooks](/zh-Hans/webhooks) — `labelGenerated` 与补寄状态更新事件会将生命周期变更推送至您的端点。


## OpenAPI

````yaml post /api/Resend/createResend
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/Resend/createResend:
    post:
      tags:
        - Resend
      summary: Create resend order
      operationId: ReturnUserApi_CreateResend
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateResendRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateResendResponse'
        '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:
    CreateResendRequest:
      type: object
      properties:
        returnInventoryIdList:
          type: array
          items:
            type: integer
            format: int64
          description: List of return inventory IDs for resend
        resendShipment:
          $ref: '#/components/schemas/CreateResendShipmentPayload'
          description: Destination shipment address for the resend
        description:
          type: string
          maxLength: 255
          description: >-
            Optional free-text description for the resend order. Stored against
            the order and returned by Get resend order details.
        remarks:
          type: string
          maxLength: 5000
          description: >-
            Optional merchant remarks/notes for the resend order. Stored against
            the order and returned by Get resend order details.
      required:
        - returnInventoryIdList
        - resendShipment
    CreateResendResponse:
      type: object
      properties:
        resendId:
          type: integer
          format: int64
          description: Created resend 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'
    CreateResendShipmentPayload:
      type: object
      properties:
        warehouseId:
          type: integer
          description: >-
            Identifier of the warehouse fulfilling the resend. Must match the
            warehouse of the items referenced in `returnInventoryIdList` — all
            items in a single resend belong to one warehouse.
        shipmentCountryCode:
          type: string
          description: ISO3 destination country code (e.g. GBR, USA)
        shipmentServiceType:
          type: string
          description: Shipment service type code
        shipmentName:
          type: string
          description: Recipient name
        shipmentPhone:
          type: string
          description: Recipient phone number
        shipmentFax:
          type: string
          description: Recipient fax number (optional)
        shipmentEmail:
          type: string
          description: Recipient email address (optional)
        shipmentStreet1:
          type: string
          description: Address line 1
        shipmentStreet2:
          type: string
          description: Address line 2
        shipmentStreet3:
          type: string
          description: Address line 3 (optional)
        shipmentState:
          type: string
          description: State / province
        shipmentCity:
          type: string
          description: City
        shipmentPostalCode:
          type: string
          description: Postal code
      required:
        - warehouseId
        - shipmentCountryCode
        - shipmentName
        - shipmentPhone
        - shipmentStreet1
        - shipmentStreet2
        - shipmentCity
        - shipmentPostalCode
        - shipmentState
    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

````