curl --request PUT \
--url https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/items/{item} \
--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/{item}"
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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
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/{item}', 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/{item}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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/{item}"
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("PUT", 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.put("https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/items/{item}")
.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/{item}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.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": {}
}Edit a damaged item
Changes the quantity or source of an item on a draft damage record.
curl --request PUT \
--url https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/items/{item} \
--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/{item}"
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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
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/{item}', 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/{item}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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/{item}"
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("PUT", 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.put("https://api.exowpee.com/v1/catalog/inventory-damages/{inventory_damage}/items/{item}")
.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/{item}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.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.update
Conditions
- Only a draft record can be changed: a confirmed record is refused (409).
- stockable_id cannot be changed: it is refused on update.
- When stock_sources is sent it replaces the whole list and needs at least one source; the quantity is recomputed as the sum of the source quantities.
- The new sources are checked against available stock, ignoring this item’s own reservation.
- Replaces the unit and sources of the item and resets cost_total to 0.
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).
Identifier of the reception line (not the purchase line) of the delivery or pickup named in the path (27-character KSUID). It must belong to that reception.
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).