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.
orders:writeGrant 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 asmanual. 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
- 200
- 401
- 403
- 404
- 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.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
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.