outstandingSalesInvoices
Requires permission payments:invoice:list.
Lists the unpaid sales invoices of one customer: the invoices a customer payment can be allocated to.
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 OutstandingSalesInvoices($customerId: ID!) {
outstandingSalesInvoices(customerId: $customerId) {
id
invoiceNumber
supplierCode
supplierDisplayName
supplierName
status
allocations {
id
invoiceNumber
paymentNumber
createdAt
amount
appliedFromAdvance
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query OutstandingSalesInvoices($customerId: ID!) {\n outstandingSalesInvoices(customerId: $customerId) {\n id\n invoiceNumber\n supplierCode\n supplierDisplayName\n supplierName\n status\n allocations {\n id\n invoiceNumber\n paymentNumber\n createdAt\n amount\n appliedFromAdvance\n }\n }\n}",
"variables": {
"customerId": "id"
}
}
EOF
Variables:
{
"customerId": "id"
}
Response:
{
"data": {
"outstandingSalesInvoices": [
{
"id": "id",
"invoiceNumber": "string",
"supplierCode": "string",
"supplierDisplayName": "string",
"supplierName": "string",
"status": "APPROVED",
"allocations": [
{
"id": "id",
"invoiceNumber": "string",
"paymentNumber": "string",
"createdAt": "2025-01-15T00:00:00Z",
"amount": 0,
"appliedFromAdvance": true
}
]
}
]
}
}
outstandingSalesInvoices(
customerId: ID!
): [Invoice!]!
Arguments
outstandingSalesInvoices.customerId ● ID! non-null scalar
The ID of the customer.
Type
Invoice object
A sales invoice issued to a customer or a purchase invoice received from a supplier, with its lines, totals, status and settlement.