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
Initialize a new checkout session for payment collection
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.
Authorizations
Enter your API key as a Bearer token
Body
Title for the checkout session
"Checkout"
Your internal reference for this checkout
"323435452432423242"
Checkout amount
x >= 0.011
A brief description of what the customer is paying for
"A brief description"
URL to redirect customer after payment completion
"https://url.com"
Response
Checkout session initialized successfully
Unique identifier for the checkout session
"040956bf1210aa19c948da8d5769cea01313dc23022025"
URL where customer can complete payment
"https://checkout.kairosafrika.com/pay/040956bf1210aa19c948da8d5769cea01313dc23022025"
Current status of the checkout session
active, completed, expired, cancelled "active"
Title of the checkout session
"Checkout"
Your internal reference for this checkout
"323435452432423242"
Checkout amount
1
Description of what the customer is paying for
"A brief description"
URL to redirect customer after payment completion
"https://url.com"
When the checkout session was created
"2024-01-15T10:30:00Z"
When the checkout session expires
"2024-12-25T23:59:59Z"