Reading data (queries)
The operations that read data.
Lists
A list is a connection. Pass exactly one of first or last, from 1 to 250, after only with
first and before only with last. Any other combination is refused with VALIDATION, and
extensions.field names the argument. A cursor belongs to the list it came from (and to its
sortKey): do not pass it to another list.
Partial results
A nullable field your API key may not read (FORBIDDEN_ROLE, FORBIDDEN_SCOPE), or a nested
page that could not be read, is null with an error at its path, and the rest of data is
returned. An error on a non-null field (marked !) nulls its parent instead: on a root list or
another root field marked !, data itself is null. Ask for such fields in separate requests
when one of them may fail.
A query for one record by its id (for example salesOrder) returns null, without an
error, when the record does not exist or your API key cannot see it. asset,
printTemplate, emailTemplate and emailMessage answer
NOT_FOUND instead, as do stocktakeCountedLines and errorReports for
the record they name.
Cost
Every query is priced in points. See Limits and query cost.
Changes
To learn what changed, follow events or stockCardChanges instead of
reading the lists again.
All queries
Orders
salesOrderReturns one sales order.salesOrdersReturns a page of sales orders that match a filter, newest first by orderedAt, then by id.
Receipts
receiptAdviceReturns one receipt advice by its MAX id.receiptAdvicesReturns a page of receipt advices that match a filter, newest first by advisedAt, then by id.receiptsReturns a page of receipts that match a filter, newest first by effectiveAt, then by when they were created, then by id.
Transfers
transferAdviceReturns one transfer advice by its MAX id.transferAdvicesReturns a page of transfer advices that match a filter, newest issued first.transfersReturns a page of transfers that match a filter, newest first by effectiveAt, then by when they were created, then by id.
Products
productReturns one product, by its MAX id or by its code.productsReturns a page of products that match a filter, sorted by sortKey, then by id.
Inventory
stockCardsReturns a page of stock cards with their current figures, by variant, then warehouse.stockCardChangesReturns the real changes of stock cards, oldest first, forward from a cursor.locationsReturns a page of the bins of the named warehouses, by warehouse, code, then id.stockQuantsReturns what lies in which bin of the named warehouses: one row per variant, bin and lot with stock, in base units, by bin, variant, then row.stocktakeCountedLinesReturns what a stocktake counted, by line, once MAX handed the stocktake over to the external system that manages the warehouse.warehousesReturns a page of the warehouses your API key may read, archived ones included, by code, then id.
Stock planning
planningCardsReturns a page of the stock cards that have a minimum, in the named warehouses, by variant, then warehouse: each with its figures (as stockCards computes…binRefillsReturns a page of the picking bins' levels in the named warehouses, by variant, bin code, then bin id.stockDemandReturns a page of what confirmed orders wait for in the named warehouses, by variant, then warehouse: per product variant and warehouse, what is waiting, what…stockSourcesWorks out where needed goods could be taken from: each need is split over the free stock in the bins input.from reaches, in the order to take it.
Invoices
invoicesReturns a page of invoices that match a filter, newest issued first.invoiceReturns one invoice, by its MAX id or by its source and externalId.
Shipments
fulfilmentReturns one fulfilment by its MAX id.shipmentReturns one carrier shipment by its MAX id.carrierProfilesReturns a page of the active carrier profiles from the Chameleoon carrier catalogue.
Issues
issuesReturns a page of issues that match a filter, newest first by effectiveAt, then by when they were created, then by id.
Documents
documentReturns one document with its current version.
Assets
assetsReturns the organisation's and the companies' assets, ordered by scope and code.assetReturns one asset by its MAX id.
Print templates
printTemplatesReturns the organisation's print templates, ordered by kind, language and name.printTemplateReturns one print template by its MAX id.builtInPrintTemplateReturns the MAX built-in template of a kind in a language.
Email templates
emailTemplatesReturns the e-mail templates: the MAX built-in templates first, then the organisation's own by name.emailTemplateReturns one e-mail template, built-in or the organisation's, by its code.previewEmailTemplateRenders a template as sendEmail would, and stores and queues nothing.
Emails
emailMessagesReturns the messages linked to a record, newest first.emailMessageReturns one message by its MAX id.
Tags
tagsReturns a page of the organisation's tags, by their order in MAX, then name.tagGroupsReturns a page of the organisation's tag groups, by their order in MAX, then name.
Integrations
errorReportsReturns the error reports on one record, most recently seen first.eventsReturns a page of the event log: what happened to the records listed below, read forward from a cursor, oldest first.externalSourceReturns the external source with this code.