applyDebitNote
Requires permission purchase:debit_note:update.
Applies an amount of a PENDING or partially applied debit note to a purchase invoice, reducing what you owe the supplier on it. The amount must be positive and within the note's remaining amount. The invoice must be of the same supplier and in the same currency. 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
mutation ApplyDebitNote($amount: Float!, $id: ID!, $invoiceId: ID!) {
applyDebitNote(amount: $amount, id: $id, invoiceId: $invoiceId) {
message
success
debitNote {
id
debitNoteNumber
partnerName
status
type
createdAt
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation ApplyDebitNote($amount: Float!, $id: ID!, $invoiceId: ID!) {\n applyDebitNote(amount: $amount, id: $id, invoiceId: $invoiceId) {\n message\n success\n debitNote {\n id\n debitNoteNumber\n partnerName\n status\n type\n createdAt\n }\n }\n}",
"variables": {
"amount": 0,
"id": "id",
"invoiceId": "id"
}
}
EOF
Variables:
{
"amount": 0,
"id": "id",
"invoiceId": "id"
}
Response:
{
"data": {
"applyDebitNote": {
"message": "string",
"success": true,
"debitNote": {
"id": "id",
"debitNoteNumber": "string",
"partnerName": "string",
"status": "string",
"type": "string",
"createdAt": "2025-01-15T00:00:00Z"
}
}
}
}
applyDebitNote(
amount: Float!
id: ID!
invoiceId: ID!
): DebitNoteResponse!
Arguments
applyDebitNote.amount ● Float! non-null scalar
The amount to apply against the invoice.
applyDebitNote.id ● ID! non-null scalar
The ID of the debit note.
applyDebitNote.invoiceId ● ID! non-null scalar
The ID of the purchase invoice to apply the debit to.
Type
DebitNoteResponse object
The result of a debit note change.