Change a quote
Updates a quote and returns the updated quote.
Required access
- API key
- Create and change quotespermission
- Request limit
- Counts as 5 requests. Each key has a capacity of 15, restored at 0.6 a second.
Idempotent-Replayed: true. Responses are saved for 24 hours.Headers
Bearer and your key, opk_….
Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.
application/json. A body is at most 256 KB.
Parameters
The id from a list.
Body
JSONAdd lines: [{ template_id, quantity?, note?, price? }], [{ shopify_variant_id, shopify_product_id?, quantity?, note?, price? }] (or a Shopify product by its sku alone) or a custom item [{ title, price, quantity?, sku?, note? }] (up to 20). A template line is priced by the server from the template; a Shopify product line at the variant’s catalog price. A price each, and a custom item, set the price by hand: they need the right to change item prices (a key: Prices and exceptions, PRICING_WRITE), and a role’s discount limit applies; a template with no set price is added only with one. A Shopify product that is a composition goes on as its pieces, as the order screens add one: each its own line at its quantity times the line’s, at its catalog price, or, when the record already has the piece as a plain line (no options or discount, at its catalog price), that line’s quantity raised; the composition line takes no price or note, and one whose pieces can’t all be sold is refused, naming them. Can be sent with lines and remove_lines, alone otherwise.
A template line’s option values [{ field_id, value }] or [{ option, value }] (the option by its name; see GET /product-templates/{id}), as POST /quotes takes them; a text-and-image option takes its picture in image_url.
The picture’s Shopify file id, the shopify_file_id POST /files answered. Optional; sent with image_url.
A text-and-image option’s or field’s picture: its Shopify Files URL, the url POST /files answered (another host is refused). Its text is value.
The option’s name (its label on GET /product-templates/{id}), instead of field_id.
The price each, set by hand (from 0, 2 decimals). Required for a custom item.
A custom item’s SKU (optional, with its title). Without a title: the Shopify product’s variant with this SKU (exact, any case); several are 409 SKU_AMBIGUOUS, listed in error.matches.
A custom item’s name, with its price.
Set order-level custom fields: [{ field_id, value }] (text, number, a dropdown option’s id or value, or a size as text such as 96 × 38 × 30; null clears one). A text-and-image field takes its text in value and its picture in image_url. Only the fields sent change; required fields are enforced as in the admin. Send on its own.
The picture’s Shopify file id, the shopify_file_id POST /files answered. Optional; sent with image_url.
A text-and-image option’s or field’s picture: its Shopify Files URL, the url POST /files answered (another host is refused). Its text is value.
The order-wide discount: { type: percentage | fixed_amount, value, reason, scope?: products_and_fees | products_only }, or null to remove it. Needs the right to override prices (a key: Prices and exceptions, PRICING_WRITE). A role’s discount limit applies as in the admin: over it the discount is refused (or allowed and flagged, as the shop chose). Send on its own. Not on an order already placed in Shopify (422 ORDER_LOCKED): give its lines their own discounts instead.
One of products_and_fees, products_only.
One of percentage, fixed_amount.
The edit_token you last read (optional; version holds it).
The updated_at you last read, when you don’t send version. A change made since is 409 STALE_VERSION.
Add and/or remove fees: { add: [...], remove: [fee id] }. An added fee is a saved one at its set price, { template_id, quantity? }, or a custom one at your price, { name, type, value, quantity?, taxable?, physical? } (type: fixed_amount, percent_of_discounted_price, percent_of_total or percent_of_retail_price). A saved fee and a removal need only the right to edit. A custom fee is a pricing override: it needs the right to override prices (a key: Prices and exceptions, PRICING_WRITE). Send on its own.
One of fixed_amount, percent_of_discounted_price, percent_of_total, percent_of_retail_price.
One item’s fulfillment, as the order page’s fulfillment pill sets it: where its units come from and how they reach the customer, in one part, or two to split the item (the parts’ quantities add up to the item’s). Works on quotes and orders. Pickup is at the record’s own store: to change the store, move the record with location_id first. line_id is any row of the item (split_group_id names a split item’s rows). Still allowed on a Shopify order under a status that locks editing; refused once the item is handed over or on a purchase order (422 RULE_REFUSED with why). Send on its own.
Store pickup today, pickup on a later day, or delivery. Made to order is never pickup.
One of pickup, later, delivery.
Inventory from another store: its Shopify location id (GET /locations), one this caller may use. Null or left out: the order’s own location.
From stock, or made (or ordered) for this order.
One of inventory, made_to_order.
Change existing lines: { id, quantity?, note?, discount?, price? }. price sets the line’s price each by hand (a template line then stays hand-priced): it needs the right to change item prices (a key: Prices and exceptions, PRICING_WRITE), and a role’s discount limit applies to a Shopify product’s line priced under its catalog price. On an order already placed in Shopify a Shopify product’s line and a line with its own discount keep their price (422 RULE_REFUSED), as on the order page. Send on its own, not with other fields. No line is added or removed here.
The line’s own discount, as the line read shows it: a percent, or an amount off each unit in currency (up to its price each, 2 decimals); null takes it off. Giving or raising one, or changing its type or reason, needs the Prices and exceptions scope (PRICING_WRITE); lowering or removing one doesn’t. A reason is required unless the store turned that off. A role’s discount limit applies as in OrderPilot.
One of percentage, fixed_amount.
The price each, set by hand (from 0, 2 decimals).
Move the record to this Shopify location (an active, billed one, from GET /locations). Not allowed once it is a Shopify order or linked to a purchase order.
The record’s note; null or empty clears it.
The day fixed-date terms fall due (YYYY-MM-DD), sent with their payment_terms_id; they are issued on it too, as in OrderPilot. Only for terms of type fixed; without it they are 422 TERMS_UNSUPPORTED.
A template id from GET /payment-terms; null removes the terms (and any deposit). A change needs the right to set payment terms (a key: Prices and exceptions, PRICING_WRITE). Terms with a fixed date need payment_terms_due_date.
Remove lines by id (up to 100). A record keeps at least one line; a line covered by a warranty plan or split for delivery isn’t removed here.
Staff ids credited with the sale (up to 5; the first is the primary and takes the assignment). A change needs the right to change sales credit (a key: Change sales credit, COMMISSION_WRITE). [] credits nobody.
Deliver to one of the customer’s saved addresses (an id from GET /customers/{id}/addresses). Send on its own with expected_updated_at. On an order already placed in Shopify the address is sent to its Shopify order on the queue (Shopify keeps the address it shipped to once it has fulfilled the order); not on a placed order split in two for tax, nor on a store pickup one.
The record’s delivery charges, replacing the current ones: [{ title, price }] (up to 5, price from 0 with 2 decimals); [] removes them. Needs the right to override prices (a key: Prices and exceptions, PRICING_WRITE). Send on its own. Not on a store pickup record.
The record’s tags, replacing the current ones (up to 250, 40 characters each).
The order page’s tax choice: default (Shopify decides from the customer’s resale certificates), exempt (exempt this order from tax) or charge (charge tax despite a certificate; the order is then paid through its own payment link once placed, and the draft’s invoice link is withdrawn). Not once it is a Shopify order, nor on an order split in two for tax.
One of default, exempt, charge.
Why (up to 200 characters): required for exempt and charge unless the store turned that off. Left out with an unchanged tax_mode, the stored reason stays.
The version of the last answer about this record (its read, its list row or the last change), sent back as it is: no read needed first. A change made since is 409 STALE_VERSION with the current version and what changed. Send this or expected_updated_at.
Returns
OK: balance_due, cancelled_at, created_at, currency, custom_fields, custom_fields_truncated, customer, discount, edit_token, expiry and more
Errors
Errors use { "error": { "code", "message" } }. Use code to handle the error. View all error codes.
The request isn’t valid (see error.code), or the API version isn’t supported.
No valid access token or API key.
The store’s subscription isn’t active.
Not allowed: the API is off for this store, or the caller lacks the scope or permission.
Not found, or not visible to this caller.
Wrong method for this path; Allow lists every method the path takes.
The request body didn’t arrive in time.
The same Idempotency-Key is still being processed (REQUEST_IN_PROGRESS), its outcome is unknown (OUTCOME_UNKNOWN: check the record), or the record changed since it was read.
The request body is too large.
The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body.
The app is older than the oldest version still served (error.code CLIENT_TOO_OLD); see error.min_version and error.upgrade_url.
Over a rate limit; wait Retry-After seconds.
Something went wrong on our side. A write may have partly happened: check the record before retrying it.
Busy, switched off, or billing couldn’t be checked; wait Retry-After seconds.