# Overview (/docs/developer-resources/guides/checkout-session/overview)

A Checkout Session is a short-lived object that creates a hosted checkout page for collecting payments on your behalf. Use it to accept payments quickly without building your own payment UI. You control the line items, available payment options, and where Monime returns the customer after payment.

## When to use Checkout Session

- You want a fast, secure way to accept payments with minimal UI work
- You need a hosted page that supports multiple payment methods out-of-the-box
- You want Monime to handle payment state, redirection, and receipt UI

## How it works

1. **Create a Checkout Session (server)**

   Your server calls the API with a name, one or more line items, and optional
   payment and redirect settings.

2. **Redirect customer**

   Redirect the customer to the hosted checkout URL returned in the session.

3. **Customer pays**

   The customer completes payment on Monime's secure page.

4. **Webhook + Return URL**

   Receive payment status via webhook and/or redirect back to your site.

### Session lifecycle

A session starts `pending` and ends in one of three states.

```mermaid
stateDiagram-v2
    direction LR
    [*] --> pending: Create session
    pending --> completed: Customer pays
    pending --> cancelled: Customer cancels
    pending --> expired: Expiry time passes
    completed --> [*]
    cancelled --> [*]
    expired --> [*]
```

Each final state has a matching webhook event: `checkout_session.completed`, `checkout_session.cancelled` and `checkout_session.expired`.

## Quick start

- [**Create Session API**](/apis/versions/caph-2025-08-23/checkout-session/create-checkout-session)

  Create a new checkout session from your backend

- [**Retrieve Session**](/apis/versions/caph-2025-08-23/checkout-session/get-checkout-session)

  Look up a session to check its latest status

- [**List Sessions**](/apis/versions/caph-2025-06-20/checkout-session/list-checkout-sessions)

  Browse sessions for reporting or debugging

## Key session fields

**lineItems**

One or more products or services. Each custom item supplies a name, quantity,
and price containing a currency and minor-unit value. Monime derives the
session total from these items.

**paymentOptions**

Optional controls for disabling payment methods such as card, bank, or mobile
money for this checkout.

**successUrl / cancelUrl**

Optional absolute URLs for successful completion and customer cancellation.
Monime sends a `POST` request to `successUrl`; use that server endpoint to
verify the session before redirecting to your success UI.

**callbackState**

Optional opaque correlation data returned through the callback. It is not
exposed by read APIs.

**metadata**

Optional key/value pairs you can use to store order identifiers or context.

## Webhooks

We recommend handling payment lifecycle events using webhooks to ensure your system is updated even if the customer closes the browser before redirecting.

- [**Webhook Overview**](/docs/developer-resources/guides/webhook/introduction)

  Learn how webhooks work on Monime

- [**HMAC Verification**](/docs/developer-resources/guides/webhook/hmac-verification)

  Verify webhook signatures securely

## Environments: Test vs Live

Use Test mode for development and Live for production. Tokens, behavior, and prefixes differ between environments.

> **Info:** See [API Basics → Environments](/docs/developer-resources/api-basics/environment) and
> [Standard Headers](/docs/developer-resources/api-basics/api-headers) for details.

## Next steps

- [**Build with Next.js**](/docs/developer-resources/guides/checkout-session/create-checkout-session-nextjs)

  End-to-end example using Next.js API routes

- [**API Reference**](/apis/versions/caph-2025-06-20/checkout-session/object)

  Explore the Checkout Session object and full API
