List checkout sessions
curl --request GET \
--url https://api.ketapay.com/v1/checkout_sessions \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ketapay.com/v1/checkout_sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ketapay.com/v1/checkout_sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "list",
"has_more": true,
"next_cursor": "<string>",
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "checkout_session",
"livemode": true,
"status": "open",
"url": "https://app.ketapay.com/checkout/2c9a7f4e-1b3d-4e6a-8f2c-5d7b9e1a3c60",
"amount": 45000000,
"currency": "NGN",
"fees": {
"amount": 45000000,
"buyer_fee": 2250000,
"buyer_vat": 168750,
"buyer_total": 152418750,
"seller_fee": 2250000,
"commission": 15000000,
"seller_payout": 132750000
},
"category": "other",
"title": "<string>",
"description": "<string>",
"images": [
{
"file": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"thumbnail_url": "<string>",
"alt": "<string>"
}
],
"attachments": [
{
"file": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Project brief.pdf",
"url": "<string>"
}
],
"milestones": [
{
"title": "Design",
"amount": 45000000,
"description": "<string>",
"due_date": "2023-12-25"
}
],
"buyer": {
"email": "ada@example.com",
"phone": "+2348012345678",
"name": "Ada Obi"
},
"seller": {
"email": "ada@example.com",
"phone": "+2348012345678",
"name": "Ada Obi"
},
"release": {
"method": "buyer_confirms",
"auto_release_hours": null
},
"commission": {
"rate_bps": 1000,
"min_amount": 45000000,
"max_amount": 45000000
},
"escrow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"return_url": "<string>",
"cancel_url": "<string>",
"external_reference": "proj_4471",
"metadata": {
"project_id": "4471"
},
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"url_on_platform": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "buyer.phone must be a Nigerian mobile number in E.164 format, like +2348012345678.",
"param": "buyer.phone",
"request_id": "req_01J9ZK7M2Q4V8XW3B6N5T0R1YH"
}
}{
"error": {
"type": "authentication_error",
"code": "api_key_invalid",
"message": "This API key is invalid or has been revoked.",
"param": null,
"request_id": "req_01J9ZK7M2Q4V8XW3B6N5T0R1YH"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests. Retry after the time in X-RateLimit-Reset.",
"param": null,
"request_id": "req_01J9ZK7M2Q4V8XW3B6N5T0R1YH"
}
}Checkout sessions
List checkout sessions
GET
/
checkout_sessions
List checkout sessions
curl --request GET \
--url https://api.ketapay.com/v1/checkout_sessions \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ketapay.com/v1/checkout_sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ketapay.com/v1/checkout_sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "list",
"has_more": true,
"next_cursor": "<string>",
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object": "checkout_session",
"livemode": true,
"status": "open",
"url": "https://app.ketapay.com/checkout/2c9a7f4e-1b3d-4e6a-8f2c-5d7b9e1a3c60",
"amount": 45000000,
"currency": "NGN",
"fees": {
"amount": 45000000,
"buyer_fee": 2250000,
"buyer_vat": 168750,
"buyer_total": 152418750,
"seller_fee": 2250000,
"commission": 15000000,
"seller_payout": 132750000
},
"category": "other",
"title": "<string>",
"description": "<string>",
"images": [
{
"file": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"thumbnail_url": "<string>",
"alt": "<string>"
}
],
"attachments": [
{
"file": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Project brief.pdf",
"url": "<string>"
}
],
"milestones": [
{
"title": "Design",
"amount": 45000000,
"description": "<string>",
"due_date": "2023-12-25"
}
],
"buyer": {
"email": "ada@example.com",
"phone": "+2348012345678",
"name": "Ada Obi"
},
"seller": {
"email": "ada@example.com",
"phone": "+2348012345678",
"name": "Ada Obi"
},
"release": {
"method": "buyer_confirms",
"auto_release_hours": null
},
"commission": {
"rate_bps": 1000,
"min_amount": 45000000,
"max_amount": 45000000
},
"escrow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"return_url": "<string>",
"cancel_url": "<string>",
"external_reference": "proj_4471",
"metadata": {
"project_id": "4471"
},
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"url_on_platform": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "buyer.phone must be a Nigerian mobile number in E.164 format, like +2348012345678.",
"param": "buyer.phone",
"request_id": "req_01J9ZK7M2Q4V8XW3B6N5T0R1YH"
}
}{
"error": {
"type": "authentication_error",
"code": "api_key_invalid",
"message": "This API key is invalid or has been revoked.",
"param": null,
"request_id": "req_01J9ZK7M2Q4V8XW3B6N5T0R1YH"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "Too many requests. Retry after the time in X-RateLimit-Reset.",
"param": null,
"request_id": "req_01J9ZK7M2Q4V8XW3B6N5T0R1YH"
}
}Authorizations
Authorization: Bearer <secret key>. Secret keys belong to your organisation, are shown
once when created in the dashboard, and are scoped (see x-required-scope on each
operation). Keep them on your server. Live keys are issued after your business is
verified. Publishable keys (pk_) are only for @ketapay/checkout and don't work here.
Query Parameters
Required range:
1 <= x <= 100The next_cursor from the previous page
Only items with this external_reference
open: waiting for payment. complete: paid, escrow_id is set. expired: not paid by
expires_at. cancelled: you cancelled it.
Available options:
open, complete, expired, cancelled ⌘I