This section explains the payment flows (session_type) supported by Payment Sessions.
Each flow represents a different checkout intent, such as collecting a one-time payment, saving a payment method, or doing both in a single interaction.
All flows described below work with both Payment Session interfaces:
Payment Link (hosted by Xendit)
Components Mode (embedded into your checkout UI)
You choose the flow by setting the appropriate session_type when creating a Payment Session.
One-Time Payment (PAY)
This mode is used for single payment where customer is present, choose payment method and pays immediately. NNo payment method is stored after the transaction is completed.
User Journey
Checkout: Customer clicks “Buy Now” on your site
Selection: Customer is presented with avaialble payment methods
Payment: Customer process the required actions to authorize the payment
Completion: Customer is redirected back to your site page
It is best for business with one off transaction (e.g., one-off purchases, e-commerce checkouts, event tickets or digital goods)
Save Payment Method (SAVE)
Use this mode when you want to securely save a customer’s payment method (tokenization) without charging them immediately. This is often done during sign-up or inside a “My Account” settings page in your application.
User Journey
Setup: Customer clicks “Add Payment Method” in their profile
Verification: Customer enter card/account details and proceed the verification process based on the payment method
Tokenization: Xendit securely stores the payment method details and returns
payment_token_idto youReady: Customer is ready to make future purchases later
It is best for building a frictionless subscription onboarding, auto-debit setup, or saving cards for faster future checkout.
Pay and Save (PAY)*
This flow uses the PAY session type and allows you to optionally or mandatorily save the customer’s payment method during a payment.
The behavior is controlled by the allow_save_payment_method parameter when creating a Payment Session.
User Journey
Transaction: Customer pays for their first order.
Consent: A checkbox to optionally save the payment method, or a forced pay and save depending on your use case
Find more details on these differences in here
Execution: Xendit processes the payment and generates payment token simultaneously.
Outcome: The current order is paid, and Xendit securely stores the payment method details and return
payment_token_idto you. You can use thepayment_token_idfor subsequent transaction either Merchant-initiated or Customer-initiated flow using Payment API integration.
Payment Mode Comparison
Feature | One-Time Payment | Save Payment Method | Pay and Save |
|---|---|---|---|
Immediate Charge | Yes | No | Yes |
Token Generated | No | Yes | Yes |
Future Charges | Need to create new payment link | Merchant-initiated or Customer-initiated transactions | Merchant-initiated or Customer-initiated transactions |