curl --request POST \
--url https://api.returnshelper.com/uat/user/api/Resend/createResend \
--header 'Content-Type: application/json' \
--header 'x-rr-apikey: <api-key>' \
--header 'x-rr-apitoken: <api-key>' \
--data '
{
"returnInventoryIdList": [
123
],
"resendShipment": {
"warehouseId": 123,
"shipmentCountryCode": "<string>",
"shipmentName": "<string>",
"shipmentPhone": "<string>",
"shipmentStreet1": "<string>",
"shipmentStreet2": "<string>",
"shipmentState": "<string>",
"shipmentCity": "<string>",
"shipmentPostalCode": "<string>",
"shipmentServiceType": "<string>",
"shipmentFax": "<string>",
"shipmentEmail": "<string>",
"shipmentStreet3": "<string>"
},
"description": "<string>",
"remarks": "<string>",
"resendNumber": "INV-10042"
}
'import requests
url = "https://api.returnshelper.com/uat/user/api/Resend/createResend"
payload = {
"returnInventoryIdList": [123],
"resendShipment": {
"warehouseId": 123,
"shipmentCountryCode": "<string>",
"shipmentName": "<string>",
"shipmentPhone": "<string>",
"shipmentStreet1": "<string>",
"shipmentStreet2": "<string>",
"shipmentState": "<string>",
"shipmentCity": "<string>",
"shipmentPostalCode": "<string>",
"shipmentServiceType": "<string>",
"shipmentFax": "<string>",
"shipmentEmail": "<string>",
"shipmentStreet3": "<string>"
},
"description": "<string>",
"remarks": "<string>",
"resendNumber": "INV-10042"
}
headers = {
"x-rr-apikey": "<api-key>",
"x-rr-apitoken": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-rr-apikey': '<api-key>',
'x-rr-apitoken': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
returnInventoryIdList: [123],
resendShipment: {
warehouseId: 123,
shipmentCountryCode: '<string>',
shipmentName: '<string>',
shipmentPhone: '<string>',
shipmentStreet1: '<string>',
shipmentStreet2: '<string>',
shipmentState: '<string>',
shipmentCity: '<string>',
shipmentPostalCode: '<string>',
shipmentServiceType: '<string>',
shipmentFax: '<string>',
shipmentEmail: '<string>',
shipmentStreet3: '<string>'
},
description: '<string>',
remarks: '<string>',
resendNumber: 'INV-10042'
})
};
fetch('https://api.returnshelper.com/uat/user/api/Resend/createResend', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.returnshelper.com/uat/user/api/Resend/createResend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'returnInventoryIdList' => [
123
],
'resendShipment' => [
'warehouseId' => 123,
'shipmentCountryCode' => '<string>',
'shipmentName' => '<string>',
'shipmentPhone' => '<string>',
'shipmentStreet1' => '<string>',
'shipmentStreet2' => '<string>',
'shipmentState' => '<string>',
'shipmentCity' => '<string>',
'shipmentPostalCode' => '<string>',
'shipmentServiceType' => '<string>',
'shipmentFax' => '<string>',
'shipmentEmail' => '<string>',
'shipmentStreet3' => '<string>'
],
'description' => '<string>',
'remarks' => '<string>',
'resendNumber' => 'INV-10042'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-rr-apikey: <api-key>",
"x-rr-apitoken: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.returnshelper.com/uat/user/api/Resend/createResend"
payload := strings.NewReader("{\n \"returnInventoryIdList\": [\n 123\n ],\n \"resendShipment\": {\n \"warehouseId\": 123,\n \"shipmentCountryCode\": \"<string>\",\n \"shipmentName\": \"<string>\",\n \"shipmentPhone\": \"<string>\",\n \"shipmentStreet1\": \"<string>\",\n \"shipmentStreet2\": \"<string>\",\n \"shipmentState\": \"<string>\",\n \"shipmentCity\": \"<string>\",\n \"shipmentPostalCode\": \"<string>\",\n \"shipmentServiceType\": \"<string>\",\n \"shipmentFax\": \"<string>\",\n \"shipmentEmail\": \"<string>\",\n \"shipmentStreet3\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"resendNumber\": \"INV-10042\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-rr-apikey", "<api-key>")
req.Header.Add("x-rr-apitoken", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.returnshelper.com/uat/user/api/Resend/createResend")
.header("x-rr-apikey", "<api-key>")
.header("x-rr-apitoken", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"returnInventoryIdList\": [\n 123\n ],\n \"resendShipment\": {\n \"warehouseId\": 123,\n \"shipmentCountryCode\": \"<string>\",\n \"shipmentName\": \"<string>\",\n \"shipmentPhone\": \"<string>\",\n \"shipmentStreet1\": \"<string>\",\n \"shipmentStreet2\": \"<string>\",\n \"shipmentState\": \"<string>\",\n \"shipmentCity\": \"<string>\",\n \"shipmentPostalCode\": \"<string>\",\n \"shipmentServiceType\": \"<string>\",\n \"shipmentFax\": \"<string>\",\n \"shipmentEmail\": \"<string>\",\n \"shipmentStreet3\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"resendNumber\": \"INV-10042\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.returnshelper.com/uat/user/api/Resend/createResend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-rr-apikey"] = '<api-key>'
request["x-rr-apitoken"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"returnInventoryIdList\": [\n 123\n ],\n \"resendShipment\": {\n \"warehouseId\": 123,\n \"shipmentCountryCode\": \"<string>\",\n \"shipmentName\": \"<string>\",\n \"shipmentPhone\": \"<string>\",\n \"shipmentStreet1\": \"<string>\",\n \"shipmentStreet2\": \"<string>\",\n \"shipmentState\": \"<string>\",\n \"shipmentCity\": \"<string>\",\n \"shipmentPostalCode\": \"<string>\",\n \"shipmentServiceType\": \"<string>\",\n \"shipmentFax\": \"<string>\",\n \"shipmentEmail\": \"<string>\",\n \"shipmentStreet3\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"resendNumber\": \"INV-10042\"\n}"
response = http.request(request)
puts response.read_body{
"resendId": 123,
"resendNumber": "RSD221003-0000001"
}{
"correlationId": "<string>",
"meta": {
"status": 123,
"data": {},
"errorCode": "<string>",
"error": {}
}
}Resend Order を作成
curl --request POST \
--url https://api.returnshelper.com/uat/user/api/Resend/createResend \
--header 'Content-Type: application/json' \
--header 'x-rr-apikey: <api-key>' \
--header 'x-rr-apitoken: <api-key>' \
--data '
{
"returnInventoryIdList": [
123
],
"resendShipment": {
"warehouseId": 123,
"shipmentCountryCode": "<string>",
"shipmentName": "<string>",
"shipmentPhone": "<string>",
"shipmentStreet1": "<string>",
"shipmentStreet2": "<string>",
"shipmentState": "<string>",
"shipmentCity": "<string>",
"shipmentPostalCode": "<string>",
"shipmentServiceType": "<string>",
"shipmentFax": "<string>",
"shipmentEmail": "<string>",
"shipmentStreet3": "<string>"
},
"description": "<string>",
"remarks": "<string>",
"resendNumber": "INV-10042"
}
'import requests
url = "https://api.returnshelper.com/uat/user/api/Resend/createResend"
payload = {
"returnInventoryIdList": [123],
"resendShipment": {
"warehouseId": 123,
"shipmentCountryCode": "<string>",
"shipmentName": "<string>",
"shipmentPhone": "<string>",
"shipmentStreet1": "<string>",
"shipmentStreet2": "<string>",
"shipmentState": "<string>",
"shipmentCity": "<string>",
"shipmentPostalCode": "<string>",
"shipmentServiceType": "<string>",
"shipmentFax": "<string>",
"shipmentEmail": "<string>",
"shipmentStreet3": "<string>"
},
"description": "<string>",
"remarks": "<string>",
"resendNumber": "INV-10042"
}
headers = {
"x-rr-apikey": "<api-key>",
"x-rr-apitoken": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-rr-apikey': '<api-key>',
'x-rr-apitoken': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
returnInventoryIdList: [123],
resendShipment: {
warehouseId: 123,
shipmentCountryCode: '<string>',
shipmentName: '<string>',
shipmentPhone: '<string>',
shipmentStreet1: '<string>',
shipmentStreet2: '<string>',
shipmentState: '<string>',
shipmentCity: '<string>',
shipmentPostalCode: '<string>',
shipmentServiceType: '<string>',
shipmentFax: '<string>',
shipmentEmail: '<string>',
shipmentStreet3: '<string>'
},
description: '<string>',
remarks: '<string>',
resendNumber: 'INV-10042'
})
};
fetch('https://api.returnshelper.com/uat/user/api/Resend/createResend', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.returnshelper.com/uat/user/api/Resend/createResend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'returnInventoryIdList' => [
123
],
'resendShipment' => [
'warehouseId' => 123,
'shipmentCountryCode' => '<string>',
'shipmentName' => '<string>',
'shipmentPhone' => '<string>',
'shipmentStreet1' => '<string>',
'shipmentStreet2' => '<string>',
'shipmentState' => '<string>',
'shipmentCity' => '<string>',
'shipmentPostalCode' => '<string>',
'shipmentServiceType' => '<string>',
'shipmentFax' => '<string>',
'shipmentEmail' => '<string>',
'shipmentStreet3' => '<string>'
],
'description' => '<string>',
'remarks' => '<string>',
'resendNumber' => 'INV-10042'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-rr-apikey: <api-key>",
"x-rr-apitoken: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.returnshelper.com/uat/user/api/Resend/createResend"
payload := strings.NewReader("{\n \"returnInventoryIdList\": [\n 123\n ],\n \"resendShipment\": {\n \"warehouseId\": 123,\n \"shipmentCountryCode\": \"<string>\",\n \"shipmentName\": \"<string>\",\n \"shipmentPhone\": \"<string>\",\n \"shipmentStreet1\": \"<string>\",\n \"shipmentStreet2\": \"<string>\",\n \"shipmentState\": \"<string>\",\n \"shipmentCity\": \"<string>\",\n \"shipmentPostalCode\": \"<string>\",\n \"shipmentServiceType\": \"<string>\",\n \"shipmentFax\": \"<string>\",\n \"shipmentEmail\": \"<string>\",\n \"shipmentStreet3\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"resendNumber\": \"INV-10042\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-rr-apikey", "<api-key>")
req.Header.Add("x-rr-apitoken", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.returnshelper.com/uat/user/api/Resend/createResend")
.header("x-rr-apikey", "<api-key>")
.header("x-rr-apitoken", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"returnInventoryIdList\": [\n 123\n ],\n \"resendShipment\": {\n \"warehouseId\": 123,\n \"shipmentCountryCode\": \"<string>\",\n \"shipmentName\": \"<string>\",\n \"shipmentPhone\": \"<string>\",\n \"shipmentStreet1\": \"<string>\",\n \"shipmentStreet2\": \"<string>\",\n \"shipmentState\": \"<string>\",\n \"shipmentCity\": \"<string>\",\n \"shipmentPostalCode\": \"<string>\",\n \"shipmentServiceType\": \"<string>\",\n \"shipmentFax\": \"<string>\",\n \"shipmentEmail\": \"<string>\",\n \"shipmentStreet3\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"resendNumber\": \"INV-10042\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.returnshelper.com/uat/user/api/Resend/createResend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-rr-apikey"] = '<api-key>'
request["x-rr-apitoken"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"returnInventoryIdList\": [\n 123\n ],\n \"resendShipment\": {\n \"warehouseId\": 123,\n \"shipmentCountryCode\": \"<string>\",\n \"shipmentName\": \"<string>\",\n \"shipmentPhone\": \"<string>\",\n \"shipmentStreet1\": \"<string>\",\n \"shipmentStreet2\": \"<string>\",\n \"shipmentState\": \"<string>\",\n \"shipmentCity\": \"<string>\",\n \"shipmentPostalCode\": \"<string>\",\n \"shipmentServiceType\": \"<string>\",\n \"shipmentFax\": \"<string>\",\n \"shipmentEmail\": \"<string>\",\n \"shipmentStreet3\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"resendNumber\": \"INV-10042\"\n}"
response = http.request(request)
puts response.read_body{
"resendId": 123,
"resendNumber": "RSD221003-0000001"
}{
"correlationId": "<string>",
"meta": {
"status": 123,
"data": {},
"errorCode": "<string>",
"error": {}
}
}前提条件
- 対象在庫アイテムがアカウントに存在していること。
returnInventoryIdはnewInventoryCreatedwebhook イベントで配信されるため、自社側でキャッシュしてください。 - 同一の再送内のすべての在庫が 同じ倉庫 にあること。
- 各在庫の現在の
handlingStatusCodeが、ハンドリング状態機械上でrsd(再送)に進めるものであること——通常はohd(保留)状態である必要があります。 - いずれのアイテムのラインアイテムにも保留中の VAS が存在しないこと。
- 各在庫が物理的に在庫されていること(輸送中ではなく、他のアクティブなワークフローにも入っていない)。
- 宛先住所を準備しておくこと。
必須フィールド
resendShipment— 完全な Shipment ペイロード(宛先住所、連絡先、寸法、重量、サービスタイプ)。国コードは ISO3。warehouseIdは必須で、returnInventoryIdListに含まれるアイテムの倉庫と一致している必要があります(1 回の再送のすべてのアイテムは同じ倉庫に属します)。省略するとバリデーションに失敗します。- ペイロード内の
shipmentServiceTypeは Shipment Service Type(Return Service Type ではありません)— 有効なコードは Warehouse で利用可能な Shipment Service Types を取得 を参照してください。Return Service Type コードを渡すとバリデーションで失敗します。
returnInventoryIdList— 空でないList<long>。上限はResendConfig.groupResendMaxRmaCount(通常 1 桁。多数まとめたい場合はサポートにご相談ください)。
任意フィールド
description— 再送注文の自由記述の説明(最大 255 文字)。注文に保存され、再送注文の詳細を取得で返却されます。remarks— 再送注文のマーチャント向け備考(最大 5000 文字)。注文に保存され、再送注文の詳細を取得で返却されます。
resendNumber— 再送の独自参照番号:1〜50 文字で、英数字、-、_のみ使用できます。アカウント内で一意である必要があります:アカウント内の別の再送(キャンセル済みを含む)で使用済みの値は検証エラーになります。省略した場合は Return Helper が生成します。この値はレスポンスおよび再送ステータス更新 Webhook で返されます。
resendNumber は読み取り専用になります。 Return Helper がすべての再送で resendNumber を生成し、独自の参照番号は新しい任意フィールド sellerReferenceNumber に設定するようになります。resendNumber と異なり、sellerReferenceNumber は一意ではありません。Return Helper は重複した値を拒否しません。リトライ時に再送が重複して作成されるのを防ぐには、x-returnhelper-idempotency-key ヘッダーを送信してください。現在 resendNumber を設定している場合は、移行計画をご確認ください。副作用
- 各在庫の
handlingCodeがrsdに設定されます。 - ラベルが準備でき次第、倉庫が出荷します。
ラベル生成:自動 vs 手動サービスタイプ
再送がラベルを自動生成するかどうかは、resendShipment.shipmentServiceType に指定する shipment service type によって決まります。各 shipment service type は isEnableAutoCreateLabel フラグを持ちます——Warehouse で利用可能な Shipment Service Types を取得 から取得し、使用するコードの isEnableAutoCreateLabel を確認してください。
自動ラベル(isEnableAutoCreateLabel: true)
ラベルは作成後に非同期で生成されます。再送ステータスの流れは次のとおりです:
queued → label-success → completed(ラベル生成に失敗した場合は queued → failed)
再送は label-success の状態であり、かつ締め切り時刻より前の場合にのみ、再送注文をキャンセル からキャンセルできます。queued の間はラベルを生成中のため、キャンセルできません。
手動ラベル(isEnableAutoCreateLabel: false)
ラベルは自動生成されず、倉庫が再送を処理します。再送ステータスの流れは次のとおりです:
pending → in-progress → completed
再送が pending の状態であり、かつ締め切り時刻より前の場合に、再送注文をキャンセル からキャンセルできます。
キャンセル締め切り時刻
各再送にはキャンセル締め切り時刻があり、営業日の 08:00 UTC で、再送の作成時に設定されます。再送がキャンセル可能なステータス(自動ラベルはlabel-success、手動ラベルは pending)である限り、その締め切り時刻まではキャンセルできます。締め切り時刻を過ぎると、API ではキャンセルできなくなります。
冪等性
x-returnhelper-idempotency-key ヘッダーは任意です。付与しない呼び出しも通常どおり実行されますが、重複に対する保護はありません。冪等性を参照してください。
関連
- 再送注文の詳細を取得 — webhook がキャッシュされていない再送を参照した場合のみ呼び出してください。
- 再送注文をキャンセル — 倉庫が出荷する前に中止。
- すべての再送ステータスを取得 — コード → ラベルのマッピング。
- Webhooks —
labelGeneratedと再送ステータス更新イベントがライフサイクル変更をエンドポイントへ配信します。
承認
Your API key
Your API token — keep this private
ボディ
List of return inventory IDs for resend
Destination shipment address for the resend
Show child attributes
Show child attributes
Optional free-text description for the resend order. Stored against the order and returned by Get resend order details.
255Optional merchant remarks/notes for the resend order. Stored against the order and returned by Get resend order details.
5000Optional. Your own reference for this resend: 1-50 characters, letters, digits, - and _ only. A value already used on another resend in your account, including a cancelled one, fails validation. When omitted, Return Helper generates one. Planned change: this field will become read-only and generated by Return Helper; use sellerReferenceNumber instead once it is available. See the announcement.
50^[A-Za-z0-9_-]{1,50}$"INV-10042"