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": 1517483707, "currency_code": "USD", "expires_at": 1517494507, "gateway": "chargebee", "gateway_account_id": "gw___test__3NlA8cwRWwyhgY2", "id": "__test__3NlA8jCRWwyhx41__test__3qnzGW9jVRzuOvmC8ShAFcdFugk0KZupw", "modified_at": 1563794107, "object": "payment_intent", "status": "inited" }
id
Identifier for PaymentIntent.
string, max chars=150
status
Current status of PaymentIntent.
enumerated string
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.
amount
Amount(in cents) to be authorized for 3DS flow.
in cents, min=0
gateway_account_id
The gateway account used for performing the 3DS flow.
string, max chars=50
expires_at
Timestamp indicating when the PaymentIntent will expire if left unconsumed.
timestamp(UTC) in seconds
reference_id
Reference for payment method at gateway. Only applicable when the PaymentIntent is created for cards stored in the gateway.
optional, string, max chars=200
created_at
Timestamp indicating when the PaymentIntent was created.
timestamp(UTC) in seconds
modified_at
Timestamp indicating when the PaymentIntent was last modified.
timestamp(UTC) in seconds
customer_id
Identifier of the customer associated with the PaymentIntent. Applicable only if it’s an existing customer in Chargebee.
string, max chars=50
gateway
Gateway associated with the PaymentIntent.
optional, string, max chars=null
active_payment_attempt
Show attributes[+]
Active payment attempt for the PaymentIntent.
optional, payment_attempt
Active payment attempt attributes
id
Identifier for PaymentIntent's active payment attempt.
optional, string, max chars=70
status
Current status of active payment attempt.
enumerated string
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.0.requires_redirectionThe transaction has to go through 3DS Redirection flow and the customer needs to authenticate via 3DS 1.0.authorized3DS verification successfully completed.refused3DS verification attempt failed.
id_at_gateway
Reference of PaymentIntent at gateway.
optional, string, max chars=50
error_code
Error code received from the payment gateway on failure.
optional, string, max chars=100
error_text
Error message received from the payment gateway on failure.
optional, string, max chars=65k
created_at
Timestamp indicating when the active payment attempt was created.
timestamp(UTC) in seconds
modified_at
Timestamp indicating when the active payment attempt was last modified.
timestamp(UTC) in seconds

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/v2/payment_intents \
     -u {site_api_key}:\
     -d amount=5000 \
     -d currency_code="USD"
copy
curl  https://{site}.chargebee.com/api/v2/payment_intents \
     -u {site_api_key}:\
     -d amount=5000 \
     -d currency_code="USD"

Sample Response [ JSON ]

Show more...
{"payment_intent": { "amount": 5000, "created_at": 1517483707, "currency_code": "USD", "expires_at": 1517494507, "gateway": "chargebee", "gateway_account_id": "gw___test__3NlA8cwRWwyhgY2", "id": "__test__3NlA8jCRWwyhx41__test__3qnzGW9jVRzuOvmC8ShAFcdFugk0KZupw", "modified_at": 1563794107, "object": "payment_intent", "status": "inited" }}

URL Format POST

https://{site}.chargebee.com/api/v2/payment_intents
customer_id
Identifier of the customer associated with the PaymentIntent. Applicable only if it’s an existing customer in Chargebee.
optional, string, max chars=50
amount
Amount(in cents) to be authorized for 3DS flow.
required, in cents, min=0
currency_code
The currency code (ISO 4217 format) of the currency used in transaction.
required, string, max chars=3
gateway_account_id
The gateway account used for performing the 3DS flow.
optional, string, max chars=50
reference_id
Reference for payment method at gateway. Only applicable when the PaymentIntent is created for cards stored in the gateway.
optional, string, max chars=200
Resource object representing payment_intent.
always returned

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/v2/payment_intents/__test__3NlA8jCRWwyiA05__test__30rJjmMBzh7ND0WNb8PlRbAkCavhAEmN \
     -u {site_api_key}:\
     -d amount=4000 \
     -d currency_code="USD"
copy
curl  https://{site}.chargebee.com/api/v2/payment_intents/__test__3NlA8jCRWwyiA05__test__30rJjmMBzh7ND0WNb8PlRbAkCavhAEmN \
     -u {site_api_key}:\
     -d amount=4000 \
     -d currency_code="USD"

Sample Response [ JSON ]

Show more...
{"payment_intent": { "amount": 4000, "created_at": 1517483708, "currency_code": "USD", "expires_at": 1517494508, "gateway": "chargebee", "gateway_account_id": "gw___test__3NlA8cwRWwyhgY2", "id": "__test__3NlA8jCRWwyiA05__test__30rJjmMBzh7ND0WNb8PlRbAkCavhAEmN", "modified_at": 1563794108, "object": "payment_intent", "status": "inited" }}

URL Format POST

https://{site}.chargebee.com/api/v2/payment_intents/{payment_intent_id}
amount
Amount(in cents) to be authorized for 3DS flow.
optional, in cents, min=0
currency_code
The currency code (ISO 4217 format) of the currency used in transaction.
optional, string, max chars=3
gateway_account_id
The gateway account used for performing the 3DS flow.
optional, string, max chars=50
Resource object representing payment_intent.
always returned
Retrieves the payment intent resource.
Sample Request
curl  https://{site}.chargebee.com/api/v2/payment_intents/__test__3NlA8jCRWwyi8C3__test__FjgwchkUKEPtGwdjEiJOfdlFp9CmdOoa \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/payment_intents/__test__3NlA8jCRWwyi8C3__test__FjgwchkUKEPtGwdjEiJOfdlFp9CmdOoa \
     -u {site_api_key}:

Sample Response [ JSON ]

Show more...
{"payment_intent": { "amount": 5000, "created_at": 1517483708, "currency_code": "USD", "expires_at": 1517494508, "gateway": "chargebee", "gateway_account_id": "gw___test__3NlA8cwRWwyhgY2", "id": "__test__3NlA8jCRWwyi8C3__test__FjgwchkUKEPtGwdjEiJOfdlFp9CmdOoa", "modified_at": 1563794108, "object": "payment_intent", "status": "inited" }}

URL Format GET

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