Create a quote

Stable throughout v1

Creates a customer’s quote using prices from your product templates. The quote saves immediately; its Shopify draft order follows, which can change the quote number and totals. Read the quote again before reporting them.

POST/quotes
Base URLhttps://api.meetorderpilot.com/connect/v1
Stable throughout v1

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.

Nothing is sent to the customer. Sending the quote, turning it into an order and deleting it are endpoints of their own, each with its own scope.

Idempotency-Key requiredRetry with the same key and body to get the original response without repeating the change. The response includes Idempotent-Replayed: true. Responses are saved for 24 hours.

Headers

AuthorizationheaderRequired

Bearer and your key, opk_….

Idempotency-KeyheaderRequired

Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.

Content-Typeheader

application/json. A body is at most 256 KB.

Body

JSON
No pricesNever send a price. Template lines are priced from your templates and their options; a Shopify product line comes in at 0 for the store to price in OrderPilot.
custom_fieldsarray of objectOptional

Order-level custom fields [{ field_id, value }]; the shop required ones must be sent (see GET /custom-fields), and every one missing is listed in the refusal (error.missing, with each one’s choices). A text-and-image field takes its text in value and its picture in image_url.

field_idstringOptional
image_file_idstring, can be nullOptional

The picture’s Shopify file id, the shopify_file_id POST /files answered. Optional; sent with image_url.

image_urlstring, can be nullOptional

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.

valuestringOptional
customer_emailstringOptional

The customer by their email (any case), instead of customer_id: the one customer with it is quoted. None is 404 CUSTOMER_NOT_FOUND (find them with GET /customers or make them with POST /customers first) and several 409 CUSTOMER_AMBIGUOUS, listed in error.matches.

customer_idstringOptional

An id from GET /customers (or POST /customers). Or send customer_email instead.

discountobjectOptional

The quote’s discount, as PATCH /quotes/{id} sets it: { type, value, reason, scope? }. Needs Prices and exceptions (PRICING_WRITE); a role’s discount limit applies.

reasonstringOptional
scopestringOptional

One of products_and_fees, products_only.

typestringOptional

One of percentage, fixed_amount.

valuenumberOptional
feesobjectOptional

Fees to add, as PATCH /quotes/{id} adds them: { add: [...] }, a saved one { template_id, quantity? } (GET /fee-templates) or a custom one { name, type, value, quantity?, taxable?, physical? } (needs Prices and exceptions).

addarray of objectOptional
namestringOptional
physicalbooleanOptional
quantityintegerOptional
taxablebooleanOptional
template_idstringOptional
typestringOptional

One of fixed_amount, percent_of_discounted_price, percent_of_total, percent_of_retail_price.

valuenumberOptional
linesarray of objectRequired

At least one. Each is a product template (template_id, with its options), a Shopify product (shopify_variant_id, shopify_product_id optional, or its sku alone) or a custom item (title and price, with sku optional). The server prices a template line from the template and a Shopify product line at its variant’s catalog price. A price each on a template or Shopify product line, 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 as in OrderPilot. A line also takes its own discount and fulfillment, as PATCH /quotes/{id} sets them. A Shopify product that is a composition goes on as its pieces, as the order screens add one: each piece its own line at its quantity times the line’s, at its catalog price (a piece also sent as a plain line raises that line’s quantity); the composition line takes no price, note, discount or fulfillment, and one whose pieces can’t all be sold is refused, naming them.

discountobjectOptional

The line’s own discount: a percent, or an amount off each unit (up to its price each, 2 decimals). Needs Prices and exceptions (PRICING_WRITE); a reason is required unless the store turned that off; a role’s discount limit applies.

reasonstringOptional
typestringOptional

One of percentage, fixed_amount.

valuenumberOptional
fulfillmentobjectOptional

The line’s fulfillment, as PATCH /quotes/{id}’s line_fulfillment sets it: one part, or two to split the line (their quantities add up to the line’s; one part may leave its quantity out).

partsarray of objectOptional
notestringOptional
optionsarray of objectOptional

A template line’s option values: [{ field_id, value }] or [{ option, value }] (the option by its name, as GET /product-templates/{id} labels it), 1 to 30, each option once. value is text, a number, a dropdown value’s option_id, value or label (spacing and capitals don’t count), or a size as text such as 96 × 38 × 30; a text-and-image option takes its text in value and its picture in image_url. A name two options or values answer to is 409 OPTION_AMBIGUOUS; an unknown one lists the template’s options and values in the refusal. Required options are checked as in the admin, every missing one in error.missing. The server prices the line with them. Not on a Shopify product line.

field_idstringOptional
image_file_idstring, can be nullOptional

The picture’s Shopify file id, the shopify_file_id POST /files answered. Optional; sent with image_url.

image_urlstring, can be nullOptional

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.

optionstringOptional

The option’s name (its label on GET /product-templates/{id}), instead of field_id.

valuestringOptional
pricenumberOptional

The price each, set by hand (from 0, 2 decimals). Optional on a template or Shopify product line; required for a custom item. Needs Prices and exceptions.

quantityintegerOptional

1–9999 (default 1).

shopify_product_idstringOptional

Optional with shopify_variant_id: the variant’s own product.

shopify_variant_idstringOptional

A Shopify product’s variant; its product is read with it. A composition’s goes on as its pieces.

skustringOptional

A custom item’s SKU (optional, with its title). Without a title: the Shopify product’s variant with this SKU (exact, any case); none is 422 SKU_NOT_FOUND and several 409 SKU_AMBIGUOUS, listed in error.matches.

template_idstringOptional
titlestringOptional

A custom item’s name (up to 255 characters), with its price.

location_idstringOptional

A Shopify location id from GET /locations. Defaults to the first active location.

notestringOptional
payment_terms_due_datestring (date)Optional

The day fixed-date terms fall due (YYYY-MM-DD), with their payment_terms_id.

payment_terms_idstringOptional

A template id from GET /payment-terms. Needs the right to set payment terms (a key: Prices and exceptions, PRICING_WRITE). Terms with a fixed date need payment_terms_due_date.

salesperson_idsarray of stringOptional

Staff ids credited with the sale (up to 5; the first is the primary and takes the assignment). Other than the create’s own needs Change sales credit (COMMISSION_WRITE).

ship_to_address_idstringOptional

Deliver to one of the customer’s saved addresses (an id from GET /customers/{id}/addresses), instead of shipping_address.

shippingarray of objectOptional

Delivery charges [{ title, price }] (up to 5), as PATCH /quotes/{id} sets them. Needs Prices and exceptions (PRICING_WRITE). Not on a quote whose every line is picked up.

pricenumberOptional
titlestringOptional
shipping_addressobjectOptional
address1stringOptional
address2stringOptional
citystringOptional
companystringOptional
countrystringOptional
phonestringOptional
provincestringOptional
zipstringOptional
tagsarray of stringOptional

The quote’s tags (up to 250, 40 characters each).

tax_modestringOptional

The tax choice, as PATCH /quotes/{id} sets it: default, exempt or charge.

One of default, exempt, charge.

tax_mode_reasonstring, can be nullOptional

Why (up to 200 characters): required for exempt and charge unless the store turned that off.

Find the required IDs
customer_idGET /customers?q=PriyaRead customers
template_idGET /product-templates/{id}Read the catalog
optionsGET /product-templates/{id}Read the catalog
location_idGET /locationsAny quote scope
custom_fieldsGET /custom-fieldsRead quotes

Returns

201

Created: balance_due, cancelled_at, created_at, currency, custom_fields, custom_fields_truncated, customer, discount, edit_token, expiry and more

202

Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`.: charge_id, content_version, done, id, message, number, payment_id, read, refund, reopened and more

Errors

Errors use { "error": { "code", "message" } }. Use code to handle the error. View all error codes.

400

The request isn’t valid (see error.code), or the API version isn’t supported.

401

No valid access token or API key.

402

The store’s subscription isn’t active.

403

Not allowed: the API is off for this store, or the caller lacks the scope or permission.

404

Not found, or not visible to this caller.

405

Wrong method for this path; Allow lists every method the path takes.

408

The request body didn’t arrive in time.

409

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.

413

The request body is too large.

422

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.

426

The app is older than the oldest version still served (error.code CLIENT_TOO_OLD); see error.min_version and error.upgrade_url.

429

Over a rate limit; wait Retry-After seconds.

500

Something went wrong on our side. A write may have partly happened: check the record before retrying it.

503

Busy, switched off, or billing couldn’t be checked; wait Retry-After seconds.

Was this page useful?