invoiceDebitHeadroom
Requires permission purchase:debit_note:create.
Returns how much of a purchase invoice has already been debited and how much is left to debit: the same figures the debit note create and update limit enforces. Pass excludeDebitNoteId to leave out a debit note you are editing. Needs the debit notes feature on your plan.
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 InvoiceDebitHeadroom($invoiceId: ID!) {
invoiceDebitHeadroom(invoiceId: $invoiceId) {
invoiceNumber
alreadyDebited
currency
debitNoteCount
invoiceId
invoiceStatus
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query InvoiceDebitHeadroom($invoiceId: ID!) {\n invoiceDebitHeadroom(invoiceId: $invoiceId) {\n invoiceNumber\n alreadyDebited\n currency\n debitNoteCount\n invoiceId\n invoiceStatus\n }\n}",
"variables": {
"invoiceId": "id"
}
}
EOF
Variables:
{
"invoiceId": "id"
}
Response:
{
"data": {
"invoiceDebitHeadroom": {
"invoiceNumber": "string",
"alreadyDebited": 0,
"currency": "string",
"debitNoteCount": 0,
"invoiceId": "id",
"invoiceStatus": "string"
}
}
}
invoiceDebitHeadroom(
excludeDebitNoteId: ID
invoiceId: ID!
): InvoiceDebitHeadroom!
Arguments
invoiceDebitHeadroom.excludeDebitNoteId ● ID scalar
A debit note to leave out of the already-debited total, such as the one being edited.
invoiceDebitHeadroom.invoiceId ● ID! non-null scalar
The ID of the purchase invoice.
Type
InvoiceDebitHeadroom object
How much of a purchase invoice has been debited and how much is left to debit.