Additional resources
Utilities
Utility endpoints: identify an operator, check service availability and view your balance.
Application information
GET/api/v1/payments/me
Returns the ID and name of the application and company associated with the API keys used. Useful to verify your identifiers, retrieve theapplicationId (required for inter-wallet transfers) or the companyId.
Request example
const res = await fetch("https://admin.kpay.site/api/v1/payments/me", {
method: "GET",
headers: {
"X-API-Key": process.env.KPAY_API_KEY,
"X-Secret-Key": process.env.KPAY_SECRET_KEY,
},
});
const data = await res.json();Response (200)
{
"application": {
"id": "b8aefadd-88b4-561a-8a90-2f9814207bfb",
"name": "Mon Application"
},
"company": {
"id": "e7c3b4f5-8d9e-4a1b-9c2d-3e4f5a6b7c8d",
"name": "My Startup Inc"
},
"environment": "TEST"
}Response properties
application.idstringApplication UUID. Use it in the applicationId field of inter-wallet transfers.
application.namestringApplication name as configured in the dashboard.
company.idstringUUID of the company that owns the application.
company.namestringCompany name.
environmentstringEnvironment of the keys used: TEST or PRODUCTION.
Obtain a JWT token
POST/api/v1/payments/token
Exchanges your API keys for a Bearer JWT token (lifetime: 30 minutes). This token is required for JWT-authenticated endpoints such as the inter-wallet transfer (POST /api/wallets/transfer).
Why a JWT token?
Automatic environment
- Key
kpay_test_...→ sandbox token → operations on test wallets. - Key
kpay_live_...→ production token → operations on real wallets.
Request example
const res = await fetch("https://admin.kpay.site/api/v1/payments/token", {
method: "POST",
headers: {
"X-API-Key": process.env.KPAY_API_KEY,
"X-Secret-Key": process.env.KPAY_SECRET_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();Response (201)
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": "30m",
"environment": "TEST"
}Response properties
accessTokenstringJWT token to use in the Authorization: Bearer <token> header. The environment (TEST/PRODUCTION) is encoded in the token.
expiresInstringToken validity duration (30 minutes). After expiration, call this endpoint again.
environmentstringToken environment: TEST (key kpay_test_...) or PRODUCTION (key kpay_live_...). Confirms the environment in which operations will be performed.
Using the token
# 1. Obtenir le token
TOKEN=$(curl -s -X POST https://admin.kpay.site/api/v1/payments/token \
-H "X-API-Key: kpay_test_xxxxxxxxxxxxxxxx" \
-H "X-Secret-Key: sk_test_xxxxxxxxxxxxxxxx" \
| jq -r '.accessToken')
# 2. Utiliser le token pour un transfert inter-wallet
curl -X POST https://admin.kpay.site/api/wallets/transfer \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"applicationId": "votre-application-id",
"sourceCountry": "CMR",
"destinationCountry": "GAB",
"amount": 50000
}'Exchange rate
GET/api/v1/payments/exchange-rate?from=XAF&to=XOF
Returns the real-time exchange rate between two currencies. The rate is cached for 1 hour server-side. Useful before a cross-currency inter-wallet transfer to show the estimated amount to the user.
Query parameters
fromstringrequisSource currency (e.g. XAF, XOF, GHS, KES, NGN).
tostringrequisTarget currency.
Request example
const res = await fetch("https://admin.kpay.site/api/v1/payments/exchange-rate?from=XAF&to=XOF", {
method: "GET",
headers: {
"X-API-Key": process.env.KPAY_API_KEY,
"X-Secret-Key": process.env.KPAY_SECRET_KEY,
},
});
const data = await res.json();Response (200)
{
"from": "XAF",
"to": "XOF",
"rate": 1.0153
}Response properties
fromstringSource currency.
tostringTarget currency.
ratenumberExchange rate: 1 unit of `from` = `rate` units of `to`. To convert: amount × rate.
Monetary zones
1 for intra-zone transfers. Cross-zone transfers use the real rate.Guess the operator of a number
POST/api/v1/payments/predict-provider
Identifies the Mobile Money (MMO) provider associated with a phone number, along with the country. Useful to pre-fill the provider field before initiating a payment or withdrawal.
Helper endpoint (lookup)
provider passed to the init. In sandbox, only test numbers are recognized.Request body
phoneNumberstringrequisMobile Money number (national or international format, e.g. 237670000001, 260763456789).
Request example
const res = await fetch("https://admin.kpay.site/api/v1/payments/predict-provider", {
method: "POST",
headers: {
"X-API-Key": process.env.KPAY_API_KEY,
"X-Secret-Key": process.env.KPAY_SECRET_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"phoneNumber": "237653456789"
}),
});
const data = await res.json();Response (201)
{
"country": "CMR",
"provider": "MTN_MOMO_CMR",
"phoneNumber": "237653456789"
}Response properties
countrystringOperator country, ISO 3166-1 alpha-3 (e.g. CMR, ZMB, GHA).
providerstringpawaPay provider code (e.g. MTN_MOMO_CMR, ORANGE_CMR). Use this value in the provider field of the init.
phoneNumberstringNormalized number (digits only, without + or leading 0).
Common errors
400— Number not recognized, invalid format or unsupported operator.401— API keys missing or invalid.429— Rate limit exceeded.
Operator availability
GET/api/v1/payments/availability
Returns the operational status of each Mobile Money provider, by country and operation type (DEPOSIT, PAYOUT, REMITTANCE). Data is cached for 1 minute on KPay's side.
Possible statuses
| Status | Meaning |
|---|---|
OPERATIONAL | Service fully operational |
DELAYED | Service operational but with abnormal delays |
CLOSED | Service temporarily unavailable |
Request example
const res = await fetch("https://admin.kpay.site/api/v1/payments/availability", {
method: "GET",
headers: {
"X-API-Key": process.env.KPAY_API_KEY,
"X-Secret-Key": process.env.KPAY_SECRET_KEY,
},
});
const data = await res.json();Response (200)
[
{
"country": "CMR",
"providers": [
{
"provider": "MTN_MOMO_CMR",
"operationTypes": [
{ "operationType": "DEPOSIT", "status": "OPERATIONAL" },
{ "operationType": "PAYOUT", "status": "OPERATIONAL" }
]
},
{
"provider": "ORANGE_CMR",
"operationTypes": [
{ "operationType": "DEPOSIT", "status": "OPERATIONAL" },
{ "operationType": "PAYOUT", "status": "DELAYED" }
]
}
]
},
{
"country": "GHA",
"providers": [
{
"provider": "MTN_MOMO_GHA",
"operationTypes": [
{ "operationType": "DEPOSIT", "status": "OPERATIONAL" },
{ "operationType": "PAYOUT", "status": "OPERATIONAL" }
]
},
{
"provider": "VODAFONE_GHA",
"operationTypes": [
{ "operationType": "DEPOSIT", "status": "OPERATIONAL" },
{ "operationType": "PAYOUT", "status": "DELAYED" }
]
}
]
}
]Use case
Check wallet balance
GET/api/v1/payments/balance
Returns the balance of your KPay wallet for the application identified by your API keys. In sandbox, the returned balance is that of the test wallet.
Request example
const res = await fetch("https://admin.kpay.site/api/v1/payments/balance", {
method: "GET",
headers: {
"X-API-Key": process.env.KPAY_API_KEY,
"X-Secret-Key": process.env.KPAY_SECRET_KEY,
},
});
const data = await res.json();Response (200)
[
{
"currency": "XAF",
"balance": 150000,
"reservedBalance": 25000,
"availableBalance": 125000
}
]Response properties
currencystringWallet currency (e.g. XAF).
balancenumberTotal wallet balance.
reservedBalancenumberAmount reserved for withdrawals currently being processed.
availableBalancenumberAvailable balance (balance - reservedBalance). This is the amount you can actually use for withdrawals.