# Checkout

Checkout creates a hosted payment page. You redirect the customer to its `url`, and IntaSend
shows the payment methods enabled on your account for that currency.

Checkout is authenticated with your **publishable key**, so you can call it from your frontend or your server.

```bash
curl -X POST https://api.intasend.com/api/v1/checkout/ \
  -H "X-IntaSend-Public-API-Key: ISPubKey_test_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1500,
    "currency": "KES",
    "email": "jane@example.com",
    "first_name": "Jane",
    "last_name": "Doe",
    "phone_number": "254712345678",
    "api_ref": "order-123",
    "redirect_url": "https://example.com/thank-you"
  }'
```

```json
{
  "id": "0b7d…",
  "url": "https://sandbox.intasend.com/checkout/0b7d…/express/",
  "signature": "eyJ…",
  "amount": 1500,
  "currency": "KES",
  "paid": false
}
```

Redirect the customer to `url`. After they pay, they are sent to `redirect_url`.

## Request

| Field | Required | Description |
|---|---|---|
| `amount` | Yes | Amount to charge |
| `currency` | No | `KES` (default), `USD`, `EUR`, `GBP`, `UGX`, `TZS`, `RWF`, `CDF`. UGX and TZS amounts must be between 500 and 5,000,000. |
| `email`, `first_name`, `last_name`, `phone_number` | No | Prefills the customer's details |
| `country`, `address`, `city`, `state`, `zipcode` | No | Billing address (card payments) |
| `api_ref` | No | Your reference (letters, numbers, `-`, `_`, `:` and spaces) |
| `unique_api_ref` | No | `true` returns the existing checkout for this `api_ref` instead of creating a new one |
| `redirect_url` | No | Where the customer goes after paying |
| `wallet_id` | No | Wallet to credit |
| `host` | No | Your site's URL |

## Methods shown

The page shows the methods enabled on your account:

| Currency | Methods |
|---|---|
| KES | M-Pesa, card, Apple Pay, Google Pay, PesaLink, crypto |
| USD / EUR / GBP | Card, Apple Pay, Google Pay, crypto |
| UGX | MTN, Airtel |
| TZS | M-Pesa TZ, Tigo Pesa, Airtel, HaloPesa |

## Confirming payment

**Don't** treat a redirect to `redirect_url` as proof of payment. Instead, confirm with one of these:

- the `collection_event` [webhook](https://developers.intasend.com/guides/webhooks/) (recommended), or
- [payment status](https://developers.intasend.com/guides/collections/overview/#check-payment-status) using the invoice ID.
