reversePaymentAllocations
Requires at least one of the permissions payments:payment:reverse or purchase:payment:reverse.
Reverses selected allocations of a payment: each affected invoice's paid amount goes back down and it owes the money again. The original allocation is kept and a negative counter-entry records the reversal. At least one allocation ID is required.
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 ReversePaymentAllocations($input: ReversePaymentAllocationsInput!) {
reversePaymentAllocations(input: $input) {
id
checkNumber
currencyCode
paymentNumber
referenceNumber
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": "mutation ReversePaymentAllocations($input: ReversePaymentAllocationsInput!) {\n reversePaymentAllocations(input: $input) {\n id\n checkNumber\n currencyCode\n paymentNumber\n referenceNumber\n status\n allocations {\n id\n invoiceNumber\n paymentNumber\n createdAt\n amount\n appliedFromAdvance\n }\n }\n}",
"variables": {
"input": {
"allocationIds": [
"id"
],
"paymentId": "id"
}
}
}
EOF
Variables:
{
"input": {
"allocationIds": [
"id"
],
"paymentId": "id"
}
}
Response:
{
"data": {
"reversePaymentAllocations": {
"id": "id",
"checkNumber": "string",
"currencyCode": "string",
"paymentNumber": "string",
"referenceNumber": "string",
"status": "APPROVED",
"allocations": [
{
"id": "id",
"invoiceNumber": "string",
"paymentNumber": "string",
"createdAt": "2025-01-15T00:00:00Z",
"amount": 0,
"appliedFromAdvance": true
}
]
}
}
}
reversePaymentAllocations(
input: ReversePaymentAllocationsInput!
): Payment!
Arguments
reversePaymentAllocations.input ● ReversePaymentAllocationsInput! non-null input
The payment and the allocations to reverse.
Type
Payment object
A payment made out to a vendor or a collection received from a customer, with its allocations to invoices.