Skip to content

Invoice.refund

POST /{namespace}/invoices/{invoice}/refund

Refund returns all or part of a paid Invoice to the Customer’s original payment method and posts the reversing Entries.

Mode
do
Event
Invoice.refunded

Inputs

InputTypeRequiredDescription
invoiceInvoicerequiredThe paid Invoice.
amountmoneyThe amount. Defaults to the full payment; pro rata takes the unused part of the Period.
reasontextrequiredWhy the money goes back, kept on the Invoice.

Outputs

OutputTypeRequiredDescription
invoiceInvoicerequiredThe Invoice, with its refunded amount.

Effects

  • Emits Invoice.refunded.
  • Performed by the Billing Specialist.
  • One-way (money, customer): it waits out its delay window, and runs in the send and do modes.
  • Checks the refund Limit; above it, opens an Approval for the Finance Lead and the Action waits.
  • Waits the refund delay window before the money moves.
  • Refuses while a Dispute on the Invoice is open.
  • Returns money to the original payment only, never to a balance.
  • Adds the amount to the Invoice’s refunded total.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.Invoice.refund
A Dispute on the Invoice is openrefusedClear what the check names, then call it again.Invoice.refund

When it waits

GateDefault
Decision classMedium: one-way, bounded (money, customer)
Delay window1 business hour, in which a watcher can pause, redirect or cancel it; then it runs.
LimitThe spend Limit of the Permission or Mandate it runs under.
Over the LimitIt waits pending for an Approval from the Finance Lead. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled.