Skip to main content
Redirect customers to a complete checkout page that Lite builds, serves, and processes. When a customer is ready to pay, you send them from your site to a Lite URL. They enter their card there, lite processes the payment on its own servers, and they land back on your site with the result. Because the card details live entirely on lite’s infrastructure, they never touch your servers. You never store, transmit, or handle a raw card number, which can make you eligible for the simplest level of PCI validation; SAQ A. Use a Hosted Page if you:
  • aren’t PCI-DSS certified and want to keep it that way,
  • want the fastest integration with the least code, or
  • are happy to send customers to a lite-hosted (but brand-able) page to pay.

How it works

  1. Create a session. Your server calls POST /v1/checkout/sessions and gets back a payment_link.
  2. Redirect the customer. You send them to the payment_link. They pay on lite’s hosted page.
  3. Customer returns. lite sends cardholders back to your success or failure URL, so you can show a result right away.
  4. Confirm with a webhook. lite sends a payment.captured event to your server. This is the source of truth you fulfill from.
A checkout session is a short-lived attempt to collect payment. It resolves to Completed, Expired, or Cancelled. The return URL tells you the session resolved; the webhook tells you the money actually moved. Treat the webhook as your source of truth — see Step 4.

Before you begin

This guide assumes your one-time setup is done. You can re-check any of it from the dashboard. You’ll need:
  • A lite account in good standing.
  • Test and live API keys. Test keys are prefixed sk_test_; live keys are prefixed sk_ with no environment segment (for example, sk_01KYFJ...). The prefix determines the environment, and a key without test_ is a live key that moves real money.
  • At least one channel configured, with its channel_id (unless you intend to use the default channel option). A channel sets your enabled payment methods, branding, and default redirect URLs.
  • A webhook endpoint registered, you’ll need it for fulfillment in Step 4.
Build and test everything with your test key first. Going live takes more than a live key. To process real payments, your account needs completed KYB (Know Your Business) verification and active payment acceptance. You can track both from the dashboard. Until they’re done, you will only see lite sandbox.

Step 1: Create a session

Create the session from your backend, so a customer can’t tamper with the amount or currency.

Required headers

Key request fields

Response

A new session always starts as Pending. Hold on to the id (a UUID), you’ll use it to match the webhook, and to look the session up later if you need to. (client_secret is only for the Drop-in SDK; you can ignore it for the hosted redirect.) By default, 3D Secure is applied automatically based on the card scheme and SAMA rules; for mada and most KSA cards it’s mandatory. Set three_ds_required: true if you want to force it on every payment.

Step 2: Redirect to the hosted page

Send the customer to payment_link with an HTTP 303:
Use 303, not 302, so the browser switches to a GET for the checkout page even though your endpoint received a POST. From here the customer pays entirely on Lite’s domain — you never see their card details.

Step 3: Handle the return

After checkout, lite sends the customer back to one of your redirect_urls:
  • success: the payment went through.
  • failure: the payment failed, or the customer cancelled.
Use this page to show them something right away — an order confirmation or a retry prompt. Don’t fulfill the order here.
The return URL is not authoritative. A customer can pay and then close the tab or drop offline before your page loads, so the redirect might never reach you. Always fulfill from the webhook in Step 4.
If you want to show a definitive state on this page, check the session server-side first; but still fulfill from the webhook. Retrieve the full session, or call the lightweight validity endpoint:

Step 4: Confirm with a webhook

Webhooks are how you reliably learn the outcome of every payment. For the Hosted Page flow, subscribe to these events: Verify the signature and confirm the outcome with a server-side read of the payment before you fulfill. Persist the event before returning a successful response, and process events idempotently, because a delivery may be repeated. If your endpoint does not respond successfully, lite retries. For the event list, the payload shape, and how to verify signatures, see the Create a webhook page.

Test and go live

Test mode accepts lite’s published test cards. At a minimum, confirm each of these outcomes: Before you switch to your live key, confirm that:
  • Your account has KYB verification complete and payment acceptance activated.
  • Your webhook endpoint verifies the signature and returns 200.
  • A session creates successfully and returns a payment_link.
  • The redirect reaches lite’s hosted page and back to your return URL.
  • Fulfillment fires from payment.captured, not from the return URL.
  • A declined card shows up correctly on your failure page.