purchaseOrderLines
query · in the family Reading your records
What it does
The lines on one purchase order — what you ordered, where each lot is going, and how much of it has landed.
ONE PurchaseOrder's own lines, lineNo-ORDERED + born-paginated. purchaseOrderId is the required anchor (tenant-scoped — a cross-tenant/missing order refuses NOT_FOUND, never an empty page). 'nextToken' = the prior page's cursor, verbatim (opaque; malformed/foreign → VALIDATION/INVALID). Requires authentication.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Reading your records — Looking up and listing the records of your organization.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows
api:purchaseOrderLines
What happens
Reads only — changes nothing. Comes a page at a time, in line order, and can be narrowed to one product, one receiving location, or an arrival window.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
purchaseOrderId | ID ID! | yes | |
filter | FilterInput | no | The structured filter: AND across clauses · OR within a clause's values; max 8 clauses, one clause per (field, operator) pair. |
sort | SortInput | no | One sort key: missing-fact records trail in either direction; ties resolve by id, so every order is total and pages are stable. |
limit | Int | no | How many records to answer at most; a page may hold fewer. |
nextToken | String | no | The cursor from the previous page, passed back exactly as received. |
Returns
PurchaseOrderLinePage PurchaseOrderLinePage! — One page of a PurchaseOrder's own line collection.
This is a page: items holds the records and nextToken the cursor for the next page — pass it back verbatim until it is null. See paging.
Example request
query ExamplePurchaseOrderLines($purchaseOrderId: ID!, $limit: Int) {
purchaseOrderLines(purchaseOrderId: $purchaseOrderId, limit: $limit) {
items {
lineNo
variantId
logicalFacilityId
quantity
manufacturerId
expectedArrivalAt
receivedQty
outstandingQty
purchasePackId
packQuantity
}
nextToken
matchCount
matchCountExact
}
}Variables:
{
"purchaseOrderId": "01900000-0000-7000-8000-da3499da0000",
"limit": 1
}Example response
{
"data": {
"purchaseOrderLines": {
"items": [
{
"lineNo": 1,
"variantId": "01900000-0000-7000-8000-8433b0260000",
"logicalFacilityId": "01900000-0000-7000-8000-10c08c590000",
"quantity": "2",
"manufacturerId": "01900000-0000-7000-8000-7897bed00000",
"expectedArrivalAt": "2027-01-31T00:00:00.000Z",
"receivedQty": "<received qty>",
"outstandingQty": "<outstanding qty>",
"purchasePackId": "01900000-0000-7000-8000-f00805cb0000",
"packQuantity": 1
}
],
"nextToken": "<the cursor from the previous page>",
"matchCount": 1,
"matchCountExact": true
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)