Skip to main content

getSalesOrderItemsWithRemainingQuantity

Requires permission sales:sales_order:read.

The order's lines that still have quantity left to invoice, with the invoiced and remaining quantity for each.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

query GetSalesOrderItemsWithRemainingQuantity($salesOrderId: ID!) {
getSalesOrderItemsWithRemainingQuantity(salesOrderId: $salesOrderId) {
id
productName
uomName
variantName
createdAt
acceptAlternativeIfUnavailable
invoiceItems {
id
quantity
}
}
}

Variables:

{
"salesOrderId": "id"
}

Response:

{
"data": {
"getSalesOrderItemsWithRemainingQuantity": [
{
"id": "id",
"productName": "string",
"uomName": "string",
"variantName": "string",
"createdAt": "2025-01-15T00:00:00Z",
"acceptAlternativeIfUnavailable": true,
"invoiceItems": [
{
"id": "id",
"quantity": 0
}
]
}
]
}
}
getSalesOrderItemsWithRemainingQuantity(
salesOrderId: ID!
): [SalesOrderItem!]!

Arguments​

getSalesOrderItemsWithRemainingQuantity.salesOrderId ● ID! non-null scalar​

The ID of the sales order.

Type​

SalesOrderItem object​

A line on a sales order: a product or variant, quantity, price, discount and tax, with its shipped and invoiced progress.