The refund resource allows refunds on settled invoices/charges. Multiple refunds (depending on payment method) can be created for an invoice but only up to the settled amount can be refunded. A successful refund will result in a credit note attached to the invoice. Amount is optional and can be specified either as a single amount or as a list of credit note lines which optionally can be linked to the order lines on the invoice.
The refund resource allows the use of an idempotency key to safely retry the same request multiple times. Multiple calls with the same key will yield the same result with no risk of money being moved twice. This is convenient in cases of network outages where the result of a call is not received. In this case the same call can be retried.
The result of a refund can be monitored using webhooks by listening for the following event: invoice_refund
. The webhook will contain a transaction
reference which is the same as the refund id. The details of the refund can be retrieved by getting the refund using this id.
A refund is normally performed as an online refund using the settled transaction, e.g. a credit card transaction where money is transferred back to the card. A refund can optionally instead be an offline manual refund. An offline manual refund could for example be a bank transfer or chargeback handled outside Billwerk+Optimize and not automatically by Billwerk+Optimize. For an invoice settled with a manual transfer, a refund must be an offline manual refund.
For some payment methods other than credit card, the refund operation can be asynchronous meaning that the result of the operation is not known right away. In this case the returned state for the refund will be processing
. The result of the operation will be given by webhooks. The event will either be invoice_refund
or invoice_refund_failed
. Notice that the event invoice_refund_failed
is only sent in the asynchronous case.