ChargebeeAPI

Refund an invoice

Idempotency Supported
Try in API Explorer

Refunds online payments or online refundable credit notes applied to an invoice.

If multiple transactions or credit note allocations are associated with the invoice, the refund can be processed only for one transaction or allocation at a time. The refund amount is returned to the customer through the payment_source associated with the transaction.

For recording offline refunds, including those for linked_taxes_withheld, use the Record refund for an invoice API.

Prerequisites & Constraints

  • The invoice must have a refundable amount derived from online transactions. The refundable amount = (the total amount paid on the invoice via online payments) + (allocations on the invoice from refundable credit notes that were created from online payments) - (any amount already refunded from the invoice)
  • There must be no linked_payments with a status of in-progress.
  • Partial refunds can be processed only if the associated payment gateway supports partial refund operations.
  • Ensure that all parameter-level requirements are met.

Impacts

Invoice
  • The invoice status does not change after this operation.
Credit note
  • A refundable credit note is created for the invoice to capture the refund details.

Implementation Notes

Before calling this API, ensure the following:

  • The invoice must have a refundable amount derived from online transactions.
    The refundable amount is calculated as:
    linked_payments[].amount for online payments + applied_credits[].applied_amount - issued_credit_notes[].cn_total
  • There must be no linked_payments with a status of in-progress.
  • All parameter-level requirements are met.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/invoices/{invoice-id}/refund

Input Parameters

refund_amount
optional, in cents, min=1

The amount to be refunded.

Constraints

Default behavior

  • If not specified, the total refundable amount for this invoice derived from online transactions is implied. The refundable amount is calculated as: (the total amount paid on the invoice via online payments) + (allocations on the invoice from refundable credit notes that were created from online payments) - (any amount already refunded from the invoice).
comment
optional, string, max chars=300

Comment, if any, on the refund.

customer_notes
optional, string, max chars=2000

The Customer Notes to be filled in the Credit Notes created to capture this refund detail.

credit_note[0..n]
Parameters for credit_note
pass parameters as credit_note[<param name>]

Returns

invoiceInvoice object
Resource object representing invoice
transactionTransaction object
Resource object representing transaction
credit_noteCredit note object
Resource object representing credit_note