curl --request POST \
--url https://api.exowpee.com/v1/catalog/inventory-damages/{inventoryDamage}/confirm \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/inventory-damages/{inventoryDamage}/confirm"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/catalog/inventory-damages/{inventoryDamage}/confirm', 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/{inventoryDamage}/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/inventory-damages/{inventoryDamage}/confirm"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/{inventoryDamage}/confirm")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/inventory-damages/{inventoryDamage}/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"purchase_id": "<string>",
"purchase_reception_id": "<string>",
"reference": "<string>",
"status": "<string>",
"damage_reason": "<string>",
"confirmed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"items": [
{
"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"
}
]
}Confirm a damage record
Confirms a damage declaration and removes the damaged quantities from stock.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/inventory-damages/{inventoryDamage}/confirm \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/catalog/inventory-damages/{inventoryDamage}/confirm"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/catalog/inventory-damages/{inventoryDamage}/confirm', 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/{inventoryDamage}/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/catalog/inventory-damages/{inventoryDamage}/confirm"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/{inventoryDamage}/confirm")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/inventory-damages/{inventoryDamage}/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"purchase_id": "<string>",
"purchase_reception_id": "<string>",
"reference": "<string>",
"status": "<string>",
"damage_reason": "<string>",
"confirmed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"items": [
{
"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"
}
]
}inventory_damages.confirm
Conditions
- Only a draft can be confirmed; a record already confirmed is refused (409).
- The record must still have at least one item, otherwise 409.
- A record tied to a purchase or reception is checked again: the reception must still be confirmed.
- Every item and stock source is validated again against the stock available at confirmation time, so a draft that was valid when created can be refused with 422 if the stock has since dropped.
- Removes the declared quantities from stock, oldest lots first within each source, and records the movements in the stock history under the inventory_damage operation.
- Stores on each item the cost of the lots removed in cost_total, in minor units internally (returned in major units).
- Sets the status to confirmed and fills confirmed_at.
- No accounting entry is created by this action in the code.
- The record cannot be edited or deleted afterwards.
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).
Response
InventoryDamageResource
Identifier of the damage record (27-character KSUID).
Purchase the damage is tied to; null when the record has no purchase origin.
Purchase reception the damage is tied to; null when the record has no reception origin.
Free reference of the record; null when none was given.
State of the record: draft (editable, no stock moved) or confirmed (stock removed, no more changes).
Reason of the damage: ordinary or exceptional.
Date and time of confirmation (ISO 8601); null while the record is a draft.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Damaged items of the record.
Show child attributes
Show child attributes