Skip to main content

Accept History Document

POST 

/api/ledger/history/documents/:document/accept

Save the chosen proposed rows to the history before go-live, in one transaction, and mark the document accepted. Accepting again replaces the rows saved from this document, so it is safe to repeat.

Required scope: accounting:write

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

  • kind (required): supplier_invoice (rows become purchase lines with an invoice cost basis), count_sheet (rows become counts) or landed_cost (the amount is spread over existing purchase lines).
  • date (required, YYYY-MM-DD): must be before the inventory start date.
  • warehouse_id: required for count_sheet; optional for supplier_invoice.
  • count_basis: full_count (default), partial_count or estimate; count_sheet only.
  • supplier_name, document_reference: override what was read (supplier_invoice).
  • rows[]: the rows to save, each key plus optional product_id, quantity and unit_cost overriding what was read. Two rows for the same product are combined.
  • landed_cost_keys[]: landed-cost lines to include. On a supplier invoice they are spread over the accepted rows by value; on a landed-cost bill they make up the amount to spread (default: all of them).
  • landed_cost_total: the amount to spread on a landed-cost bill, overriding the lines read.
  • purchase_ids[]: required for landed_cost; the purchase lines to spread the amount over, by value.

Returns 422 with a message when a row has no product, quantity or unit cost, the date is on or after go-live, a product is already recorded on that date, or there is nothing to spread a landed cost over.

Authentication: Requires Bearer token + accounting.manage_settings permission.

Request​

Responses​

OK

Response Headers
    Content-Type