# purchaseOrderLines

query · in the family [Reading your records](/reference/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.

## 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.

## Who may call it

Capability area: **Reading your records** — Looking up and listing the records of your organization.

- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows `api:purchaseOrderLines`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `purchaseOrderId` | [ID](/types/#scalars) `ID!` | yes | No further notes. |
| `filter` | [FilterInput](/types/FilterInput/) | no | Which records to answer — clauses over the family’s filterable fields (the FilterInput type and the paging guide carry the grammar). |
| `sort` | [SortInput](/types/SortInput/) | no | The order to answer in — one declared field and a direction (the SortInput type carries the grammar). |
| `limit` | [Int](/types/#scalars) | no | How many records to answer at most; a page may hold fewer. |
| `nextToken` | [String](/types/#scalars) | no | The cursor from the previous page, passed back exactly as received. |

## Returns

[PurchaseOrderLinePage](/types/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](/guides/paging-and-the-cursor-grammar/).

## Example request

```graphql
query ExamplePurchaseOrderLines($purchaseOrderId: ID!, $limit: Int) {
  purchaseOrderLines(purchaseOrderId: $purchaseOrderId, limit: $limit) {
    items {
      lineNo
      variantId
      logicalFacilityId
      quantity
      manufacturerId
      expectedArrivalAt
      receivedQty
      outstandingQty
      purchasePackId
      packQuantity
    }
    nextToken
    matchCount
  }
}
```

Variables:

```json
{
  "purchaseOrderId": "01900000-0000-7000-8000-54a5b8570000",
  "limit": 1
}
```

## Example response

```json
{
  "data": {
    "purchaseOrderLines": {
      "items": [
        {
          "lineNo": 1,
          "variantId": "01900000-0000-7000-8000-8415e73b0000",
          "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
          "quantity": "2",
          "manufacturerId": "01900000-0000-7000-8000-7cefed4d0000",
          "expectedArrivalAt": "2027-01-31T00:00:00.000Z",
          "receivedQty": "<received qty>",
          "outstandingQty": "<outstanding qty>",
          "purchasePackId": "01900000-0000-7000-8000-031157c60000",
          "packQuantity": 1
        }
      ],
      "nextToken": "<the cursor from the previous page>",
      "matchCount": 1
    }
  },
  "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. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/NOT_FOUND/))
