> ## Documentation Index
> Fetch the complete documentation index at: https://docs.waftpay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Checkout

> Create hosted checkout sessions, redirect customers, and handle callbacks.

Checkout provides a hosted payment page. You create a checkout session, redirect the customer to the `checkout_url` (or embed it in an iframe), and receive the final result on your `callback_url`.

***

## Quick flow

Authenticate -> Create checkout request -> Redirect user -> Receive callback -> (Optional) verify via status checks.

***

## Prerequisites

* Collections service enabled on your account.
* Product-scoped Bearer token from [Get Authentication Token](/api-reference/auth/auth-token). Cache the token and refresh only on expiry.
* A callback endpoint to receive the final status. See [Webhooks overview](/pages/webhooks/overview).

***

## Endpoint

**POST** `/checkout/api/v1/request`

Full reference: [Create Checkout Request API](/api-reference/checkout/checkout-request)

**Required headers**

```http theme={null}
Authorization: Bearer <token>
Content-Type: application/json
```

***

## Request body (example)

```json theme={null}
{
  "customer": {
    "first_name": "Amina",
    "other_names": "Kariuki",
    "email": "amina.kariuki@example.com",
    "phone_number": "254733112244"
  },
  "timestamp": "2025-11-18T09:45:30.540Z",
  "checkout_reference": "CHK623581942",
  "payment_reference": "INV20478519",
  "msisdn": "254711223344",
  "country": "KEN",
  "currency": "KES",
  "amount": 1750,
  "mode": "redirect",
  "callback_url": "https://webhook.site/aa2b85e4-1c13-4a9c-9b7e-3d7f3d91c9f1",
  "success_redirect_url": "https://webhook.site/aa2b85e4-1c13-4a9c-9b7e-3d7f3d91c9f1",
  "fail_redirect_url": "https://webhook.site/aa2b85e4-1c13-4a9c-9b7e-3d7f3d91c9f1",
  "meta_data": {
    "order_id": "ORDER-39182"
  },
  "extra_params": {
    "language": "en",
    "expiry": "2026-02-14 18:30:00",
    "strict_amount": true
  }
}
```

**Notes**

* `checkout_reference` must be unique per request.
* `extra_params.expiry` is optional; a default is applied if omitted.
* `extra_params.strict_amount` controls partial vs full payment acceptance.

***

## Response (accepted)

```json theme={null}
{
  "code": "200",
  "status": "SUCCESS",
  "description": "Request accepted",
  "data": {
    "checkout_url": "https://waftpay.netlify.app/checkout/OTRkN2I2YTQtZTliZi00MDI0LTk2N2ItZGI1MTQ0NmU2NzY2",
    "expires_at": "2026-03-02T14:08:41.921Z"
  }
}
```

Redirect the user to `checkout_url` or embed it in an iframe.

***

## Callback (final outcome)

We POST the final result to your `callback_url`. See [Webhook payload](/pages/webhooks/payload).

***

## Related links

* [Create Checkout Request API](/api-reference/checkout/checkout-request)
* [Get Authentication Token](/api-reference/auth/auth-token)
* [Webhooks overview](/pages/webhooks/overview)
* [Errors](/errors)
