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