ChargebeeAPI

Collect payment for an invoice

Idempotency Supported

Important:

  • Storing card after successful 3DS completion is not supported in this API. Use create using Payment Intent API under Payment source to store the card after successful 3DS flow completion.
  • This endpoint returns an error if a payment is initiated for an invoice with a status of payment_due associated with the app_store and play_store channels.

This API is used to collect payments for payment_due and not_paid invoices. If no payment methods are present for the customer or if the payment is unsuccessful, the corresponding error will be thrown. Pass authorization_transaction_id to capture the already blocked funds to collect payments. Note that if the invoice due amount is greater than the authorized amount, the invoice status is returned as payment_due.

The authorization transaction will not be captured if the fraud status is found as suspicious. This api will result in invalid_state_for_request error. Read more on fraud management using Stripe Radar .

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/invoices/{invoice-id}/collect_payment

Input Parameters

amount
optional, in cents, min=1

Amount to be collected. If this parameter is not passed then the entire amount due will be collected.

authorization_transaction_id
optional, string, max chars=40

Authorization transaction to be captured.

payment_source_id
optional, string, max chars=40

Payment source to be used for this payment.

comment
optional, string, max chars=300

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 .

payment_initiator
optional, enumerated string

The type of initiator to be used for the payment request triggered by this operation.

Possible Enum Values
customer

Pass this value to indicate that the request is initiated by the customer

merchant

Pass this value to indicate that the request is initiated by the merchant

Returns

invoiceInvoice object
Resource object representing invoice
transactionTransaction object
Resource object representing transaction