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 payload(目的地址、聯絡人、尺寸、重量、服務類型)。國家代碼為 ISO3。warehouseId為必填,且必須與returnInventoryIdList中各項目所屬的倉庫相同(同一次補寄的所有項目共用同一倉庫)。省略將導致驗證失敗。- payload 內的
shipmentServiceType是 Shipment Service Type(不是 Return Service Type)— 有效代碼請見 取得 Warehouse 可用的 Shipment Service Types。傳入 Return Service Type 代碼會在驗證階段失敗。
returnInventoryIdList— 非空List<long>。上限為ResendConfig.groupResendMaxRmaCount(通常為個位數;如需打包更多請聯絡客服)。
選填欄位
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"