Upload Order Document
POST/api/purchase-orders/from-document/upload
A vendor's order sheet, a photo of it, or a trade-show market-app export becomes a reviewed DRAFT purchase order.
purchase-orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token. Permission: purchase_orders.create. Token scope: purchase-orders:write.
Stores the file and reads it in a background job; tracked_job_log_id reports its progress. PDFs and photos are read with the invoice OCR stack (needs Settings → Invoice OCR on; 422 otherwise). Spreadsheets (.xlsx/.xls/.csv) are parsed directly, including size-run grids (sizes across the top), with no OCR.
Form fields:
- file (required): pdf, jpg, jpeg, png, tif, tiff, bmp, webp, xlsx, xls, csv, txt; max 20 MB
- supplier_id (optional): skip vendor-name matching and match lines to this supplier's catalog
- destination_warehouse_id (optional)
Response: extraction_id, tracked_job_log_id, status (processing). Poll GET /purchase-orders/from-document/{id} until status is pending_review or failed.
Request
Responses
- 200
- 401
- 403
- 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.
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.