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.
- Noun
- Invoice
- Mode
do- Event
Invoice.refunded
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
invoice | Invoice | required | The paid Invoice. |
amount | money | The amount. Defaults to the full payment; pro rata takes the unused part of the Period. | |
reason | text | required | Why the money goes back, kept on the Invoice. |
Outputs
| Output | Type | Required | Description |
|---|---|---|---|
invoice | Invoice | required | The 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
sendanddomodes. - 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
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use 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 open | refused | Clear what the check names, then call it again. | Invoice.refund |
When it waits
| Gate | Default |
|---|---|
| Decision class | Medium: one-way, bounded (money, customer) |
| Delay window | 1 business hour, in which a watcher can pause, redirect or cancel it; then it runs. |
| Limit | The spend Limit of the Permission or Mandate it runs under. |
| Over the Limit | It 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. |