curl --request POST \
--url https://api.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"stockable_id": "<string>",
"quantity": 123,
"stockable_unit_id": "<string>",
"stock_sources": [
{
"quantity": 123,
"asset_id": "<string>",
"group_id": "<string>"
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items"
payload = {
"stockable_id": "<string>",
"quantity": 123,
"stockable_unit_id": "<string>",
"stock_sources": [
{
"quantity": 123,
"asset_id": "<string>",
"group_id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
stockable_id: '<string>',
quantity: 123,
stockable_unit_id: '<string>',
stock_sources: [{quantity: 123, asset_id: '<string>', group_id: '<string>'}]
})
};
fetch('https://api.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items', 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.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items",
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([
'stockable_id' => '<string>',
'quantity' => 123,
'stockable_unit_id' => '<string>',
'stock_sources' => [
[
'quantity' => 123,
'asset_id' => '<string>',
'group_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items"
payload := strings.NewReader("{\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"return_id": "<string>",
"stockable_id": "<string>",
"stockable_unit_id": "<string>",
"stock_sources": "<array>",
"quantity": 123,
"cost_total": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Add an item to a vendor return
Adds a product line to a draft return to a supplier.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"stockable_id": "<string>",
"quantity": 123,
"stockable_unit_id": "<string>",
"stock_sources": [
{
"quantity": 123,
"asset_id": "<string>",
"group_id": "<string>"
}
]
}
'import requests
url = "https://api.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items"
payload = {
"stockable_id": "<string>",
"quantity": 123,
"stockable_unit_id": "<string>",
"stock_sources": [
{
"quantity": 123,
"asset_id": "<string>",
"group_id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
stockable_id: '<string>',
quantity: 123,
stockable_unit_id: '<string>',
stock_sources: [{quantity: 123, asset_id: '<string>', group_id: '<string>'}]
})
};
fetch('https://api.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items', 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.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items",
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([
'stockable_id' => '<string>',
'quantity' => 123,
'stockable_unit_id' => '<string>',
'stock_sources' => [
[
'quantity' => 123,
'asset_id' => '<string>',
'group_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items"
payload := strings.NewReader("{\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/vendor-returns/{vendor_return}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stockable_id\": \"<string>\",\n \"quantity\": 123,\n \"stockable_unit_id\": \"<string>\",\n \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"return_id": "<string>",
"stockable_id": "<string>",
"stockable_unit_id": "<string>",
"stock_sources": "<array>",
"quantity": 123,
"cost_total": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}vendor_returns.update, vendor_return_items.create
Conditions
- Both vendor_return_items.create and vendor_returns.update are needed.
- The supplier return must still be a draft.
- stockable_id is required, must belong to the organization and cannot already be on this return.
- stockable_unit_id, when sent, must be a unit of that item.
- For a stock-tracked item, stock_sources are required; for an untracked one they are refused. Each source names either an asset or a group, may not repeat, must be eligible for the company, and must hold stock tagged with the return’s supplier beyond what other drafts of that supplier reserve. Source quantities must add up to the quantity.
- Adds the line with a cost_total of 0. Stock does not move until the return is confirmed.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the vendor return (27-character KSUID string).
Body
Identifier of the item returned. Required when adding a line; it must belong to the organization and not already be on the return. Not accepted when changing a line.
Quantity returned, in the chosen unit, above zero. Required when adding a line.
Unit the quantity is expressed in; it must be a unit of that item. When adding, the base unit is used if omitted; when changing, omitting it keeps the current unit.
Stock the goods are taken from. Required for a stock-tracked item and refused for an untracked one; the quantities must add up to quantity. When changing a line, omitting it keeps the current sources.
Show child attributes
Show child attributes
Response
VendorReturnItemResource
Identifier of the return line (27-character KSUID string).
Identifier of the supplier return the line belongs to.
Identifier of the item returned.
Identifier of the unit the quantity is expressed in; null when the base unit is used.
Where the goods are taken from: a list of {quantity, asset_id} or {quantity, group_id}. Empty for a item that is not stock-tracked.
Quantity returned, in the line's unit.
Inventory cost of the stock that left when the return was confirmed in major units (the minor-unit amount divided by 10 to the power currency_exponent). 0 while the return is a draft and for untracked lines.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).