{
"lines": [
{
"item_id": "itm_rice_01...",
"qty": 20,
"qty_base": 20000,
"base_unit_id": "unit_g_01...",
"unit_to_base_factor": 1000,
"unit_label": "kg",
"unit_cost": 1.2
}
]
}
{
"lines": [
{
"id": "pol_02...",
"purchase_order_id": "po_01j5k...",
"item_id": "itm_rice_01...",
"qty": 20,
"qty_base": 20000,
"base_unit_id": "unit_g_01...",
"unit_label": "kg",
"unit_cost": 1.2
}
]
}
{
"error": {
"kind": "purchase_order_not_draft",
"message": "Lines can only be added to DRAFT orders"
}
}
PO Lines
Add lines to purchase order
Appends lines to a DRAFT purchase order. Returns the created lines with HTTP 201.
POST
/
api
/
v1
/
public
/
vendors
/
{vendorId}
/
procurement
/
orders
/
{orderId}
{
"lines": [
{
"item_id": "itm_rice_01...",
"qty": 20,
"qty_base": 20000,
"base_unit_id": "unit_g_01...",
"unit_to_base_factor": 1000,
"unit_label": "kg",
"unit_cost": 1.2
}
]
}
{
"lines": [
{
"id": "pol_02...",
"purchase_order_id": "po_01j5k...",
"item_id": "itm_rice_01...",
"qty": 20,
"qty_base": 20000,
"base_unit_id": "unit_g_01...",
"unit_label": "kg",
"unit_cost": 1.2
}
]
}
{
"error": {
"kind": "purchase_order_not_draft",
"message": "Lines can only be added to DRAFT orders"
}
}
string
required
API key with
inventory:write scope.string
required
Vendor UUID.
string
required
Purchase order UUID. Must be in
DRAFT status.string
required
Must be
add-lines.object[]
required
Lines to add (at least 1). Same fields as on order creation:
item_id / external_item_id / supplier_sku, qty, qty_base, base_unit_id, item_unit_id, unit_code, unit_label, unit_cost, tax_amount, delivery_amount, total_amount, markup_amount, notes, metadata. qty_base is optional when the line references unit_code or item_unit_id — the server derives it from the unit’s factor_to_base.boolean
When
true, every line item must exist in the supplier’s catalog.object[]
The created lines with full detail.
{
"lines": [
{
"item_id": "itm_rice_01...",
"qty": 20,
"qty_base": 20000,
"base_unit_id": "unit_g_01...",
"unit_to_base_factor": 1000,
"unit_label": "kg",
"unit_cost": 1.2
}
]
}
{
"lines": [
{
"id": "pol_02...",
"purchase_order_id": "po_01j5k...",
"item_id": "itm_rice_01...",
"qty": 20,
"qty_base": 20000,
"base_unit_id": "unit_g_01...",
"unit_label": "kg",
"unit_cost": 1.2
}
]
}
{
"error": {
"kind": "purchase_order_not_draft",
"message": "Lines can only be added to DRAFT orders"
}
}

