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

# Hosted Checkout

> Redirect customers to Simiz's branded, secure checkout page for payment.

Simiz Hosted Checkout provides a **pre-built, secure payment page** that you can redirect customers to. No frontend code required.

## Why use Hosted Checkout?

* **Zero frontend work** — Simiz handles the entire payment UI
* **PCI compliant** — Sensitive data never touches your servers
* **Mobile optimized** — Works on all devices and screen sizes
* **Multi-provider** — Customers choose from all available payment methods
* **Branded** — Customizable with your logo and colors

## How it works

```mermaid
sequenceDiagram
    autonumber
    participant B as Your backend
    participant S as Simiz API
    participant C as Customer
    participant H as Hosted checkout
    participant P as Provider
    B->>S: POST /v1/transactions (CHECKOUT)
    S-->>B: 201 + payment_url
    B->>C: redirect to payment_url
    C->>H: branded payment page
    C->>H: selects method, pays
    H->>P: charge
    P-->>H: result
    H->>C: redirect to return_url
    S->>B: webhook (payment result)
```

<Steps>
  <Step title="Create a checkout session">
    Call the API to create a transaction. The response includes a `payment_url`.
  </Step>

  <Step title="Redirect the customer">
    Send the customer to the `payment_url`. They'll see a branded payment page with all available methods.
  </Step>

  <Step title="Customer pays">
    The customer selects their preferred payment method and completes the payment.
  </Step>

  <Step title="Handle the result">
    The customer is redirected to your `return_url`. You receive a webhook with the payment result.
  </Step>
</Steps>

## Create a checkout session

```bash
curl -X POST https://api.simiz.io/v1/transactions \
  -H "Authorization: Bearer sk_test_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 10000,
    "currency": "XAF",
    "payment_method": "CHECKOUT",
    "payer": {
      "name": "Jane Doe",
      "email": "jane@example.com"
    },
    "description": "Order #456",
    "callback_url": "https://your-site.com/webhooks/simiz",
    "return_url": "https://your-site.com/success",
    "cancel_url": "https://your-site.com/cancel"
  }'
```

The response includes a `payment_url` — redirect your customer to this URL.

## Customization

You can customize the checkout page appearance via your Dashboard:

* **Logo** — Your company logo displayed on the checkout page
* **Colors** — Match your brand's primary color
* **Language** — French or English
* **Payment methods** — Enable/disable specific providers

<Tip>
  Configure your checkout branding in **Dashboard → Settings → Checkout**.
</Tip>
