Skip to main content

Create History Purchase

POST 

/api/ledger/history/purchases

Add a supplier purchase line to the history before go-live.

Required scope: accounting:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Body: purchased_on (required, YYYY-MM-DD, before the inventory start date), product_id (required), received_on (optional, YYYY-MM-DD, not before purchased_on): when the goods arrived; the purchase counts in that month, and a line received on or after the start date is reported as in transit at go-live. quantity (required, not 0; negative for a supplier return), unit_cost (required, ≥ 0), warehouse_id (optional; a line with no warehouse counts only in the all-warehouses total), landed_cost (≥ 0, for the whole line), supplier_name, document_reference (≤191), cost_basis (manual_entry default; invoice for a line from a supplier invoice), note. value = quantity × unit cost + landed cost.

Authentication: Requires Bearer token + accounting.manage_settings permission.

Request​

Responses​

Created

Response Headers
    Content-Type