ChargebeeAPI

Collect payment for customer

Idempotency Supported
Try in API Explorer

Note: This operation optionally supports 3DS verification flow. To achieve the same, create the Payment Intent and pass it as input parameter to this API.

This API can be used to collect the payments for customer's payment_due and not_paid invoices. You can either choose to collect the payment from an existing payment source or a new payment source. You can choose to either retain or discard the new payment source, which is being used for payment. If the amount collected exceeds the invoice amount, the surplus will be counted in as excess payments.

Sample Request

URL Format

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

Input Parameters

amount
optional, in cents, min=0

Amount to be collected. If this parameter is not passed then the invoice(s) amount to collect will be collected.

payment_source_id
optional, string, max chars=40

Payment source used for the payment.

token_id
optional, string, max chars=40

Token generated by Chargebee JS representing payment method details.

replace_primary_payment_source
optional, boolean, default=false

Indicates whether the primary payment source should be replaced with this payment source. In case of Create Subscription for Customer endpoint, the default value is True. Otherwise, the default value is False.

retain_payment_source
optional, boolean, default=false

Indicates whether the payment source should be retained for the customer.

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

payment_method
optional, enumerated string

Parameters for payment_method

card
optional, string

Parameters for card

payment_intent
optional, string

Parameters for payment_intent

invoice_allocations
optional, string

Parameters for invoice_allocations

Returns

customerCustomer object

Resource object representing customer

transactionTransaction object

Resource object representing transaction