Skip to main content

Import Sales Orders

POST 

/api/sales-orders/import

Executes the import — creates or updates sales orders from validated/grouped data (the output of the Validate Import endpoint).

Required scope: orders:write

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

Request body: sales_orders (array, min 1) and optional continue_on_error (boolean). Each sales order accepts: group_key, id, action (create|update|blocked), sales_order_number, order_date, customer{id,email,name,company,phone}, sales_channel{id} (required), sub_sales_channel, store, currency, shipping_method, requested_shipping_method, customer_po_number, ship_by_date, deliver_by_date, hold_until_date, tags, order_discount_amount, order_discount_rate, shipping_amount, shipping_address, billing_address, and lines[] {sku, product_id, product_name, description, quantity, unit_price, discount, tax_rate, warehouse_id, nominal_code_id}.

hold_until_date (YYYY-MM-DD) sets the earliest ship date — the order is held until this date. Incoming dates are treated as tenant-timezone and stored as UTC.

Re-importing an existing order (action: update):

  • Lines: when the sheet's lines are identical to the order's current lines (same SKUs, quantities and unit prices), the order's lines are kept as they are, so their shipments, allocations and stock movements are untouched, including on an order that has already shipped. When any line differs, the order's lines are replaced by the sheet's.
  • Totals: the order discount (order_discount_amount / order_discount_rate), the line discounts (line discount, per unit) and the shipping charge (shipping_amount) are each replaced only when the sheet provides them. Leave one empty to keep what the previous import created; when the lines are replaced and no line has a discount, the previous import's per-unit line discounts are carried onto the new lines of the same product. Discounts and shipping that did not come from an import are never changed.

Returns 201 when anything was newly created, 200 when the import only updated existing records.

Authentication: Requires Bearer token. Scope: orders (read/write).

Requires permission: sales_orders.import

Request​

Responses​

Created

Response Headers
    Content-Type