Save bank details for future payments
This guide describes how to save shopper's bank details and use it for subsequent payments.
Save bank details for the first time
- Call Create a Customer API if it is a new customer and save the returned Customer ID.
Example request:
Example response:
- Create a PaymentConsent API with the Customer ID from Step 1, and save Consent ID for subsequent transactions. Note that a payment consent can be created without providing a payment method immediately. You can update payment_consents API to attach payment_method later on.
Example request:
Example response:
- Verify payment_consents API through a transaction authorization or verification. You have 2 options to get the payment consent verified
Option 1: Save bank account details without a payment
The shopper only attaches the bank account details for future payments.
Plaid verification
Example request:
Example response:
Micro deposit verification
Example request:
Example response:
Micro deposit + micro debit verification
Example request:
Example response:
Option 2: Save bank account details during payment
The shopper pays for the first order and attaches the bank account details for future payments. You can Create a PaymentIntent API and Confirm a PaymentIntent API with payment_consent_reference
from Step 2. This will return SUCCEEDED
status for the first payment if the verification is successfull.
Example request:
Example response:
Plaid verification
Example request:
Example response:
Micro deposit verification
Example request:
Example response:
Successful verification will result in the status of payment consent changed to VERIFIED
. If the payment consent is not verified, the status will stay as PENDING_VERIFICATION
, and next_action
will appear in the response.
Initiate a subsequent transaction using stored bank account details
- Create a PaymentIntent API with the corresponding
Customer ID
.
Example request:
Example response:
- Confirm a PaymentIntent API with
payment_consent_reference.id
to request payment with reference to the stored PaymentConsent.
Example request:
Example response:
- You can also get a list of PaymentConsents API with the corresponding
Customer ID
to render the list of shopper’s payment methods they previously saved.
Example request:
Example response: