curl --request POST \
--url https://api.returnshelper.com/uat/user/api/Resend/createResendBySku \
--header 'Content-Type: application/json' \
--header 'x-rr-apikey: <api-key>' \
--header 'x-rr-apitoken: <api-key>' \
--data '
{
"warehouseId": 123,
"shipmentServiceType": "<string>",
"itemList": [
{
"sku": "<string>",
"quantity": 123
}
],
"toAddress": {
"contactName": "<string>",
"street1": "<string>",
"street2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"phone": "<string>",
"addressType": "<string>",
"street3": "<string>",
"fax": "<string>",
"email": "<string>"
},
"sellerReferenceNumber": "<string>",
"description": "<string>",
"remarks": "<string>",
"warehouseRemarks": "<string>"
}
'import requests
url = "https://api.returnshelper.com/uat/user/api/Resend/createResendBySku"
payload = {
"warehouseId": 123,
"shipmentServiceType": "<string>",
"itemList": [
{
"sku": "<string>",
"quantity": 123
}
],
"toAddress": {
"contactName": "<string>",
"street1": "<string>",
"street2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"phone": "<string>",
"addressType": "<string>",
"street3": "<string>",
"fax": "<string>",
"email": "<string>"
},
"sellerReferenceNumber": "<string>",
"description": "<string>",
"remarks": "<string>",
"warehouseRemarks": "<string>"
}
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({
warehouseId: 123,
shipmentServiceType: '<string>',
itemList: [{sku: '<string>', quantity: 123}],
toAddress: {
contactName: '<string>',
street1: '<string>',
street2: '<string>',
city: '<string>',
state: '<string>',
postalCode: '<string>',
country: '<string>',
phone: '<string>',
addressType: '<string>',
street3: '<string>',
fax: '<string>',
email: '<string>'
},
sellerReferenceNumber: '<string>',
description: '<string>',
remarks: '<string>',
warehouseRemarks: '<string>'
})
};
fetch('https://api.returnshelper.com/uat/user/api/Resend/createResendBySku', 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/createResendBySku",
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([
'warehouseId' => 123,
'shipmentServiceType' => '<string>',
'itemList' => [
[
'sku' => '<string>',
'quantity' => 123
]
],
'toAddress' => [
'contactName' => '<string>',
'street1' => '<string>',
'street2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postalCode' => '<string>',
'country' => '<string>',
'phone' => '<string>',
'addressType' => '<string>',
'street3' => '<string>',
'fax' => '<string>',
'email' => '<string>'
],
'sellerReferenceNumber' => '<string>',
'description' => '<string>',
'remarks' => '<string>',
'warehouseRemarks' => '<string>'
]),
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/createResendBySku"
payload := strings.NewReader("{\n \"warehouseId\": 123,\n \"shipmentServiceType\": \"<string>\",\n \"itemList\": [\n {\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"toAddress\": {\n \"contactName\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"addressType\": \"<string>\",\n \"street3\": \"<string>\",\n \"fax\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"sellerReferenceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"warehouseRemarks\": \"<string>\"\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/createResendBySku")
.header("x-rr-apikey", "<api-key>")
.header("x-rr-apitoken", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"warehouseId\": 123,\n \"shipmentServiceType\": \"<string>\",\n \"itemList\": [\n {\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"toAddress\": {\n \"contactName\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"addressType\": \"<string>\",\n \"street3\": \"<string>\",\n \"fax\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"sellerReferenceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"warehouseRemarks\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.returnshelper.com/uat/user/api/Resend/createResendBySku")
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 \"warehouseId\": 123,\n \"shipmentServiceType\": \"<string>\",\n \"itemList\": [\n {\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"toAddress\": {\n \"contactName\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"addressType\": \"<string>\",\n \"street3\": \"<string>\",\n \"fax\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"sellerReferenceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"warehouseRemarks\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"resendId": 123,
"resendNumber": "<string>",
"resendShipmentId": 123,
"sellerReferenceNumber": "<string>",
"selectedReturnInventoryList": [
{
"returnInventoryId": 123,
"rmaCode": "<string>",
"sku": "<string>"
}
]
}
}{
"correlationId": "<string>",
"meta": {
"status": 123,
"data": {},
"errorCode": "<string>",
"error": {}
}
}SKU で Resend を作成
Enterprise-only. Creates a resend by supplying warehouse-scoped SKU quantities instead of explicit return inventory IDs. The service selects eligible pending return inventory records itself (LIFO by default), then reuses the standard create-resend workflow. The whole request is processed atomically — either every requested unit is allocated and one resend is created, or nothing is.
curl --request POST \
--url https://api.returnshelper.com/uat/user/api/Resend/createResendBySku \
--header 'Content-Type: application/json' \
--header 'x-rr-apikey: <api-key>' \
--header 'x-rr-apitoken: <api-key>' \
--data '
{
"warehouseId": 123,
"shipmentServiceType": "<string>",
"itemList": [
{
"sku": "<string>",
"quantity": 123
}
],
"toAddress": {
"contactName": "<string>",
"street1": "<string>",
"street2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"phone": "<string>",
"addressType": "<string>",
"street3": "<string>",
"fax": "<string>",
"email": "<string>"
},
"sellerReferenceNumber": "<string>",
"description": "<string>",
"remarks": "<string>",
"warehouseRemarks": "<string>"
}
'import requests
url = "https://api.returnshelper.com/uat/user/api/Resend/createResendBySku"
payload = {
"warehouseId": 123,
"shipmentServiceType": "<string>",
"itemList": [
{
"sku": "<string>",
"quantity": 123
}
],
"toAddress": {
"contactName": "<string>",
"street1": "<string>",
"street2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"phone": "<string>",
"addressType": "<string>",
"street3": "<string>",
"fax": "<string>",
"email": "<string>"
},
"sellerReferenceNumber": "<string>",
"description": "<string>",
"remarks": "<string>",
"warehouseRemarks": "<string>"
}
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({
warehouseId: 123,
shipmentServiceType: '<string>',
itemList: [{sku: '<string>', quantity: 123}],
toAddress: {
contactName: '<string>',
street1: '<string>',
street2: '<string>',
city: '<string>',
state: '<string>',
postalCode: '<string>',
country: '<string>',
phone: '<string>',
addressType: '<string>',
street3: '<string>',
fax: '<string>',
email: '<string>'
},
sellerReferenceNumber: '<string>',
description: '<string>',
remarks: '<string>',
warehouseRemarks: '<string>'
})
};
fetch('https://api.returnshelper.com/uat/user/api/Resend/createResendBySku', 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/createResendBySku",
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([
'warehouseId' => 123,
'shipmentServiceType' => '<string>',
'itemList' => [
[
'sku' => '<string>',
'quantity' => 123
]
],
'toAddress' => [
'contactName' => '<string>',
'street1' => '<string>',
'street2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postalCode' => '<string>',
'country' => '<string>',
'phone' => '<string>',
'addressType' => '<string>',
'street3' => '<string>',
'fax' => '<string>',
'email' => '<string>'
],
'sellerReferenceNumber' => '<string>',
'description' => '<string>',
'remarks' => '<string>',
'warehouseRemarks' => '<string>'
]),
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/createResendBySku"
payload := strings.NewReader("{\n \"warehouseId\": 123,\n \"shipmentServiceType\": \"<string>\",\n \"itemList\": [\n {\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"toAddress\": {\n \"contactName\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"addressType\": \"<string>\",\n \"street3\": \"<string>\",\n \"fax\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"sellerReferenceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"warehouseRemarks\": \"<string>\"\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/createResendBySku")
.header("x-rr-apikey", "<api-key>")
.header("x-rr-apitoken", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"warehouseId\": 123,\n \"shipmentServiceType\": \"<string>\",\n \"itemList\": [\n {\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"toAddress\": {\n \"contactName\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"addressType\": \"<string>\",\n \"street3\": \"<string>\",\n \"fax\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"sellerReferenceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"warehouseRemarks\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.returnshelper.com/uat/user/api/Resend/createResendBySku")
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 \"warehouseId\": 123,\n \"shipmentServiceType\": \"<string>\",\n \"itemList\": [\n {\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ],\n \"toAddress\": {\n \"contactName\": \"<string>\",\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"country\": \"<string>\",\n \"phone\": \"<string>\",\n \"addressType\": \"<string>\",\n \"street3\": \"<string>\",\n \"fax\": \"<string>\",\n \"email\": \"<string>\"\n },\n \"sellerReferenceNumber\": \"<string>\",\n \"description\": \"<string>\",\n \"remarks\": \"<string>\",\n \"warehouseRemarks\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"resendId": 123,
"resendNumber": "<string>",
"resendShipmentId": 123,
"sellerReferenceNumber": "<string>",
"selectedReturnInventoryList": [
{
"returnInventoryId": 123,
"rmaCode": "<string>",
"sku": "<string>"
}
]
}
}{
"correlationId": "<string>",
"meta": {
"status": 123,
"data": {},
"errorCode": "<string>",
"error": {}
}
}Create resend order ではなく本エンドポイントを使う場合
- SKU と数量で在庫を管理しており、個々の
returnInventoryId値を扱いたくない場合は、SKU で Resend を作成を使用します。 - resend したい特定の
returnInventoryId値をすでに保持している場合(例:newInventoryCreatedwebhook からキャッシュ)は、Create resend order を使用します。
前提条件
- アカウントで SKU 在庫モジュール(Enterprise)が有効になっている。
- その倉庫に、要求された各 SKU について resend 対象として十分な在庫がある。まず SKU 在庫を検索(
availableQuantity)でサマリーを確認してください。ただし、サマリーチェックの通過は保証ではありません(下記参照)。 shipmentServiceTypeは Shipment Service Type(Return Service Type ではありません)。有効なコードは Warehouse で利用可能な Shipment Service Types を取得 から取得してください。
選択の仕組み
割り当ては 3 段階で行われ、権威を持つのは最後の段階のみです。- 検証。 リクエスト行が正規化され(SKU の trim + 大文字化)、重複する SKU が結合されます。検証は
warehouseId+ 正規化後 SKU ごとにavailableQuantityをチェックします。これを通過しても、サマリー上十分に見えることを確認するだけで、何も予約・割り当てされません。 - 選択。 システムは
warehouseIdと正規化 SKU に一致し、resend 対象となる実際の返品在庫レコードを照会し、ピックアップ戦略に従って要求された数量をちょうど選択します。対象レコードが要求数より少ない場合、リクエスト全体が拒否されます。 - 割り当て。 トランザクション内で、選択された行をロックして再チェックします。いずれかが対象外になっていればトランザクションをロールバックし、リクエストが失敗します。そうでなければ、選択されたすべてのレコードが resend / in-progress に進められ、同じトランザクション内で resend が作成されます。
SkuInventory.availableQuantity は事前チェックであり、予約ではありません。 複数の並行リクエストが同じサマリーチェックを通過し得ますが、基礎レコードのロードとロックに成功したリクエストのみがコミットします。他は検証エラーで失敗し、再試行できます。ロックされた割り当てが常に最終的な権威です。対象条件
返品在庫レコードは、次の条件をすべて満たす場合にのみ選択対象になります。- 要求された
warehouseIdと正規化後 SKU に一致する。 handlingStatusCode= pending。- resend / in-progress に遷移できる。かつ
- 保留中の VAS がない(未完了の VAS Split を含む)。
availableQuantity より少なくなることがあります(後者は保留中の VAS を持つレコードを数える場合があります)。その場合、対象外の項目を resend するのではなく、リクエストは fail-closed で失敗します。
ピックアップ戦略
選択はデフォルトで LIFO を使用します。対象となる返品在庫のうち最新のものを優先し、タイブレークには最大の返品在庫 ID を用います。この戦略はファクトリの背後に置かれており、割り当てロジックを変更せずに将来 FIFO に切り替えられます。エラーと再試行
- 検証失敗は HTTP 200 と
meta.status: 400で返されます(標準のソフトエラーエンベロープ。エラー処理を参照)。 - ある SKU の可用量が不足している場合、リクエストは全体として拒否されます。セキュリティのため、エラーは残りの可用量を開示しません。
- 並行リクエストが同じ在庫を奪い合う場合、レコードのロックに失敗したリクエストは拒否され、再試行できます。
冪等性
x-returnhelper-idempotency-key ヘッダーは任意です。付与しない呼び出しも通常どおり実行されますが、重複に対する保護はありません。冪等性を参照してください。
関連
- SKU 在庫を検索 — リクエスト前に
availableQuantityを確認します。 - Create resend order — 明示的な返品在庫 ID で resend します。ラベル生成(自動 vs 手動サービスタイプ)とキャンセル締切もカバーしており、ここで作成される resend にも適用されます。
- Resend Order をキャンセル — 倉庫が出荷する前に中止します。
- Webhooks — resend-status-update イベントがライフサイクルの変更をエンドポイントに配信します。
承認
Your API key
Your API token — keep this private
ボディ
Create a resend by warehouse-scoped SKU quantities. companyName is not part of this request.
Warehouse to fulfil the resend from. Must be greater than 0 and owned by the authenticated account. All selected inventory comes from this single warehouse.
Shipment service type code (not a return service type). Non-others values are validated against the available shipment service and service zone for the warehouse and destination.
Non-empty list of SKU + quantity lines. The number of raw lines is limited to 100; the combined quantity across all lines is limited to 100.
Show child attributes
Show child attributes
Destination address for the resend shipment.
Show child attributes
Show child attributes
Optional seller reference number. When provided, 1-50 characters with no invisible characters. Stored on the created resend shipment and echoed back in the response.
50Optional free-text description for the resend order.
Optional free-text merchant remarks for the resend order.
Optional free-text remarks addressed to the warehouse.
レスポンス
Success
Wraps CreateResendBySkuReply under data, alongside the standard correlationId and meta envelope.
Create resend by SKU result.
Show child attributes
Show child attributes