curl --request POST \
--url https://api.exowpee.com/v1/catalog/vendor-returns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vendor_id": "<string>",
"reference": "<string>",
"replacement_expected": true,
"items": [
{
"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"
payload = {
"vendor_id": "<string>",
"reference": "<string>",
"replacement_expected": True,
"items": [
{
"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({
vendor_id: '<string>',
reference: '<string>',
replacement_expected: true,
items: [
{
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', 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",
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([
'vendor_id' => '<string>',
'reference' => '<string>',
'replacement_expected' => true,
'items' => [
[
'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"
payload := strings.NewReader("{\n \"vendor_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"replacement_expected\": true,\n \"items\": [\n {\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 }\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vendor_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"replacement_expected\": true,\n \"items\": [\n {\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 }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/vendor-returns")
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 \"vendor_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"replacement_expected\": true,\n \"items\": [\n {\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 }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"vendor_id": "<string>",
"reference": "<string>",
"status": "<string>",
"replacement_expected": true,
"returned_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"items": [
{
"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": {}
}Create a vendor return
Starts a draft return of goods to a supplier, with its items.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/vendor-returns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"vendor_id": "<string>",
"reference": "<string>",
"replacement_expected": true,
"items": [
{
"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"
payload = {
"vendor_id": "<string>",
"reference": "<string>",
"replacement_expected": True,
"items": [
{
"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({
vendor_id: '<string>',
reference: '<string>',
replacement_expected: true,
items: [
{
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', 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",
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([
'vendor_id' => '<string>',
'reference' => '<string>',
'replacement_expected' => true,
'items' => [
[
'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"
payload := strings.NewReader("{\n \"vendor_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"replacement_expected\": true,\n \"items\": [\n {\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 }\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"vendor_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"replacement_expected\": true,\n \"items\": [\n {\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 }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/vendor-returns")
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 \"vendor_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"replacement_expected\": true,\n \"items\": [\n {\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 }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"vendor_id": "<string>",
"reference": "<string>",
"status": "<string>",
"replacement_expected": true,
"returned_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"items": [
{
"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.create
Conditions
- replacement_expected is required and true is refused: replacement tracking is not supported for supplier returns.
- The reference, when sent, must be unique among the company’s supplier returns. Deleted returns are removed for good, so their references can be reused.
- When items are sent, there must be at least one; each item must belong to the organization and appear only once.
- When stockable_unit_id is sent it must be a unit of that item; otherwise the base unit is used.
- 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 this supplier, beyond what other draft returns of the same supplier already reserve. Source quantities must add up to the item quantity.
- Creates the return in draft status with the items sent. Nothing leaves stock until it is confirmed.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Identifier of the supplier the goods go back to (27-character KSUID string). Required when creating; it must be a supplier of the current company. Not accepted when changing a return.
Free reference of the return. Up to 255 characters, unique among the company's supplier returns.
255Whether a replacement is expected. Required when creating. Only false is accepted: replacement tracking is not supported for supplier returns.
Lines of the return. Optional when creating, at least one if sent; not accepted when changing a return (use the items routes).
1Show child attributes
Show child attributes
Response
VendorReturnResource
Identifier of the supplier return (27-character KSUID string).
Identifier of the supplier the goods go back to.
Free reference of the return, unique among the company's supplier returns.
Lifecycle status: draft while it can still be edited or deleted, confirmed once the goods have left stock.
Whether a replacement was expected. Always false today: replacement tracking is not supported.
Date and time the return was confirmed (ISO 8601); null while it is a draft.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Lines of the return, when loaded (they are on the show, create, update and confirm answers and on each item of the list).
Show child attributes
Show child attributes