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.
accounting:writeGrant 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, eachkeyplus optionalproduct_id,quantityandunit_costoverriding 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
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Content
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.