curl --request POST \
--url https://api.exowpee.com/v1/catalog/purchase-deliveries/{purchase_delivery}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset_id": "<string>",
"item_id": "<string>",
"quantity": 123,
"damaged_quantity": 123,
"damage_stockable_unit_id": "<string>",
"cost_total": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/catalog/purchase-deliveries/{purchase_delivery}/items"
payload = {
"asset_id": "<string>",
"item_id": "<string>",
"quantity": 123,
"damaged_quantity": 123,
"damage_stockable_unit_id": "<string>",
"cost_total": "<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({
asset_id: '<string>',
item_id: '<string>',
quantity: 123,
damaged_quantity: 123,
damage_stockable_unit_id: '<string>',
cost_total: '<string>'
})
};
fetch('https://api.exowpee.com/v1/catalog/purchase-deliveries/{purchase_delivery}/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/purchase-deliveries/{purchase_delivery}/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([
'asset_id' => '<string>',
'item_id' => '<string>',
'quantity' => 123,
'damaged_quantity' => 123,
'damage_stockable_unit_id' => '<string>',
'cost_total' => '<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/purchase-deliveries/{purchase_delivery}/items"
payload := strings.NewReader("{\n \"asset_id\": \"<string>\",\n \"item_id\": \"<string>\",\n \"quantity\": 123,\n \"damaged_quantity\": 123,\n \"damage_stockable_unit_id\": \"<string>\",\n \"cost_total\": \"<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/purchase-deliveries/{purchase_delivery}/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset_id\": \"<string>\",\n \"item_id\": \"<string>\",\n \"quantity\": 123,\n \"damaged_quantity\": 123,\n \"damage_stockable_unit_id\": \"<string>\",\n \"cost_total\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/purchase-deliveries/{purchase_delivery}/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 \"asset_id\": \"<string>\",\n \"item_id\": \"<string>\",\n \"quantity\": 123,\n \"damaged_quantity\": 123,\n \"damage_stockable_unit_id\": \"<string>\",\n \"cost_total\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"asset_id": "<string>",
"purchase_id": "<string>",
"item_id": "<string>",
"reception_id": "<string>",
"purchase_item": {},
"quantity": 123,
"accepted_quantity": 123,
"damaged_quantity": 123,
"damage_stockable_unit_id": "<string>",
"damage_stockable_unit": {},
"damage_reason": "<string>",
"damage_cost_treatment": "<string>",
"damage_cost_total": 123,
"base_cost_total": 123,
"allocated_purchase_leftover": 123,
"allocated_landed_cost_total": 123,
"cost_total": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Add a delivery item
Adds a product line, with received and damaged quantities, to a delivery that is not yet confirmed.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/purchase-deliveries/{purchase_delivery}/items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"asset_id": "<string>",
"item_id": "<string>",
"quantity": 123,
"damaged_quantity": 123,
"damage_stockable_unit_id": "<string>",
"cost_total": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/catalog/purchase-deliveries/{purchase_delivery}/items"
payload = {
"asset_id": "<string>",
"item_id": "<string>",
"quantity": 123,
"damaged_quantity": 123,
"damage_stockable_unit_id": "<string>",
"cost_total": "<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({
asset_id: '<string>',
item_id: '<string>',
quantity: 123,
damaged_quantity: 123,
damage_stockable_unit_id: '<string>',
cost_total: '<string>'
})
};
fetch('https://api.exowpee.com/v1/catalog/purchase-deliveries/{purchase_delivery}/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/purchase-deliveries/{purchase_delivery}/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([
'asset_id' => '<string>',
'item_id' => '<string>',
'quantity' => 123,
'damaged_quantity' => 123,
'damage_stockable_unit_id' => '<string>',
'cost_total' => '<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/purchase-deliveries/{purchase_delivery}/items"
payload := strings.NewReader("{\n \"asset_id\": \"<string>\",\n \"item_id\": \"<string>\",\n \"quantity\": 123,\n \"damaged_quantity\": 123,\n \"damage_stockable_unit_id\": \"<string>\",\n \"cost_total\": \"<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/purchase-deliveries/{purchase_delivery}/items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"asset_id\": \"<string>\",\n \"item_id\": \"<string>\",\n \"quantity\": 123,\n \"damaged_quantity\": 123,\n \"damage_stockable_unit_id\": \"<string>\",\n \"cost_total\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/purchase-deliveries/{purchase_delivery}/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 \"asset_id\": \"<string>\",\n \"item_id\": \"<string>\",\n \"quantity\": 123,\n \"damaged_quantity\": 123,\n \"damage_stockable_unit_id\": \"<string>\",\n \"cost_total\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"asset_id": "<string>",
"purchase_id": "<string>",
"item_id": "<string>",
"reception_id": "<string>",
"purchase_item": {},
"quantity": 123,
"accepted_quantity": 123,
"damaged_quantity": 123,
"damage_stockable_unit_id": "<string>",
"damage_stockable_unit": {},
"damage_reason": "<string>",
"damage_cost_treatment": "<string>",
"damage_cost_total": 123,
"base_cost_total": 123,
"allocated_purchase_leftover": 123,
"allocated_landed_cost_total": 123,
"cost_total": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}purchase_deliveries.update, purchase_reception_items.create
Conditions
- The delivery must still be editable: a draft delivery or a delivery marked in transit. A confirmed one is refused.
- Both the reception’s update permission and purchase_reception_items.create are required.
- asset_id must be an existing, active location asset available to the current company and not restricted for the current member; otherwise the call is refused with 422.
- item_id must be a line of the purchase this reception belongs to; a line of another purchase is refused with 422.
- The purchase unit of the line must still be active.
- quantity must be greater than 0 and may not exceed the quantity still to receive on that purchase line. Quantities of other draft receptions are not reserved, so the same remainder can be planned twice and is only enforced again at confirmation.
- A purchase line can appear only once per reception (item_id is unique inside the reception; deleted lines are really removed, so they no longer count).
- damaged_quantity is counted in the damage unit (the purchase unit when damage_stockable_unit_id is omitted) and must be between 0 and the received quantity expressed in that unit; the received quantity must convert exactly into that unit.
- damage_stockable_unit_id, when sent, must be an active unit of the same product and the same unit category as the purchase line.
- damage_reason, damage_cost_treatment and damage_stockable_unit_id are refused when damaged_quantity is 0; damage_reason and damage_cost_treatment are required when damaged_quantity is above 0.
- damage_cost_treatment “absorbed_by_remaining_stock” is refused when every received unit is damaged, because no accepted stock would remain to absorb the cost.
- cost_total cannot be sent; it is computed by the server.
- asset_id, item_id and quantity are required.
- Creates the line with its base cost (the purchase line’s commercial cost for this quantity, tax included) and no extra cost spread yet; cost_total equals base_cost_total until confirmation.
- Nothing is added to stock and the purchase line’s remaining quantity is not changed until the reception is confirmed.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the purchase delivery (27-character KSUID).
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, asset_id, purchase_id, item_id, reception_id, quantity, accepted_quantity, damaged_quantity, damage_stockable_unit_id, damage_reason, damage_cost_treatment, damage_cost_total, base_cost_total, allocated_purchase_leftover, allocated_landed_cost_total, cost_total, created_at, updated_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: item, item.stockable, item.stockableUnit, damageStockableUnit, damageStockableUnit.uomUnit, damageStockableUnit.prices, damageStockableUnit.stockable.
Body
Location asset (warehouse or shop) where the accepted goods will be stocked. Required on create; must be an existing, active location available to the company and not restricted for the current member.
Purchase line being received. Required on create; must be a line of the reception's purchase, with an active purchase unit, and not already used by another line of this reception.
Quantity received, in the purchase line's unit, greater than 0 and at most the quantity still to receive on the purchase line. Required on create.
Quantity damaged, in the damage unit (the purchase unit when damage_stockable_unit_id is omitted); between 0 and the received quantity in that unit. Defaults to 0 on create.
Unit in which damaged_quantity is counted: an active unit of the same product and unit category as the purchase line. Refused when damaged_quantity is 0. Null or omitted means the purchase unit.
Reason for the damage: ordinary or exceptional. Required when damaged_quantity is above 0, refused when it is 0.
ordinary, exceptional How the damage cost is treated: absorbed_by_remaining_stock or expensed. Required when damaged_quantity is above 0, refused when it is 0. absorbed_by_remaining_stock is refused when all received goods are damaged.
absorbed_by_remaining_stock, expensed Not accepted: the line cost is computed by the server from the purchase line and, at confirmation, the spread extra costs.
Response
Resource (only with response=resource).
Identifier of the reception line (27-character KSUID).
Identifier of the location asset (warehouse or shop) where the accepted goods will be added to stock at confirmation.
Identifier of the purchase of the reception.
Identifier of the purchase line being received.
Identifier of the delivery or pickup this line belongs to.
The purchase line, present only when requested with include=item; null otherwise.
Quantity received on this line, in the purchase line's unit, damaged goods included.
Quantity accepted into stock: received quantity minus damaged_quantity, expressed in the damage unit when damage_stockable_unit_id is set, otherwise in the purchase unit. Computed by the server.
Quantity found damaged, in the damage unit (the purchase unit when none is set). 0 when nothing is damaged.
Identifier of the unit in which damaged_quantity is counted, or null for the purchase unit.
The damage unit, present only when requested with include=damageStockableUnit; null otherwise.
Why the goods are damaged: ordinary or exceptional. Null when nothing is damaged.
How the cost of the damaged goods is treated: absorbed_by_remaining_stock (kept in the cost of the accepted stock) or expensed (removed from the stock cost). Null when nothing is damaged.
Cost attributed to the damaged goods, in major units. 0 until the reception is confirmed.
Commercial cost of the received quantity taken from the purchase line (tax included), in major units, before extra costs.
Share of the purchase's rounding leftover given to this line, in major units. 0 until the reception is confirmed.
Share of the reception's extra costs (and delivery fee) given to this line, in major units. 0 until the reception is confirmed.
Total cost of the line, in major units: base cost plus the spread amounts, minus the damage cost when it is expensed. Equals base_cost_total until the reception is confirmed.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).