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"
}{
"error": "INVALID_AMOUNT",
"message": "The amount must be greater than 0",
"details": {}
}{
"error": "INVALID_AMOUNT",
"message": "The amount must be greater than 0",
"details": {}
}Endpoints
Initialize Checkout Session
Initialize a new checkout session for payment collection
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"
}{
"error": "INVALID_AMOUNT",
"message": "The amount must be greater than 0",
"details": {}
}{
"error": "INVALID_AMOUNT",
"message": "The amount must be greater than 0",
"details": {}
}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.
Body
application/json
Response
Checkout session initialized successfully