You are viewing the documentation for the older version of our API (V1). Click here for information on upgrading to the latest version (V2).
You are viewing the documentation for the older version of our API (V1). Click here for information on upgrading to the latest version (V2).

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

Sample payment intent [ JSON ]

{ "amount": 5000, "created_at": 1517479728, "currency_code": "USD", "expires_at": 1517481528, "gateway": "chargebee", "gateway_account_id": "gw___test__3Nl9RGqRcPqUhf2", "id": "__test__3Nl9RLTRcPqUp95T__test__RPn0gcdsvkZRdHYu1mDu93JGuGAxcdJYGz", "modified_at": 1568801328, "object": "payment_intent", "status": "inited" }
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.expiredIntent has expired, since it was not consumed before the predefined time-out.
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.
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.
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, max chars=null
Gateway associated with the PaymentIntent.
active_payment_attempt
Show attributes[+]
optional, payment_attempt
Active payment attempt for the PaymentIntent.
Active payment attempt attributes
id
optional, string, max chars=70
Identifier for PaymentIntent's active payment attempt.
status
enumerated string
Current status of active payment attempt
Possible values are
initedPayment attempt is initialized.requires_identificationCustomer's device fingerprint is used to verify their identity. It needs to be sent to the Issuing Bank for verification.requires_challengeThe transaction has to go through 3DS Challenge flow and the customer needs to authenticate via 3DS 2.0requires_redirectionThe transaction has to go through 3DS Redirection flow and the customer needs to authenticate via 3DS 1.0authorized3DS verification successfully completed.refused3DS verification attempt failed.pending_authorizationWaiting for the authorization.
id_at_gateway
optional, string, max chars=50
Reference of PaymentIntent at gateway
error_code
optional, string, max chars=100
Error code received from the payment gateway on failure.
error_text
optional, string, max chars=65k
Error message received from the payment gateway on failure.
created_at
timestamp(UTC) in seconds
Timestamp indicating when the active payment attempt was created.
modified_at
timestamp(UTC) in seconds
Timestamp indicating when the active payment attempt was last modified.

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.

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

Sample Response [ JSON ]

Show more...
{"payment_intent": { "amount": 5000, "created_at": 1517479728, "currency_code": "USD", "expires_at": 1517481528, "gateway": "chargebee", "gateway_account_id": "gw___test__3Nl9RGqRcPqUhf2", "id": "__test__3Nl9RLTRcPqUp95T__test__RPn0gcdsvkZRdHYu1mDu93JGuGAxcdJYGz", "modified_at": 1568801328, "object": "payment_intent", "status": "inited" }}

URL Format POST

https://{site}.chargebee.com/api/v1/payment_intents
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.
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.
always returned
Resource object representing payment_intent

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

Sample Request
curl  https://{site}.chargebee.com/api/v1/payment_intents/__test__3Nl9RLTRcPqe8S5U__test__TvxVbiOu9KZfwtvCm36CX8lpqmeqUSEM \
     -u {site_api_key}:\
     -d amount=4000 \
     -d currency_code="USD"
copy
curl  https://{site}.chargebee.com/api/v1/payment_intents/__test__3Nl9RLTRcPqe8S5U__test__TvxVbiOu9KZfwtvCm36CX8lpqmeqUSEM \
     -u {site_api_key}:\
     -d amount=4000 \
     -d currency_code="USD"

Sample Response [ JSON ]

Show more...
{"payment_intent": { "amount": 4000, "created_at": 1517479764, "currency_code": "USD", "expires_at": 1517481564, "gateway": "chargebee", "gateway_account_id": "gw___test__3Nl9RDTRcPqczp2", "id": "__test__3Nl9RLTRcPqe8S5U__test__TvxVbiOu9KZfwtvCm36CX8lpqmeqUSEM", "modified_at": 1568801376, "object": "payment_intent", "status": "inited" }}

URL Format POST

https://{site}.chargebee.com/api/v1/payment_intents/{payment_intent_id}
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.
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.
always returned
Resource object representing payment_intent

Retrieves the PaymentIntent resource.

Sample Request
curl  https://{site}.chargebee.com/api/v1/payment_intents/__test__3Nl9RLTRcPqLy55S__test__ZyvWdyZ0cdD963AnCrZivHu2oFQFo8OJU \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v1/payment_intents/__test__3Nl9RLTRcPqLy55S__test__ZyvWdyZ0cdD963AnCrZivHu2oFQFo8OJU \
     -u {site_api_key}:

Sample Response [ JSON ]

Show more...
{"payment_intent": { "amount": 5000, "created_at": 1517479694, "currency_code": "USD", "expires_at": 1517481494, "gateway": "chargebee", "gateway_account_id": "gw___test__3Nl9RGbRcPqLrS2", "id": "__test__3Nl9RLTRcPqLy55S__test__ZyvWdyZ0cdD963AnCrZivHu2oFQFo8OJU", "modified_at": 1568801294, "object": "payment_intent", "status": "inited" }}

URL Format GET

https://{site}.chargebee.com/api/v1/payment_intents/{payment_intent_id}
always returned
Resource object representing payment_intent