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

# Checkout Link API

> Generate Hosted Checkout link using API

* Quick & Flexible – Generate Hosted Checkout links with minimal API calls and seamlessly integrate them across platforms.
* Secure & User-Friendly – Designed for a secured seamless experience for developers and users.

## Prerequisites

1. [Hosted Application](/application/hosted-application-setup) -
   Create an application and generate **Client ID** and **API Keys** for Hosted Checkout

2. **Authorization Token** -
   Use **API Keys** of to [Generate Authorization Token](/api-reference/authorization/generate-token)

## How It Works

<Card title="Generate Hosted Checkout Link" icon="brackets-curly" href="/api-reference/collection/generate-checkout-link/generate-checkout-link" horizontal>
  Use this API endpoint to generate a Hosted Checkout Link
</Card>

## Payment notifications

When a customer completes payment on the hosted checkout page (including mobile push payments), you can receive status updates in three ways:

1. **[Application webhooks](/home/webhooks#application-level-webhooks)** — Configure `PAYMENT RECEIVED` (and `PAYMENT FAILED` if needed) under your hosted application in the dashboard.
2. **`callbackUrl` on the generate link request** — Optional field on [Generate Checkout Link](/api-reference/collection/generate-checkout-link/generate-checkout-link). ClickPesa sends an HTTP POST to this URL when a payment for that link succeeds.
3. **[Query Payment API](/api-reference/collection/querying-for-payments/querying-for-payments)** — Poll by your `orderReference`.

If an application webhook is configured for the event, it is used instead of the merchant-level webhook. See [Webhooks](/home/webhooks) for payload details.

<Note>
  After payment, customers are redirected to the **Return URL** on your [hosted application](/application/hosted-application-setup) in the dashboard. That redirect is not set on the generate link request.
</Note>
