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

# Checkout Flow Guide

> Step-by-step guide for the hosted Afriex Checkout payment experience

## Overview

Afriex Checkout is a hosted payment experience that allows customers to complete payments using supported methods such as Card, Bank Transfer, and Mobile Money.

After a merchant [creates a checkout session](https://docs.afriex.com/api-reference/endpoint/checkout-sessions/create.md) through the API, the customer is redirected to the hosted checkout page to complete payment.

> [card] [Play with the sandbox demo](https://sandbox.pay.afriex.com/demo)
>
> Walk through the exact flow described below without writing any code. The demo is sandbox-only and uses the real hosted checkout, with all three channels covered per currency: **mobile money** (KES, GHS and others), **bank transfer** (NGN), and **card** (USD).

## Before you begin

A checkout session must already be created by the merchant or application. The hosted checkout page displays the payment amount, available payment methods, session timer, and payment instructions.

## Select a payment method

The customer sees the available payment methods on the checkout page.

Available methods may include:

* Card
* Bank Transfer
* Mobile Money

![Afriex Checkout payment method selection screen](https://mintcdn.com/afriex-5d97ad2e/ulv7qvmC5TFs2ZRr/images/checkout-flow/payment-select.png?fit=max\&auto=format\&n=ulv7qvmC5TFs2ZRr\&q=85\&s=44453a6664820baabcc7d84edfdde7f1)

Afriex Checkout payment method selection screen

The customer:

* Reviews the payment amount
* Selects a preferred payment method

The checkout session also displays an expiration timer.

After selecting a method, the customer follows one of the payment paths below.

## Pay by card

When Card is selected, Afriex displays a secure card payment form for the payment.

![Afriex Checkout card payment form](https://mintcdn.com/afriex-5d97ad2e/ulv7qvmC5TFs2ZRr/images/checkout-flow/card-payment.png?fit=max\&auto=format\&n=ulv7qvmC5TFs2ZRr\&q=85\&s=aaf81047e4a9c1f0accd0baa0075d0ed)

Afriex Checkout card payment form

The page displays:

* Amount to pay
* Card number field
* Card expiry field
* CVC field
* Cardholder name field
* Billing address fields
* Pay button

Customer actions:

1. Enter the card number.
2. Enter the card expiry date and CVC.
3. Enter the cardholder name and billing address.
4. Click **Pay**.
5. Complete any card authorization prompt if required.

Afriex confirms the card payment and updates the checkout page automatically.

## Pay by bank transfer

When Bank Transfer is selected, Afriex displays one-time bank transfer details for the payment.

![Afriex Checkout bank transfer payment details screen](https://mintcdn.com/afriex-5d97ad2e/ulv7qvmC5TFs2ZRr/images/checkout-flow/bank-transfer.png?fit=max\&auto=format\&n=ulv7qvmC5TFs2ZRr\&q=85\&s=efcc3f86abd430e43b0fddd82ba7c00d)

Afriex Checkout bank transfer payment details screen

The page displays:

* Amount to pay
* Bank name
* Account number
* Account name
* Copy account number action
* Payment instructions
* Session expiration timer

Customer actions:

1. Open a banking app, internet banking, or USSD.
2. Transfer the exact amount shown.
3. Return to the checkout page.
4. Wait for automatic payment confirmation.

> [!WARNING]
>
> The customer must send the exact amount shown. Incorrect amounts may cause delays or require a refund.

## Pay by mobile money

When Mobile Money is selected, the customer enters their mobile money details.

![Afriex Checkout mobile money payment form](https://mintcdn.com/afriex-5d97ad2e/ulv7qvmC5TFs2ZRr/images/checkout-flow/mobile-money.png?fit=max\&auto=format\&n=ulv7qvmC5TFs2ZRr\&q=85\&s=699e56ee11ea2c43feef5ed3b07a239d)

Afriex Checkout mobile money payment form

The page displays:

* Network selector
* Account holder name field
* Mobile money phone number field
* Pay now button

Customer actions:

1. Select a mobile money network.
2. Enter the account holder name.
3. Enter the mobile money phone number.
4. Click **Pay now**.

Afriex sends a payment authorization prompt to the customer's phone.

### Approve the payment on your phone

After the customer clicks **Pay now**, the checkout page enters a pending state while waiting for payment authorization.

![Afriex Checkout mobile money authorization pending screen](https://mintcdn.com/afriex-5d97ad2e/ulv7qvmC5TFs2ZRr/images/checkout-flow/check-phone.png?fit=max\&auto=format\&n=ulv7qvmC5TFs2ZRr\&q=85\&s=e5036251afa155739f33b02c66c12c8f)

Afriex Checkout mobile money authorization pending screen

The customer:

* Checks their phone
* Approves the mobile money payment prompt
* Waits for the checkout page to update automatically

The session timer continues while Afriex waits for confirmation from the network or payment provider.

## Payment outcomes

Regardless of the payment method, the checkout session ends in one of two outcomes.

### Successful payment

When payment is confirmed, the customer sees a success message.

![Afriex Checkout payment successful confirmation screen](https://mintcdn.com/afriex-5d97ad2e/ulv7qvmC5TFs2ZRr/images/checkout-flow/payment-success.png?fit=max\&auto=format\&n=ulv7qvmC5TFs2ZRr\&q=85\&s=861833437becc180ee6eac5f43584004)

Afriex Checkout payment successful confirmation screen

At this stage:

* The payment has been confirmed
* The customer sees a success confirmation
* When the customer leaves the success screen, Afriex sends them to the merchant's redirect URL

### Failed payment

If payment cannot be confirmed, the customer sees a failed payment screen.

![Afriex Checkout payment failed screen](https://mintcdn.com/afriex-5d97ad2e/ulv7qvmC5TFs2ZRr/images/checkout-flow/payment-failed.png?fit=max\&auto=format\&n=ulv7qvmC5TFs2ZRr\&q=85\&s=44f42e2a76b2f3bede8eb40c5928f994)

Afriex Checkout payment failed screen

Possible failure reasons include:

* Declined or failed card payment
* Incorrect transfer amount
* Declined mobile money authorization
* Expired checkout session
* Network or payment provider issue
* Payment could not be confirmed

The customer may:

* Try again from the failed payment screen
* Contact support
* Return to the merchant

## Checkout session expiration

A checkout stays open for 24 hours by default. Customers should complete payment before it expires. A checkout also closes once its payment is credited, so a paid checkout can't be opened again.

If the checkout expires, the customer may need to restart checkout or request a new checkout session.

## Redirect behavior

When the customer leaves the success screen after paying, Afriex sends them to the `redirectUrl` you set on the session. It adds no query parameters, so the URL you set is the URL the customer lands on.

The redirect only tells you the customer finished the flow in their browser. Use it to show a result page, not to confirm payment.

To reconcile the payment, subscribe to [`TRANSACTION.UPDATED`](https://docs.afriex.com/api-reference/endpoint/webhooks/transaction-events). It reports progress and completion on the transaction the session produces. Each transaction carries your `merchantReference` and your `metadata` as `meta`, so you can match it to your order.

> [!WARNING]
>
> Creating a checkout session sends no webhook, and the response is not a payment signal. The payment is complete only when the transaction reports it.

## What the payer sees in sandbox

When a checkout session is created with a sandbox API key, the hosted page opens in **test mode** with a few in-page helpers so the payer can drive different outcomes without leaving the flow:

* A **Test mode** badge in the page header.
* On the mobile-money screen, the sandbox **test numbers** are listed inline (`0001` fails, `0002` asks for an OTP, `0005` is declined). Any other valid mobile number succeeds.
* The **OTP hint** (`123456`) is shown whenever an OTP step is triggered.
* On the bank-transfer screen, **Simulate transfer** and **Simulate failed transfer** buttons finalize the deposit without needing to move money from a real bank.
* The card form is pre-filled with a valid **test card** in read-only fields, so a `Pay` click is enough.

These helpers only appear in sandbox; the production checkout looks identical to a real payment.

## Notes for merchants

* Customers should pay the exact amount shown on the checkout page.
* Checkout sessions should be tested in sandbox before going live. See the [Testing in Sandbox guide](https://docs.afriex.com/guides/testing-in-sandbox.md#hosted-checkout-in-sandbox) for the outcome-selection table (last four digits of the payer's account, phone, or card) and how to speed up settlement.
* The redirect URL should be configured correctly so customers return to the merchant application after payment.

## Related

> [card] [Create Checkout Session](https://docs.afriex.com/api-reference/endpoint/checkout-sessions/create.md)
>
> Create a hosted checkout session and get the `checkoutUrl` to redirect your customer to.

> [card] [Webhooks](https://docs.afriex.com/api-reference/endpoint/webhooks/introduction.md)
>
> Receive real-time notifications when a checkout payment completes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.