Create VAS by return inventory ID
curl --request POST \
--url https://api.returnshelper.com/uat/user/api/Vas/CreateByReturnInventoryId \
--header 'Content-Type: application/json' \
--header 'x-rr-apikey: <api-key>' \
--header 'x-rr-apitoken: <api-key>' \
--data '
{
"createVasList": [
{
"returnInventoryId": "<string>",
"createVasDetailList": [
{
"vasCode": "<string>",
"notes": "<string>",
"metaQuantity": 123,
"vasFileList": [
{
"filename": "<string>",
"fileKey": "<string>"
}
]
}
]
}
]
}
'import requests
url = "https://api.returnshelper.com/uat/user/api/Vas/CreateByReturnInventoryId"
payload = { "createVasList": [
{
"returnInventoryId": "<string>",
"createVasDetailList": [
{
"vasCode": "<string>",
"notes": "<string>",
"metaQuantity": 123,
"vasFileList": [
{
"filename": "<string>",
"fileKey": "<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({
createVasList: [
{
returnInventoryId: '<string>',
createVasDetailList: [
{
vasCode: '<string>',
notes: '<string>',
metaQuantity: 123,
vasFileList: [{filename: '<string>', fileKey: '<string>'}]
}
]
}
]
})
};
fetch('https://api.returnshelper.com/uat/user/api/Vas/CreateByReturnInventoryId', 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/Vas/CreateByReturnInventoryId",
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([
'createVasList' => [
[
'returnInventoryId' => '<string>',
'createVasDetailList' => [
[
'vasCode' => '<string>',
'notes' => '<string>',
'metaQuantity' => 123,
'vasFileList' => [
[
'filename' => '<string>',
'fileKey' => '<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/Vas/CreateByReturnInventoryId"
payload := strings.NewReader("{\n \"createVasList\": [\n {\n \"returnInventoryId\": \"<string>\",\n \"createVasDetailList\": [\n {\n \"vasCode\": \"<string>\",\n \"notes\": \"<string>\",\n \"metaQuantity\": 123,\n \"vasFileList\": [\n {\n \"filename\": \"<string>\",\n \"fileKey\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\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/Vas/CreateByReturnInventoryId")
.header("x-rr-apikey", "<api-key>")
.header("x-rr-apitoken", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"createVasList\": [\n {\n \"returnInventoryId\": \"<string>\",\n \"createVasDetailList\": [\n {\n \"vasCode\": \"<string>\",\n \"notes\": \"<string>\",\n \"metaQuantity\": 123,\n \"vasFileList\": [\n {\n \"filename\": \"<string>\",\n \"fileKey\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.returnshelper.com/uat/user/api/Vas/CreateByReturnInventoryId")
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 \"createVasList\": [\n {\n \"returnInventoryId\": \"<string>\",\n \"createVasDetailList\": [\n {\n \"vasCode\": \"<string>\",\n \"notes\": \"<string>\",\n \"metaQuantity\": 123,\n \"vasFileList\": [\n {\n \"filename\": \"<string>\",\n \"fileKey\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"returnRequestLineItemId": 123,
"createVasDetailList": [
{}
]
}
]
}{
"correlationId": "<string>",
"meta": {
"status": 123,
"data": {},
"errorCode": "<string>",
"error": {}
}
}增值服務
依 Return Inventory ID 建立 VAS
Create value-added service requests for one or more return inventories. Inventory must be set to On-hold handling before creating VAS. Split parcel VAS must be submitted separately from other VAS types.
POST
/
api
/
Vas
/
CreateByReturnInventoryId
Create VAS by return inventory ID
curl --request POST \
--url https://api.returnshelper.com/uat/user/api/Vas/CreateByReturnInventoryId \
--header 'Content-Type: application/json' \
--header 'x-rr-apikey: <api-key>' \
--header 'x-rr-apitoken: <api-key>' \
--data '
{
"createVasList": [
{
"returnInventoryId": "<string>",
"createVasDetailList": [
{
"vasCode": "<string>",
"notes": "<string>",
"metaQuantity": 123,
"vasFileList": [
{
"filename": "<string>",
"fileKey": "<string>"
}
]
}
]
}
]
}
'import requests
url = "https://api.returnshelper.com/uat/user/api/Vas/CreateByReturnInventoryId"
payload = { "createVasList": [
{
"returnInventoryId": "<string>",
"createVasDetailList": [
{
"vasCode": "<string>",
"notes": "<string>",
"metaQuantity": 123,
"vasFileList": [
{
"filename": "<string>",
"fileKey": "<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({
createVasList: [
{
returnInventoryId: '<string>',
createVasDetailList: [
{
vasCode: '<string>',
notes: '<string>',
metaQuantity: 123,
vasFileList: [{filename: '<string>', fileKey: '<string>'}]
}
]
}
]
})
};
fetch('https://api.returnshelper.com/uat/user/api/Vas/CreateByReturnInventoryId', 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/Vas/CreateByReturnInventoryId",
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([
'createVasList' => [
[
'returnInventoryId' => '<string>',
'createVasDetailList' => [
[
'vasCode' => '<string>',
'notes' => '<string>',
'metaQuantity' => 123,
'vasFileList' => [
[
'filename' => '<string>',
'fileKey' => '<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/Vas/CreateByReturnInventoryId"
payload := strings.NewReader("{\n \"createVasList\": [\n {\n \"returnInventoryId\": \"<string>\",\n \"createVasDetailList\": [\n {\n \"vasCode\": \"<string>\",\n \"notes\": \"<string>\",\n \"metaQuantity\": 123,\n \"vasFileList\": [\n {\n \"filename\": \"<string>\",\n \"fileKey\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\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/Vas/CreateByReturnInventoryId")
.header("x-rr-apikey", "<api-key>")
.header("x-rr-apitoken", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"createVasList\": [\n {\n \"returnInventoryId\": \"<string>\",\n \"createVasDetailList\": [\n {\n \"vasCode\": \"<string>\",\n \"notes\": \"<string>\",\n \"metaQuantity\": 123,\n \"vasFileList\": [\n {\n \"filename\": \"<string>\",\n \"fileKey\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.returnshelper.com/uat/user/api/Vas/CreateByReturnInventoryId")
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 \"createVasList\": [\n {\n \"returnInventoryId\": \"<string>\",\n \"createVasDetailList\": [\n {\n \"vasCode\": \"<string>\",\n \"notes\": \"<string>\",\n \"metaQuantity\": 123,\n \"vasFileList\": [\n {\n \"filename\": \"<string>\",\n \"fileKey\": \"<string>\"\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"returnRequestLineItemId": 123,
"createVasDetailList": [
{}
]
}
]
}{
"correlationId": "<string>",
"meta": {
"status": 123,
"data": {},
"errorCode": "<string>",
"error": {}
}
}此頁面由 AI 自動翻譯。API 技術規格以英文呈現為標準。如有任何疑問,請參閱英文版本。
前置條件
- 目標庫存項已存在於您的帳戶。
returnInventoryId由newInventoryCreatedwebhook 事件推送——請在自有端快取。 - 每筆目標庫存的
handlingCode必須為ohd(暫存)。VAS 僅在庫存為暫存時允許;若已進入其他處理路徑,請先透過 更新退件庫存處理 移回ohd。 - 從 取得所有 VAS 選擇有效的
vasCode。
必填欄位
createVasList— 非空 payload 列表。每個 payload 對應一筆庫存與一項或多項 VAS 請求。
returnInventoryId— 字串,必須可解析為 long;必須存在且為暫存狀態。createVasDetailList— VAS 明細物件列表,每項含vasCode與該 VAS 專屬欄位。
returnInventoryId 必須唯一——同一呼叫中不可對同一庫存建立兩個 payload。
拆分包裹規則
若任一 payload 中的 VAS 使用vasCode: SPLIT_PARCEL:
- 該 VAS 必須是該 payload
createVasDetailList中的唯一一項(不能與其他 VAS 同 payload 同庫存併用)。 - 僅
SPLIT_PARCEL允許(且通常需要)檔案附件。其他 VAS 代碼不可附件。
副作用
- VAS 處理期間,庫存的處理保持在
ohd。 - 後續 webhook 事件會回報進度:
vasUpdated,以及拆分包裹時的splitLineItem與newInventoryCreated(針對拆分件)。 - 拆分包裹 VAS 完成時,可能產生額外的庫存紀錄(拆分後的物品)。
相關
- 取得所有 VAS — 有效的
vasCode值。 - 取得所有 VAS 狀態 — VAS 生命週期的代碼至標籤對映。
- 更新退件庫存處理 — 若庫存已離開
ohd,將其移回。 - Webhooks —
vasUpdated事件會將 VAS 生命週期推送至您的端點。
⌘I