Skip to main content

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.

Required scope: purchase-orders:write

Grant 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​

OK

Response Headers
    Content-Type