> For the complete documentation index, see [llms.txt](https://bagelpay.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bagelpay.gitbook.io/docs/documentation/developers-and-api-usage/checkout-session.md).

# Checkout Session

The **Checkout Session API** provides a simple and secure way to initiate and manage a customer’s payment flow through our Payment Gateway.

A checkout session represents a single transaction attempt, encapsulating all the necessary details such as the products or services being purchased, their prices, customer information, payment methods, and any applicable taxes or discounts.

By creating a checkout session, merchants can quickly generate a hosted, PCI‑compliant payment page or an embeddable checkout interface. The customer is then redirected or presented with this interface to review their order and complete payment. Once the payment is processed, the Checkout Session API returns a status update and relevant transaction data, enabling seamless order fulfillment and reconciliation.

**Typical Flow:**

1. **Create Checkout Session** → Define items, amounts, currency, and customer data.
2. **Obtain Checkout URL or Token** → Redirect the customer or embed the payment widget in your app/site.
3. **Customer Completes Payment** → Via card, wallet, bank transfer, or other supported methods.
4. **Receive Payment Result** → Via API response or webhook for order processing.

<figure><img src="/files/UjopII5f6hvLsr39ODIq" alt=""><figcaption></figcaption></figure>

## Endpoints Overview <a href="#endpoints-overview" id="endpoints-overview"></a>

<table><thead><tr><th width="305.6573486328125">Action</th><th width="72.2572021484375">Method</th><th>Description</th></tr></thead><tbody><tr><td><a href="/spaces/1gWORzV7KtXfPEcg6vHT/pages/0dfc7b9d25f84b79f84d7fbbb7ac94e9a6427e1f#post-api-payments-checkouts">Create Checkout Session</a></td><td><code>POST</code></td><td>Create a <code>singple-pay</code> or <code>subscription</code> checkout session with a product ID.</td></tr></tbody></table>

{% hint style="info" %}
This guide provides instructions for utilizing the API in Test Mode. To transition to Live Mode, please refer to the following endpoint: [https://live.bagelpay.io](https://live.bagelpay.io/)
{% endhint %}
