Skip to main content

Import Quote Lines

POST 

/api/quotes/:quote/lines/import

Adds many product lines to an editable quote (draft or revised) in one request, from rows of SKU or barcode, quantity and optional price. Totals are recalculated.

Required scope: orders:write

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

Body

  • lines (required, array of 1–5000 rows):
    • lines[].sku (required, string, max 255) — a product SKU or barcode, matched as in Resolve Quote Line SKUs.
    • lines[].quantity (optional, number > 0, nullable) — defaults to 1.
    • lines[].unit_price (optional, number ≥ 0, nullable) — a price for the line, recorded as manual. Without one the line is priced exactly as Add Quote Line prices it (contract price, customer price, volume break, then the pricing tier).
  • replace_existing (optional, boolean, default false) — remove the quote's existing product lines first, releasing any stock they hold. Revenue lines (shipping, fees) are kept.

Rows that match no active product, or name a matrix parent, are not added; they are reported in import.failed[] and the rest are imported. The whole import is one transaction.

Response — the quote (same fields as Get Quote) plus a top-level import object: imported (lines added), replaced (product lines removed by replace_existing), and failed[] — row (1-based position in lines), sku, reason.

Returns 422 {message, errors: {quote: [message]}} when no row could be imported (the quote is left unchanged; the message names the first failures) or the quote can no longer be edited.

Authentication: Requires Bearer token. Permission: quotes.update.

Request​

Responses​

OK

Response Headers
    Content-Type