Skip to main content
POST
Add a line item to a purchase order

Authorizations

Authorization
string
header
required

API key issued per entity via Settings > Developers > API Keys. Each key carries scopes (e.g. orders:read, products:write). Bearer token format: Authorization: Bearer ark_live_ent_Test keys use ark_test_ent_. Both are issued per entity
via Settings > Developers > API Keys.

Headers

Idempotency-Key
string

Optional idempotency key for safe retries (Stripe-style).

Maximum string length: 255

Path Parameters

id
string<uuid>
required

Body

application/json
product_id
string<uuid>
required

The product (SKU) to add. Cannot be a kit. If the product has variants, variant_id is also required.

quantity
number
required

Quantity ordered. Must be positive.

Required range: x >= 0.0001
variant_id
string<uuid> | null

Optional variant of product_id.

unit_cost
number | null

Optional unit cost override. Omit to auto-apply best purchase-pricing policy.

purchase_policy_id
string<uuid> | null

Optional pricing policy id to lock against (for audit trail).

sort_order
integer | null

Optional sort order on the PO; defaults to 0.

product_vendor_id
string<uuid> | null

Optional pointer at the exact product_vendors row this PO line is bound to. Persisted on order_items.product_vendor_id so the PO PDF / receiving / vendor email surface the operator-chosen vendor-part deterministically when a product has 2+ product_vendors rows for the same vendor. Validated against this entity (product_vendors -> products.entity_id) AND the line's (product_id, vendor_id); mismatched ids reject with 400 (invalid_product_vendor_id / product_vendor_product_mismatch / product_vendor_vendor_mismatch). Omit to let the PO PDF fall back to the deterministic LATERAL LIMIT 1 default-vendor-part pick.

Response

Line item added (or merged into existing line of same product+variant).

A line item on an order. Sub-resource of Order.

id
string<uuid>
entity_id
string<uuid>
read-only

Multi-tenant scoping column (Layer 1 isolation). Set automatically from the parent orders.entity_id and enforced by Postgres trigger trg_order_items_entity_parity (P0-ENTITY-ID-CHILD-TABLES, 2026-05-18). Cross-tenant writes are rejected at the database layer.

order_id
string<uuid>
product_id
string<uuid> | null
variant_id
string<uuid> | null
sku
string | null
title
string
quantity
integer
quantity_fulfilled
integer
read-only
quantity_returned
integer
read-only
received_floor
number
read-only

PURCHASE-ORDER lines only. The lowest quantity this line may be reduced to: the SAFEST of the line's quantity_fulfilled and its receipted-plus-damaged total, clamped at 0. The two sources disagree on migrated rows and on rows whose receipt was undone, so the maximum of both is used -- it can only ever refuse a reduction that either source forbids.

line_editability
object

PURCHASE-ORDER lines only. Per-field verdicts from the same predicate the write handlers enforce, so a client never has to restate the stage rules.

sell_rate
number

Canonical Arcus per-unit price column (matches order_items.sell_rate).

unit_price
number

Public-API alias of sell_rate (Stripe/Shopify/QuickBooks convention). Always populated on read; equal to sell_rate. Set per NEW-GAP-API-V1-CALLER-UNIT-PRICE-SILENTLY-OVERRIDDEN 2026-05-17 closure.

list_price
number
pricing_rule_adjustment
number
read-only

Per-unit pricing-rule savings (list_price minus sell_rate, positive magnitude). Already baked into sell_rate (and therefore line_subtotal) per ASC 606 transaction-price pricing; surfaced for the gross-to-net bridge display, never re-subtracted.

coupon_adjustment
number
read-only

Per-line allocated coupon/order-level discount (signed; negative for a discount). Reflected in line_subtotal.

discount_amount
number
line_subtotal
number
read-only
tax_amount
number
read-only
line_total
number
read-only
adjustments
object[]
read-only

Per-line, per-source adjustment breakdown from order_item_adjustments (the canonical SSOT). Each entry attributes a signed line_amount to a source (pricing_rule | order_adjustment | coupon | manual_line_override | return_refund_adjust | restocking_fee). Empty array for lines with no allocations (and on legacy orders predating the writer). Industry parity: Shopify Admin GraphQL LineItem.discountAllocations[].

unit_cost
number | null
weight
number | null
is_tax_exempt
boolean
product_tax_code
string | null
sort_order
integer
product_vendor_id
string<uuid> | null

For purchase_order document_type lines only: exact product_vendors row this line is bound to (NEW-GAP-ORDER-ITEMS-PRODUCT-VENDOR-ID-PROVENANCE, 2026-05-14). NULL for legacy PO lines and all non-PO doc types; PDF falls back to the deterministic default-vendor-part pick.

created_at
string<date-time>
read-only
updated_at
string<date-time>
read-only