Skip to main content

Create Sales Order from Extraction

POST 

/api/sales-orders/ocr/:extraction_id/create-order

Create a sales order from a reviewed OCR extraction. The request body contains the confirmed/edited field values from the review UI.

Required scope: orders:write

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

lines[].raw_sku (optional, nullable string, max 255): the customer's SKU exactly as it was read from the PO. When save_sku_mappings is true, each line that carries a raw_sku and a product_id is remembered as a customer SKU mapping to that confirmed product, so the next PO from this customer matches it automatically. This includes lines where you corrected the suggested product and lines you matched by hand. A mapping that already points at the same product is left as is.

ship_to_address (optional, nullable object): the per-PO shipping destination extracted from the customer PO's "Ship To" block. A customer can have a different ship-to address on each PO, so this is captured per-extraction rather than read from the customer's default address. When present and non-empty, it is passed through to the API as the order's shipping_address. Fields: name, company, address1, address2, city, province (all nullable, max 255), zip (nullable, max 50), country_code (nullable, max 10). Omit or send null when the PO states no separate shipping destination.

Returns the newly created sales order id and number, and marks the extraction status as 'confirmed'.

Request​

Responses​

Created

Response Headers
    Content-Type