Skip to main content

Upload History Documents

POST 

/api/ledger/history/documents

Upload supplier invoices, landed-cost bills and count sheets (PDF, JPG, PNG, XLSX or CSV, or a .zip of them; up to 200 files and 20 MB per file). A .zip is expanded, including nested folders; other file types inside it are skipped. A file already uploaded (and not rejected) is skipped with "Already uploaded". Each document is read in the background into proposed rows; nothing is saved until the rows are accepted.

Required scope: accounting:write

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

Spreadsheets are read directly: quantity columns with no price column, or "count" or "stock take" in the file name, make a count sheet; otherwise the rows are supplier invoice lines. PDFs and images need invoice reading switched on for the account.

Returns 202 with the documents created, or 200 when every file was skipped. Returns 422 when no inventory start date is set.

Authentication: Requires Bearer token + accounting.manage_settings permission.

Request​

Responses​

Accepted

Response Headers
    Content-Type