Search sales orders and quotes
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/search/v2-search-orders-get.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
GET/
Finds sales orders and quotes by a word or number, for a search box or a picker. It returns at most 30 matches, with no paging, highest order number first.
The text in q matches anywhere inside ("contains") any of: the order number, the order name, the customer PO number, the customer's name, and every part of the shipping and billing addresses (label, street lines, city, state, country, postcode). Several words also match when each word is found in a different field, so northwind 1188 finds Northwind Apparel's order with PO number PO-1188. Without q, you get the first 30 in the same order.
Send the same fields as query parameters with GET, or as a JSON body with POST. To search quotes only, send quote=1 in the query string (GET .../search/orders?q=northwind"e=1) or "quote": true in a POST body; quote=0 or false gives sales orders only. quote=true in a query string is refused with 422.
Each result is the same order or quote object Get a sales order or quote returns, without items. Amounts come in two encodings:
- Thousandths, an older encoding:
calc_subtotal,calc_tax,calc_total, andpaid_amount(270000is 270.00). Thecalc_*fields count only invoiced amounts, so they are0on an order with no invoice. - Decimal pairs:
order_item_cart_total(the lines' value),order_balance_due, andinvoiced_total. The amount isvalue÷ 10^dp({"value": 2700000, "dp": 4}is 270.00). Readdpevery time.
For more than 30 results, or for filters, use the sales order and quote list operations.
Business rules
qandqueryare at most 255 characters.customer_idmust be a customer id of this team.- Searching is "contains" and ignores case.
%and_are matched as plain characters.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
Query parameters
qstringWhat to look for. Leave it out to list orders by order number.
- At most 255 characters
- Example
northwind
querystringAnother name for
q.qwins when both are sent.- At most 255 characters
customer_idstringOnly this customer's orders. A customer id.
quoteinteger1for quotes only,0for sales orders only. Leave it out for both. In the query stringtrueandfalseare refused with 422; withPOST, a JSONtrueorfalseworks.- One of:
0,1 - Example
1
- One of:
hide_draftintegerDoes not hide drafts, despite its name. Don't use it; check
internal_statusin the results instead. Likequote, it takes1or0in the query string.- One of:
0,1 - Example
0
- One of:
Request body
This operation takes no request body.
Response
200Successful response.
At most 30 orders and quotes. Each is the same object Get a sales order or quote returns, without
items; the main fields are listed here.- At most 30 items
Fields of each item (30)
approval_statusstring | nullbilling_addressobject | nullcalc_subtotalinteger | number | string | nullInvoiced subtotal: what has been invoiced so far,
0until the order is invoiced. Thousandths, an older encoding:12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.calc_taxinteger | number | string | nullInvoiced tax,
0until the order is invoiced. Thousandths, an older encoding:12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.calc_totalinteger | number | string | nullInvoiced total,
0until the order is invoiced. Thousandths, an older encoding:12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities. For the value of the order's lines, readorder_item_cart_total.created_atstring (date-time) | nullcustomerobject | nullThe customer, with
idandname.customer_idstring | nullcustomer_po_numberstring | nulldue_datestring (date-time) | nullProduction due date.
idstringThe order's id. Use it in the order operations.
internal_statusstring | nulldraftorpublished. Null on orders from before drafts existed.- One of:
"draft","published"
- One of:
invoiced_totaldecimal pairTotal of the order's invoices. A decimal pair: the amount is
value÷ 10^dp({ "value": 1350000, "dp": 4 }is 135.00). Readdpevery time: it can differ between fields and records.- See Money and quantities.
is_draftbooleanTrue when
modeiscreate. Older field; preferinternal_status.is_quotebooleanTrue for a quote. Same as
object_typequote.is_rushbooleanissue_datestring (date-time) | nullmodestringcreate: a draft.edit: being edited.view: saved.- One of:
"create","edit","view"
- One of:
namestring | nullobject_typestringWhat it is. Prefer this field.
- One of:
"sales_order","quote"
- One of:
order_balance_duedecimal pairInvoiced total minus payments. A decimal pair: the amount is
value÷ 10^dp({ "value": 850000, "dp": 4 }is 85.00). Readdpevery time: it can differ between fields and records.- See Money and quantities.
order_item_cart_totaldecimal pairThe value of the order's lines, invoiced or not. A decimal pair: the amount is
value÷ 10^dp({ "value": 2500000, "dp": 4 }is 250.00). Readdpevery time: it can differ between fields and records. Stored amounts usually have 4 decimal places; an order with no amount yet can come as{ "value": 0, "dp": 0 }.- See Money and quantities.
paid_amountinteger | number | string | nullPayments received. Thousandths, an older encoding:
12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.scoped_idstringThe order or quote number people see, such as
SO1001. Not an id.shipping_addressobject | nullstatusobject | nullThat status, with its
label.status_idstring | nullThe order's status id in your team's statuses.
trashedbooleantypestringThe same thing in older words:
orderfor a sales order.- One of:
"order","quote"
- One of:
unique_keystringThe order's unique key (
ord_...), for the operations that take one.
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.- When
- Your role can't view orders (
unauthorized). - Fix
- Ask a team admin for permission to view orders.
404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.422The request was refused and changed nothing.
validation_failedlists what to fix inerror.fields; other codes name a business rule, explained inerror.message. A few checks answer with only{"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answerconnect_timeout("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.- When
qis longer than 255 characters,customer_idis not a valid id, orquoteorhide_draftis not a boolean. In aGETquery string,quote=trueis refused this way (validation_failed;error.fieldsnames the field).- Fix
- In the query string send
quote=1(quotes) orquote=0(sales orders). In aPOSTbody, JSONtrueorfalsework.
Notes
- Results have no relevance ranking: every match counts the same, sorted by order number as text, highest first. Past 9,999 orders that text order is uneven (
SO9999comes beforeSO010000). Narrow the text if what you want is not in the first 30. - Draft orders are included. Deleted orders are not.
- Quotes are searched with your order permissions.
- The whole text is matched as one phrase, and the first 5 different words are also matched one by one; words after the fifth are not.
hide_draftdoes not hide drafts. It compares the order's status with one fixed status record that belongs to at most one team, so for almost every team it changes nothing. To leave drafts out, skip results whoseinternal_statusisdraft(ormodeiscreate).- Search results, Get order and the order lists share field names:
object_type(sales_orderorquote) is the same fact astype(orderorquote) andis_quote.
