Skip to main content

invoiceCreditHeadroom

Requires permission sales:credit_note:create.

Returns how much of a sales invoice has already been credited and how much is left to credit: the same figures the credit note create and update limit enforces. Pass excludeCreditNoteId to leave out a credit note you are editing.

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 InvoiceCreditHeadroom($invoiceId: ID!) {
invoiceCreditHeadroom(invoiceId: $invoiceId) {
invoiceNumber
alreadyCredited
creditNoteCount
currency
invoiceId
invoiceStatus
}
}

Variables:

{
"invoiceId": "id"
}

Response:

{
"data": {
"invoiceCreditHeadroom": {
"invoiceNumber": "string",
"alreadyCredited": 0,
"creditNoteCount": 0,
"currency": "string",
"invoiceId": "id",
"invoiceStatus": "string"
}
}
}
invoiceCreditHeadroom(
excludeCreditNoteId: ID
invoiceId: ID!
): InvoiceCreditHeadroom!

Arguments​

invoiceCreditHeadroom.excludeCreditNoteId ● ID scalar​

A credit note to leave out of the already-credited total, such as the one being edited.

invoiceCreditHeadroom.invoiceId ● ID! non-null scalar​

The ID of the sales invoice.

Type​

InvoiceCreditHeadroom object​

How much of a sales invoice has been credited and how much is left to credit.