Payment reversal
Reverse a payment while preserving the original record and its audit trail. The invoice balance reflects the reversal and integrations receive the corresponding event.
A payment that came back — a returned SEPA direct debit, a card chargeback, a
dishonoured bill — now has a first-class way to be recorded, and the invoice it
paid goes back into the collection circuit instead of staying paid for ever.
See Recording payments.
- New operation —
POST /v1/invoices/{id}/payments/{payment_id}/reversalvoids one payment of a sales invoice, stating areasonfrom a closed catalog (direct_debit_return,card_dispute,misapplied_payment,bounced_effect,recording_error) and an optionalnote. It returns200with the already-reverted payment. Scope:invoices:write— there is nopayments:*scope family. - The payment is never deleted — it keeps its amount, date, method and
reference, and gains
is_reversed,reversed_at,reversal_reason,reversal_reason_textandreversal_note, all five now published on every payment of an invoice. A reverted payment stays in the ledger: readis_reversed, never infer a reversal from an entry disappearing. - The invoice returns to the collection circuit — a reverted amount stops
counting towards
paid_amountandpending_amount, so apaidinvoice becomesoverdueif its due date has passed andsentotherwise, and takes a new payment again. Only the ledger can produce that transition: the generic status-change endpoint still cannot move an invoice out ofpaid. - New event
payment.reversed— closes the cycle thatpayment.receivedleft half-told. Itsdata.reversalcarries thereasonand anorigin(gatewaywhen the provider reported the return,manualwhen a person recorded it). See Events. - New MCP tool
revert_invoice_payment— the agent-side mirror of the route, sameinvoices:writescope. See the tools catalog. - Three new error codes, all
422:payment_already_reversed,payment_reversal_reason_invalidandpayment_reversal_invalid.
Reverting is not correcting. A returned receipt means the customer got their money back without the operation shrinking: the debt survives and there is nothing to correct. A genuine refund does reduce revenue and keeps its corrective invoice. A returned receipt is also not the bad-debt case of art. 80.Cuatro LIVA, which has its own formal requirements. See Reversal or corrective invoice?.
Contract correction (generated clients). POST /v1/invoices/{id}/payments
and GET /v1/invoices/{id}/payments used to publish the invoice schema in
the OpenAPI spec, inherited from the path prefix, where the API actually
returns a payment — and the list announced a single object instead of an
array. Both now publish InvoicePaymentDetail (an array for the list). No
response changed on the wire: this is a documentation fix, not a breaking
change, since no typed integration could have worked against the previous
type. If you use a generated SDK or the CLI, regenerate it — your model for
these two operations will change.
New endpoints1
| Endpoint | Description |
|---|---|
POST/v1/invoices/{invoice}/payments/{payment}/reversal | Revert an invoice payment |