Skip to main content
POST
/
v1
/
checkout
/
initialize
curl --request POST \
  --url https://api.kairosafrika.com/v1/checkout/initialize \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "title": "Checkout",
    "reference": "323435452432423242",
    "amount": 1,
    "description": "A brief description",
    "returnUrl": "https://url.com"
  }'
{
  "checkoutId": "040956bf1210aa19c948da8d5769cea01313dc23022025",
  "checkoutUrl": "https://checkout.kairosafrika.com/pay/040956bf1210aa19c948da8d5769cea01313dc23022025",
  "status": "active",
  "title": "Checkout",
  "reference": "323435452432423242",
  "amount": 1,
  "description": "A brief description",
  "returnUrl": "https://url.com",
  "createdAt": "2024-01-15T10:30:00Z",
  "expiresAt": "2024-12-25T23:59:59Z"
}

Initialize Checkout Session

This endpoint allows you to initialize a new checkout session for payment collection. Endpoint: POST /v1/checkout/initialize
curl --request POST \
  --url https://api.kairosafrika.com/v1/checkout/initialize \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "title": "Checkout",
    "reference": "323435452432423242",
    "amount": 1,
    "description": "A brief description",
    "returnUrl": "https://url.com"
  }'

Request Body

  • title (string, required): Title for the checkout session.
  • reference (string, required): Your internal reference for this checkout.
  • amount (number, required): The checkout amount.
  • description (string, required): A brief description of what the customer is paying for.
  • returnUrl (string, required): URL to redirect customer after payment completion.

Responses

  • 201 Created: Checkout session created.
  • 400 Bad Request: Invalid request data.

Authorizations

Authorization
string
header
required

Enter your API key as a Bearer token

Body

application/json
title
string
required

Title for the checkout session

Example:

"Checkout"

reference
string
required

Your internal reference for this checkout

Example:

"323435452432423242"

amount
number<float>
required

Checkout amount

Required range: x >= 0.01
Example:

1

description
string
required

A brief description of what the customer is paying for

Example:

"A brief description"

returnUrl
string<uri>
required

URL to redirect customer after payment completion

Example:

"https://url.com"

Response

Checkout session initialized successfully

checkoutId
string

Unique identifier for the checkout session

Example:

"040956bf1210aa19c948da8d5769cea01313dc23022025"

checkoutUrl
string<uri>

URL where customer can complete payment

Example:

"https://checkout.kairosafrika.com/pay/040956bf1210aa19c948da8d5769cea01313dc23022025"

status
enum<string>

Current status of the checkout session

Available options:
active,
completed,
expired,
cancelled
Example:

"active"

title
string

Title of the checkout session

Example:

"Checkout"

reference
string

Your internal reference for this checkout

Example:

"323435452432423242"

amount
number<float>

Checkout amount

Example:

1

description
string

Description of what the customer is paying for

Example:

"A brief description"

returnUrl
string<uri>

URL to redirect customer after payment completion

Example:

"https://url.com"

createdAt
string<date-time>

When the checkout session was created

Example:

"2024-01-15T10:30:00Z"

expiresAt
string<date-time>

When the checkout session expires

Example:

"2024-12-25T23:59:59Z"