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.
accounting:writeGrant 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
- 202
- 401
- 403
- 422
- 429
Accepted
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.
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.