Collects a specified amount of payment for an invoice, via a specified online payment method.
Offline payments
When there is no payment method available, and if you wish to record an offline payment, use the Record an offline payment API instead.
Prerequisites & Constraints
- The invoice
statusmust bepayment_due,posted, ornot_paid. - The invoice
channelmust not beapp_storeorplay_store. - The invoice's
amount_to_collectmust be greater than 0. - A valid
payment_sourcemust be associated with the customer.
Impacts
Invoice
- The invoice
statuschanges topaidif theamount_dueon the invoice becomes zero because of this payment. Otherwise, thestatusremains unchanged.
Payment Schedules
If a payment_schedule exists for the invoice:
- For a successful payment, Chargebee reduces
schedule_entries[].amountfor the entries the payment covers. An entry whose remaining amount reaches0is markedpaid. - Chargebee adds the payment to
reference_transactions[], including failed and in-progress attempts withapplied_amount0.
Related APIs
Record an offline payment
Sample Request
Sample Result[JSON]
URL Format
POST https://[site].chargebee.com/api/v2/invoices/{invoice-id}/collect_payment
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
Transaction object
Resource object representing transaction