ChargebeeAPI

Refund a credit note

Idempotency Supported
Try in API Explorer

Refunds a specified amount from a refundable credit note back to the customer's payment source.

This operation supports only refunds against online payments. The refund amount is returned to the customer through the payment_source associated with the transaction. If multiple transactions are associated with the credit note, call this API once for each transaction.

To record offline refunds, including those for linked_taxes_withheld, use the Record refund for a credit note API.

Prerequisites & Constraints

  • The credit note type is refundable.
  • The credit note status is refund_due.
  • The credit note has an amount_available greater than 0.
  • Part or all of the credit note's amount_available is from online payments.
  • The credit note is not standalone; it has an associated invoice.
  • You can process partial refunds only if the associated payment gateway supports partial refund operations.

Impacts

Credit note

  • The credit note's amount_available is reduced by the refunded amount.
  • The credit note's status is updated to refunded if the refunded amount is equal to the credit note's amount_available.
  • The credit note's linked_refunds is updated with the details of the refund transaction.

Transaction

Chargebee creates a transaction of type refund and links it to the credit note under credit_note.linked_refunds.

Implementation Notes

Before you call this API, make sure the following conditions are met:

  • The credit note type is refundable.
  • The credit note status is refund_due.
  • The credit note has an amount_available greater than 0.
  • The credit note has the reference_invoice_id set.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/credit_notes/{credit-note-id}/refund

Input Parameters

refund_amount
optional, in cents, min=1

The amount to be refunded.

Constraints

Default behavior

  • If not specified, the amount_available for this credit note is implied.
customer_notes
optional, string, max chars=2000

A note to be added for this operation, to the credit note. This note is displayed on customer-facing documents such as the Credit Note PDF .

refund_reason_code
optional, string, max chars=100

Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Credit Notes > Refund Credit Note. Must be passed if set as mandatory in the app. The codes are case-sensitive.

Returns

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