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, then the status of the appropriate schedule_entries[].status is updated to paid.
Related APIs
Record an offline payment
Sample Request
URL Format
Input Parameters
Amount to be collected.
Constraints
- Must be less than or equal to the
invoice.amount_to_collector thetransaction.amountifauthorization_transaction_idis passed, whichever is lesser.
Default value
- When not passed, then
invoice.amount_to_collectis assumed.
The id of a valid payment_source associated with the customer.
Required if
authorization_transaction_idis not passed.
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
Resource object representing transaction