Idempotency Supported
Applies a customer's refundable credits to a specified invoice.
You can either specify the credit notes to be applied, or let Chargebee apply the available credit notes automatically.
Prerequisites & Constraints
- The customer must have refundable credits available.
- The invoice
statusmust benot_paid,payment_due, orposted.
Impacts
Invoice
- The
amount_duedecreases by the amount of credits applied. - The invoice
status:- changes to
paidif the applied credits fully cover the amount due. - remains unchanged if the applied credits only partially cover the amount due.
- changes to
Credit Notes
The credit note status:
- changes to
refundedif the entirecredit_note.amount_availableis applied to the invoice. - remains
refund_dueif only part of thecredit_note.amount_availableis applied.
Implementation Notes
Before calling this API, make sure the following conditions are met:
customer.refundable_creditsis non-zero.- The invoice
statusisnot_paid,payment_due, orposted. - The
credit_note.customer_idmatches theinvoice.customer_id.
Sample Request
Sample Result[JSON]
URL Format
POST https://[site].chargebee.com/api/v2/invoices/{invoice-id}/apply_credits
Input Parameters
An internal comment to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing Hosted Page or any document such as the Invoice PDF .
Returns
Invoice object
Resource object representing invoice