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

再送注文を作成します——すでに受領済みの 1 件以上の返品在庫アイテムを、顧客の住所宛にまとめて発送する出庫シップメントです。非同期のラベル生成をトリガーし、ラベル URL は webhook で配信されます。

## 前提条件

* 対象在庫アイテムがアカウントに存在していること。`returnInventoryId` は `newInventoryCreated` webhook イベントで配信されるため、自社側でキャッシュしてください。
* 同一の再送内のすべての在庫が **同じ倉庫** にあること。
* 各在庫の現在の `handlingStatusCode` が、ハンドリング状態機械上で `rsd`（再送）に進めるものであること——通常は `ohd`（保留）状態である必要があります。
* いずれのアイテムのラインアイテムにも保留中の VAS が存在しないこと。
* 各在庫が物理的に在庫されていること（輸送中ではなく、他のアクティブなワークフローにも入っていない）。
* 宛先住所を準備しておくこと。

## 必須フィールド

* **`resendShipment`** — 完全な Shipment ペイロード（宛先住所、連絡先、寸法、重量、サービスタイプ）。国コードは **ISO3**。
  * `warehouseId` は**必須**で、`returnInventoryIdList` に含まれるアイテムの倉庫と一致している必要があります（1 回の再送のすべてのアイテムは同じ倉庫に属します）。省略するとバリデーションに失敗します。
  * ペイロード内の `shipmentServiceType` は **Shipment Service Type**（Return Service Type で**はありません**）— 有効なコードは [Warehouse で利用可能な Shipment Service Types を取得](/ja/api-reference/shipmentservicetype/get-available-shipment-service-types-for-warehouse) を参照してください。Return Service Type コードを渡すとバリデーションで失敗します。
* **`returnInventoryIdList`** — 空でない `List<long>`。上限は `ResendConfig.groupResendMaxRmaCount`（通常 1 桁。多数まとめたい場合はサポートにご相談ください）。

## 任意フィールド

* **`description`** — 再送注文の自由記述の説明（最大 255 文字）。注文に保存され、[再送注文の詳細を取得](/ja/api-reference/resend/get-resend-order-details)で返却されます。
* **`remarks`** — 再送注文のマーチャント向け備考（最大 5000 文字）。注文に保存され、[再送注文の詳細を取得](/ja/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 を取得](/ja/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` の状態であり、かつ締め切り時刻より前の場合にのみ、[再送注文をキャンセル](/ja/api-reference/resend/cancel-resend-order) からキャンセルできます。`queued` の間はラベルを生成中のため、キャンセル**できません**。

<h3 id="manual-label-isenableautocreatelabel-false">
  手動ラベル（`isEnableAutoCreateLabel: false`）
</h3>

ラベルは自動生成されず、倉庫が再送を処理します。再送ステータスの流れは次のとおりです：

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

再送が `pending` の状態であり、かつ締め切り時刻より前の場合に、[再送注文をキャンセル](/ja/api-reference/resend/cancel-resend-order) からキャンセルできます。

<h3 id="cancellation-cut-off">
  キャンセル締め切り時刻
</h3>

各再送にはキャンセル締め切り時刻があり、**営業日の 08:00 UTC** で、再送の作成時に設定されます。再送がキャンセル可能なステータス（自動ラベルは `label-success`、手動ラベルは `pending`）である限り、その締め切り時刻まではキャンセルできます。締め切り時刻を過ぎると、API ではキャンセルできなくなります。

<Note>締め切り時刻をすでに過ぎており、それでも再送をキャンセルする必要がある場合は、弊社のカスタマーサポートチームにお問い合わせください。締め切り時刻を過ぎた後のキャンセルは保証されません——荷物はすでに発送されている可能性があります。</Note>

## 関連

* [再送注文の詳細を取得](/ja/api-reference/resend/get-resend-order-details) — webhook がキャッシュされていない再送を参照した場合のみ呼び出してください。
* [再送注文をキャンセル](/ja/api-reference/resend/cancel-resend-order) — 倉庫が出荷する前に中止。
* [すべての再送ステータスを取得](/ja/api-reference/resendstatus/get-all-resend-statuses) — コード → ラベルのマッピング。
* [Webhooks](/ja/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

````