Applies payment to a single invoice. You can either specify individual payment transactions as parameters, or Chargebee applies any available excess payments for that customer. If you specify individual transactions then any un-applied amount in those transactions will be used.
Prerequisites & Constraints
- The invoice's
statusmust bepayment_due,posted, ornot_paid. - The customer must have excess payments available.
Impacts
Invoice
Invoice's amount_due is updated to reflect the applied payment. If no amount remains, the invoice status becomes paid.
Transactions
When a payment is applied to an invoice, the amount_unused field of the associated transaction(s) is reduced accordingly.
Accounting Integrations
Synchronization to the accounting system will not proceed if the linked transaction contains a surplus balance.
Implementation Notes
Before calling this API, ensure the following:
- The
invoicestatus isnot_paid,payment_due, orposted. - Customer has excess_payments .
Sample Request
URL Format
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
Resource object representing invoice