curl --request POST \
--url https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"stockable_id": "<string>",
"stock_sources": [
{
"quantity": 123,
"asset_id": "<string>",
"group_id": "<string>"
}
],
"stockable_unit_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/items"
payload = {
"stockable_id": "<string>",
"stock_sources": [
{
"quantity": 123,
"asset_id": "<string>",
"group_id": "<string>"
}
],
"stockable_unit_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>',
stock_sources: [{quantity: 123, asset_id: '<string>', group_id: '<string>'}],
stockable_unit_id: '<string>'
})
};
fetch('https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/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/inventory-damages/{inventory_damage}/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>',
'stock_sources' => [
[
'quantity' => 123,
'asset_id' => '<string>',
'group_id' => '<string>'
]
],
'stockable_unit_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/inventory-damages/{inventory_damage}/items"
payload := strings.NewReader("{\n \"stockable_id\": \"<string>\",\n \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ],\n \"stockable_unit_id\": \"<string>\"\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/inventory-damages/{inventory_damage}/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stockable_id\": \"<string>\",\n \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ],\n \"stockable_unit_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/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 \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ],\n \"stockable_unit_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"inventory_damage_id": "<string>",
"stockable_id": "<string>",
"stockable_unit_id": "<string>",
"quantity": 123,
"stock_sources": "<array>",
"cost_total": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Add a damaged item
Adds an item and quantity to a draft damage record.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"stockable_id": "<string>",
"stock_sources": [
{
"quantity": 123,
"asset_id": "<string>",
"group_id": "<string>"
}
],
"stockable_unit_id": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/items"
payload = {
"stockable_id": "<string>",
"stock_sources": [
{
"quantity": 123,
"asset_id": "<string>",
"group_id": "<string>"
}
],
"stockable_unit_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>',
stock_sources: [{quantity: 123, asset_id: '<string>', group_id: '<string>'}],
stockable_unit_id: '<string>'
})
};
fetch('https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/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/inventory-damages/{inventory_damage}/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>',
'stock_sources' => [
[
'quantity' => 123,
'asset_id' => '<string>',
'group_id' => '<string>'
]
],
'stockable_unit_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/inventory-damages/{inventory_damage}/items"
payload := strings.NewReader("{\n \"stockable_id\": \"<string>\",\n \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ],\n \"stockable_unit_id\": \"<string>\"\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/inventory-damages/{inventory_damage}/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stockable_id\": \"<string>\",\n \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ],\n \"stockable_unit_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/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 \"stock_sources\": [\n {\n \"quantity\": 123,\n \"asset_id\": \"<string>\",\n \"group_id\": \"<string>\"\n }\n ],\n \"stockable_unit_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"inventory_damage_id": "<string>",
"stockable_id": "<string>",
"stockable_unit_id": "<string>",
"quantity": 123,
"stock_sources": "<array>",
"cost_total": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}inventory_damages.update, inventory_damage_items.create
Conditions
- Only a draft record can be changed: a confirmed record is refused (409).
- stockable_id is required and cannot already exist as an item of the same record.
- The item must be tracked in inventory, and the unit and stock sources follow the same rules as when creating a record.
- The declared quantity cannot exceed the stock available at the sources, after the quantities reserved by other draft damage records.
- Adds an item with cost_total 0; stock does not move until the record is confirmed.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the damage record (27-character KSUID).
Body
Identifier of the inventory-tracked item that is damaged (27-character KSUID). Required when adding an item and unique within the record. Not accepted: on update the damaged item stays the one named in the URL.
Stock sources the damaged quantity is taken from. Each source names exactly one location (asset_id) or lot group (group_id) and a quantity; at least one source is required. On update, when sent it replaces all the existing sources.
1Show child attributes
Show child attributes
Optional unit in which the source quantities are expressed; when omitted on creation the base unit is used. On update, omitting it keeps the current unit.
Response
InventoryDamageItemResource
Identifier of the item (27-character KSUID).
Identifier of the damage record the item belongs to.
Identifier of the damaged item.
Unit in which the quantity is expressed; null when it is in the base unit.
Damaged quantity in the item's unit, the sum of the source quantities.
Sources the quantity is taken from, as a list of objects with quantity and either asset_id or group_id.
Cost of the lost stock in major units of the company currency. It is 0 until the record is confirmed, then the cost of the lots removed.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).