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:
- GraphQL
- cURL
query GetSalesOrderItemsWithRemainingQuantity($salesOrderId: ID!) {
getSalesOrderItemsWithRemainingQuantity(salesOrderId: $salesOrderId) {
id
productName
uomName
variantName
createdAt
acceptAlternativeIfUnavailable
invoiceItems {
id
quantity
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query GetSalesOrderItemsWithRemainingQuantity($salesOrderId: ID!) {\n getSalesOrderItemsWithRemainingQuantity(salesOrderId: $salesOrderId) {\n id\n productName\n uomName\n variantName\n createdAt\n acceptAlternativeIfUnavailable\n invoiceItems {\n id\n quantity\n }\n }\n}",
"variables": {
"salesOrderId": "id"
}
}
EOF
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.