# Create a checkout (/docs/api/v1/online-checkout/initiate-checkout)

Creates a hosted checkout and returns a `checkoutUrl` to redirect your customer to, plus a `checkoutDirectUrl` for embedding. The customer chooses mobile money, card or Hubtel wallet on Hubtel's page. The final result arrives at `callbackUrl`; never fulfil an order from the `returnUrl` redirect alone.

`POST https://payproxyapi.hubtel.com/items/initiate`

## Request example

```json
{
  "totalAmount": 100,
  "description": "Book Shop Checkout",
  "callbackUrl": "https://webhook.site/8b4bbd0a-5f98-4b3d-abbe-b9b49767f7d5",
  "returnUrl": "http://hubtel.com/online",
  "merchantAccountNumber": "11684",
  "cancellationUrl": "http://hubtel.com/online",
  "clientReference": "inv0012"
}
```

## Response 200: Business result in ResponseCode: `0000`, `4000`, `4101`. See the response code table.

```json
{
  "responseCode": "0000",
  "status": "Success",
  "data": {
    "checkoutUrl": "https://pay.hubtel.com/7569a11e8b784f21baa9443b3fce31ed",
    "checkoutId": "7569a11e8b784f21baa9443b3fce31ed",
    "clientReference": "inv0012",
    "message": "",
    "checkoutDirectUrl": "https://pay.hubtel.com/7569a11e8b784f21baa9443b3fce31ed/direct"
  }
}
```

Full schema: /openapi/v1/online-checkout.json