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"