Upload Bill Invoice for Reading
POST/api/bills/ocr/upload
Upload a vendor invoice to be read into a draft expense bill (a bill with no purchase order, warehouse transfer or inbound shipment). Reading runs in the background; the response returns the extraction to poll.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Body (multipart/form-data):
file(required) - the invoice. PDF or an image:pdf,jpg,jpeg,png,tif,tiff,bmp,webp. Max 20 MB.supplier_id(optional, integer, nullable) - an existing supplier, when you already know who sent the invoice. Otherwise the reader proposes one.
After upload: poll GET /api/landed-cost-invoices/ocr/{extraction} until the extraction is read, then review it and create the bill with POST /api/landed-cost-invoices/ocr/{extraction}/apply. An apply with no targets creates one expense bill; pass duplicate_acknowledged: true on the apply to save an invoice whose number the supplier already has. Use Suggest Bill Line Accounts to propose an expense account for each read line.
Duplicate files: a file whose content matches one already kept with a bill, an invoice still being read or reviewed, or a provider bill under review is refused with 422 on file, and existing says where the first copy is (type is bill, extraction, provider_bill or upload when the same file is sent twice).
Returns 422 with a message when invoice reading is switched off for the workspace (see Get Bill Invoice Reading Status).
Authentication: Requires Bearer token. Permission: create bills (bills.create). Scope: purchase-orders (read/write).
Request
Responses
- 201
- 401
- 403
- 422
- 429
Created
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 Entity
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.