How payment sessions work

Prev Next

Payment Session API is a simplified solution for accepting payments and managing your customers’ payment methods through a Xendit-hosted checkout page. It allows you to collect one-time, customer-present payments or securely save a customer’s payment method for future use - all with minimal integration effort.

Payment Session supports three key use cases:

  • One-Time Payment – Collect a single payment where the customer is present.

  • Save Payment Method – Let customers securely save their payment method for future transactions.

  • Pay and Save – Collect the payment and save the end user’s payment information at the same time in a bundled flow.

All Payment Sessions use a Xendit-hosted checkout page to ensure secure, compliant, and consistent user experiences.

Solution Overview

Payment Session simplifies payment collection and payment method management through a Xendit-hosted checkout page. Depending on your use case, the flow can be either One-Time Payment, Save Payment Method or Pay and Save.

  1. Create a Payment Session from your server for either a One-Time Payment or to Save Payment Method to get Xendit’s payment_link_url.

  2. Redirect your customer to the Xendit-hosted page using the payment_link_url.

  3. The customer will enter payment details and confirms the transaction inside Xendit-hosted checkout page

  4. Payment Flow

    • One-Time Payment: Xendit processes the payment and sends a webhook payment.capture or payment.failed). Your system updates the order.

    • Save Payment Method: Xendit links the payment method and sends a webhook payment_token.activation). Your system stores the Payment Token for future charges.

    • Pay and Save Method: Xendit processes the payment & links the payment method for successful payment payment.capture & payment_token.activation, and payment.failed). Your system updates the order and stores the Payment Token for future charges.

  5. Future Charges (Optional for Pay and Save and Save Payment Method)

Key Notes: All flows use a Xendit-hosted page for secure, PCI-compliant handling of payment details.