ChargebeeAPI

Create a payment intent

Idempotency Supported
Try in API Explorer

Creates a PaymentIntent object. This is to be used with Chargebee.js API to complete the 3DS flow for new or stored cards.

While creating, specify the appropriate gateway account and amount. Exact amount can be estimated using our Estimate API.

Customer resource lookup and creation

When customer[id] is provided for this operation, it is looked up by Chargebee, and if found, the payment_intent is created for it. If not found, the payment_intent is created without any customer association and will be available for any customer.

Multiple business entities

If multiple business entities are created for the site, the customer resource lookup and creation happen within the context of the business entity specified in this API call. If no business entity is specified, the customer resource lookup is performed within the site context, and if not found, the resource is created for the default business entity of the site.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/payment_intents

Input Parameters

business_entity_id
optional, string, max chars=50

Sets the context for this operation to the business entity specified. Applicable only when multiple business entities have been created for the site. When this parameter is provided, the operation is able to read/write data associated only to the business entity specified. When not provided, the operation can read/write data for the entire site.

Note

An alternative way of passing this parameter is by means of a custom HTTP header.

customer_id
optional, string, max chars=50

The unique identifier of the customer for whom the payment_intent will be created. If specified, the payment_intent will be used exclusively for that customer. If not specified, the payment_intent won't be associated with any customer and will be available for any customer.

amount
required, in cents, min=0

Amount(in cents) to be authorized for 3DS flow.

currency_code
required, string, max chars=3

The currency code (ISO 4217 format) of the amount used in transaction.

gateway_account_id
optional, string, max chars=50

The gateway account used for performing the 3DS flow.

reference_id
optional, string, max chars=200

Reference for payment method at gateway. Only applicable when the PaymentIntent is created for cards stored in the gateway.

payment_method_type
optional, enumerated string, default=card

The payment method of this intent.

Possible Enum Values
card

card

ideal

ideal

sofort

sofort

bancontact

bancontact

google_pay

google_pay

success_url
optional, string, max chars=250

The URL the customer will be directed to once 3DS verification is successful. Applicable only when payment_method_type is ideal , sofort , dotpay or giropay .

failure_url
optional, string, max chars=250

The URL the customer will be directed to when 3DS verification fails. Applicable only when payment_method_type is ideal , sofort , dotpay or giropay .

Returns

payment_intentPayment intent object

Resource object representing payment_intent