API Version
Product Catalog
Library

A payment_intent is created to help you navigate the 3DS flow of collecting payment from your customer. It is necessary only for implementing 3DS flow using Chargebee.js.

Auto-expiry

All payment_intents with status as inited, in_progress or authorized become expired after an hour automatically.

Sample payment intent [ JSON ]

{ "amount": 5000, "created_at": 1517501515, "currency_code": "USD", "expires_at": 1517503315, "gateway": "chargebee", "gateway_account_id": "gw___test__KyVnGlSBWTQeudG", "id": "__test__KyVnHhSBWTQz2Cu__test__0DZayCQMcAwDkEIPpUrGwkiyL25s7W1X", "modified_at": 1517501515, "object": "payment_intent", "payment_method_type": "card", "status": "inited" }

API Index URL GET

https://{site}.chargebee.com/api/v2/payment_intents

Model Class

id
string, max chars=150
Identifier for PaymentIntent.
status
enumerated string
Current status of PaymentIntent.
Possible values are
initedIntent is initialized.in_progressStatus will be in_progress if the Active Payment Attempt state is in requires_identification, requires_challenge or requires_redirection.authorized3DS verification successfully completed.consumedIf any Chargebee operation such as create subscription etc. is completed using the intent, it will be in consumed state. Intent cannot be used if it's already in consumed state.
Show all values[+]
currency_code
optional, string, max chars=3
The currency code (ISO 4217 format) of the amount used in transaction.
amount
in cents, min=0
Amount(in cents) to be authorized for 3DS flow.
gateway_account_id
string, max chars=50
The gateway account used for performing the 3DS flow.
expires_at
timestamp(UTC) in seconds
Timestamp indicating when the PaymentIntent will expire if left unconsumed.
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 values are
cardcardidealidealsofortsofortbancontactbancontact
Show all values[+]
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.
created_at
timestamp(UTC) in seconds
Timestamp indicating when the PaymentIntent was created.
modified_at
timestamp(UTC) in seconds
Timestamp indicating when the PaymentIntent was last modified.
resource_version
optional, long
Version number of this resource. The resource_version is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
updated_at
optional, timestamp(UTC) in seconds
Timestamp indicating when this payment intent was last updated.
customer_id
string, max chars=50

The unique ID of the customer for which this payment_intent should be created. If not provided, a new customer is created and its ID is autogenerated.

gateway
optional, string
Gateway associated with the PaymentIntent.
business_entity_id
optional, string, max chars=50
The unique ID of the business entity of this payment_intent

active_payment_attempt
Show attributes [+]
optional, payment_attempt
Active payment attempt for the PaymentIntent.
id id
string, max chars=150
Identifier for PaymentIntent.
status status
enumerated string
Current status of PaymentIntent.
currency_code currency_code
optional, string, max chars=3
The currency code (ISO 4217 format) of the amount used in transaction.
amount amount
in cents, min=0
Amount(in cents) to be authorized for 3DS flow.
gateway_account_id gateway_account_id
string, max chars=50
The gateway account used for performing the 3DS flow.
expires_at expires_at
timestamp(UTC) in seconds
Timestamp indicating when the PaymentIntent will expire if left unconsumed.
reference_id 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 payment_method_type
optional, enumerated string, default=card
The payment method of this intent
success_url 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 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.
created_at created_at
timestamp(UTC) in seconds
Timestamp indicating when the PaymentIntent was created.
modified_at modified_at
timestamp(UTC) in seconds
Timestamp indicating when the PaymentIntent was last modified.
resource_version resource_version
optional, long
Version number of this resource. The resource_version is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
updated_at updated_at
optional, timestamp(UTC) in seconds
Timestamp indicating when this payment intent was last updated.
customer_id customer_id
string, max chars=50

The unique ID of the customer for which this payment_intent should be created. If not provided, a new customer is created and its ID is autogenerated.

gateway gateway
optional, string
Gateway associated with the PaymentIntent.
business_entity_id business_entity_id
optional, string, max chars=50
The unique ID of the business entity of this payment_intent

active_payment_attempt
optional, payment_attempt
Active payment attempt for the PaymentIntent.

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, a new customer resource is created with the ID provided, and the payment_intent is created.

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.

Notes

Sample Request
curl  https://{site}.chargebee.com/api/v2/payment_intents \
     -u {site_api_key}:\
     -d amount=5000 \
     -d currency_code="USD"
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "payment_intent": {
        "amount": 5000,
        "created_at": 1517501515,
        "currency_code": "USD",
        "expires_at": 1517503315,
        "gateway": "chargebee",
        "gateway_account_id": "gw___test__KyVnGlSBWTQeudG",
        "id": "__test__KyVnHhSBWTQz2Cu__test__0DZayCQMcAwDkEIPpUrGwkiyL25s7W1X",
        "modified_at": 1517501515,
        "object": "payment_intent",
        "payment_method_type": "card",
        "status": "inited"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/payment_intents

Method

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 ID of the customer for which this payment_intent should be created. If not provided, a new customer is created and its ID is autogenerated.

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 values are
cardcardidealidealsofortsofortbancontactbancontact
Show all values[+]
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.
payment_intent payment_intent
always returned
Resource object representing payment_intent

Sample admin console URL

https://{site}.chargebee.com/admin-console/payment_intents/123x

Updating properties on a PaymentIntent object. All the subsequent 3DS transaction attempts will have the updated values.

Notes

Sample Request
curl  https://{site}.chargebee.com/api/v2/payment_intents/__test__KyVnHhSBWTR3ZCw__test__6AP6PXGBruIztRxpb4L0Si0Rihcur2fil \
     -u {site_api_key}:\
     -d amount=4000 \
     -d currency_code="USD"
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "payment_intent": {
        "amount": 4000,
        "created_at": 1517501515,
        "currency_code": "USD",
        "expires_at": 1517503315,
        "gateway": "chargebee",
        "gateway_account_id": "gw___test__KyVnGlSBWTQeudG",
        "id": "__test__KyVnHhSBWTR3ZCw__test__6AP6PXGBruIztRxpb4L0Si0Rihcur2fil",
        "modified_at": 1517501515,
        "object": "payment_intent",
        "payment_method_type": "card",
        "status": "inited"
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/payment_intents/{payment-intent-id}

Method

amount[]
optional, in cents, min=0
Amount(in cents) to be authorized for 3DS flow.
currency_code[]
optional, 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.
payment_method_type[]
optional, enumerated string, default=card
The payment method of this intent.
Possible values are
cardcardidealidealsofortsofortbancontactbancontact
Show all values[+]
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.
payment_intent payment_intent
always returned
Resource object representing payment_intent

Sample admin console URL

https://{site}.chargebee.com/admin-console/payment_intents/123x

Retrieves the PaymentIntent resource.

Notes

Sample Request
curl  https://{site}.chargebee.com/api/v2/payment_intents/__test__KyVnHhSBWTR1HCv__test__5COaMLU3JrmJkDQKOFQqcdOocdusvy0UBl \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "payment_intent": {
        "amount": 5000,
        "created_at": 1517501515,
        "currency_code": "USD",
        "expires_at": 1517503315,
        "gateway": "chargebee",
        "gateway_account_id": "gw___test__KyVnGlSBWTQeudG",
        "id": "__test__KyVnHhSBWTR1HCv__test__5COaMLU3JrmJkDQKOFQqcdOocdusvy0UBl",
        "modified_at": 1517501515,
        "object": "payment_intent",
        "payment_method_type": "card",
        "status": "inited"
    }
}

URL Format GET

https://{site}.chargebee.com/api/v2/payment_intents/{payment-intent-id}

Method

payment_intent payment_intent
always returned
Resource object representing payment_intent

Sample admin console URL

https://{site}.chargebee.com/admin-console/payment_intents/123x