Paystack in Kenya supports card payments (Visa, Mastercard), mobile money (including M-Pesa through the checkout), and bank transfers. Kenya is a mobile money-dominant market, so your integration strategy should prioritize the mobile money channel. All amounts are in the smallest currency unit (cents), where 1 KES equals 100 cents.
Kenya runs on mobile money. M-Pesa processes billions of transactions annually, and for most Kenyans, their phone number is their primary financial account. This is not a niche payment method or an alternative channel. It is the default way people move money.
This reality shapes everything about building payment flows in Kenya:
Paystack entered Kenya as part of its expansion beyond West Africa, and the Kenyan market has different characteristics from Nigeria or Ghana. Understanding these differences is essential for building payment flows that actually convert.
Setting up Paystack for a Kenyan business follows the same general flow as other markets, but the verification documents are Kenya-specific.
Step 1: Create your Paystack account
Sign up at paystack.com and select Kenya as your country. You get immediate access to test mode with test API keys. Start building your integration before completing business verification.
Step 2: Complete business verification
To go live in Kenya, Paystack requires your KRA PIN certificate, certificate of incorporation (or business registration certificate for sole proprietors), a national ID or passport of the director, and your bank account details for settlement. The verification timeline varies but typically takes several business days.
Step 3: Get your live API keys
Once verified, your live secret key and public key become available in the dashboard. The secret key (starts with sk_live_) is for server-side operations. The public key (starts with pk_live_) is for client-side Paystack Popup or Inline JS.
Step 4: Initialize your first transaction
// Initialize a KES transaction
var response = await fetch('https://api.paystack.co/transaction/initialize', {
method: 'POST',
headers: {
Authorization: 'Bearer ' + process.env.PAYSTACK_SECRET_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: 'customer@example.co.ke',
amount: 200000, // 2,000 KES in cents
currency: 'KES',
reference: 'order_' + Date.now(),
callback_url: 'https://yoursite.co.ke/payment/callback',
}),
});
var data = await response.json();
// Redirect to data.data.authorization_url
// Or use data.data.access_code with Paystack Popup
Always pass currency: 'KES' explicitly. The amount 200000 means 2,000 KES (200,000 cents divided by 100). A common mistake is confusing KES and cents, which leads to charging customers 100 times the intended amount or 100 times less.
For the full document requirements and common rejection reasons, see Paystack onboarding and compliance requirements in Kenya.
Get weekly developer tips
Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.
No spam. Unsubscribe anytime.
Kenya has fewer payment channels on Paystack than Nigeria, but the ones available cover the vast majority of how Kenyans pay online.
Mobile Money (M-Pesa)
Mobile money is the dominant payment method. When a customer selects mobile money at the Paystack checkout, they receive an STK push notification on their phone asking them to enter their M-Pesa PIN to authorize the payment. The flow is familiar to virtually every Kenyan with a phone. This channel should be your default for consumer-facing products in Kenya.
Cards (Visa, Mastercard)
Card payments work for customers with Visa or Mastercard debit or credit cards. Card penetration in Kenya is lower than in Nigeria or South Africa, but cards are used by a segment of urban, tech-savvy customers and are important for B2B transactions and higher-value purchases.
Bank Transfer
Paystack supports bank transfers in Kenya, allowing customers to pay by transferring directly from their bank account. This channel is useful for B2B payments and customers who prefer bank-to-bank transfers over mobile money or cards.
When initializing a transaction, you can specify which channels to display:
// Show only mobile money and card channels
var response = await fetch('https://api.paystack.co/transaction/initialize', {
method: 'POST',
headers: {
Authorization: 'Bearer ' + process.env.PAYSTACK_SECRET_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: 'customer@example.co.ke',
amount: 150000, // 1,500 KES
currency: 'KES',
channels: ['mobile_money', 'card'],
reference: 'order_' + Date.now(),
}),
});
For a deep dive into each channel with conversion tips, read payment methods available on Paystack in Kenya.
Every amount in the Paystack API is in the smallest currency unit. For Kenya, that means cents. One Kenyan Shilling equals 100 cents.
// Converting KES to cents for the API
function kesToCents(kes) {
return Math.round(kes * 100);
}
// Converting cents back to KES for display
function centsToKes(cents) {
return cents / 100;
}
// Examples
kesToCents(2000); // 200000 cents = 2,000 KES
kesToCents(50); // 5000 cents = 50 KES
kesToCents(1499.50); // 149950 cents = 1,499.50 KES
Common mistakes with KES amounts:
amount: 2000, Paystack charges 20 KES. If you pass amount: 200000, Paystack charges 2,000 KES. Always multiply by 100.Math.round() when converting to cents to avoid JavaScript floating point quirks that produce values like 149999.99999.When you verify a transaction, always confirm the amount and currency match your expectations:
var verifyResponse = await fetch(
'https://api.paystack.co/transaction/verify/' + reference,
{
headers: {
Authorization: 'Bearer ' + process.env.PAYSTACK_SECRET_KEY,
},
}
);
var verifyData = await verifyResponse.json();
if (verifyData.data.status === 'success') {
var expectedAmount = 200000; // 2,000 KES in cents
if (verifyData.data.amount !== expectedAmount || verifyData.data.currency !== 'KES') {
console.error('Amount or currency mismatch');
return;
}
// Amount verified. Grant value to the customer.
}
Mobile money transactions behave differently from card payments. The customer does not enter payment details in a browser. Instead, they receive a push notification on their phone and authorize the payment there. This changes how you handle the payment flow.
The STK push flow:
The gap between step 4 and step 6 can be seconds or minutes. The customer might be on a different screen, have their phone locked, or be in an area with poor signal. Your application needs to handle this waiting period gracefully.
// Frontend: poll for payment status after STK push
function pollPaymentStatus(reference, maxAttempts) {
var attempts = 0;
function check() {
attempts = attempts + 1;
fetch('/api/payment/status/' + reference)
.then(function(res) { return res.json(); })
.then(function(data) {
if (data.status === 'success') {
// Payment confirmed. Show success to customer.
showSuccess();
} else if (data.status === 'failed') {
// Payment failed. Show retry option.
showRetry();
} else if (attempts < maxAttempts) {
// Still pending. Check again in 5 seconds.
setTimeout(check, 5000);
} else {
// Timed out. Tell customer to check their phone.
showTimeout();
}
});
}
check();
}
Key engineering considerations for mobile money in Kenya:
Webhook handling in Kenya follows the same pattern as other Paystack markets, but mobile money transactions make webhooks even more critical because the payment authorization happens on the customer's phone, not in the browser.
var crypto = require('crypto');
app.post('/webhooks/paystack', function(req, res) {
res.sendStatus(200);
var hash = crypto
.createHmac('sha512', process.env.PAYSTACK_SECRET_KEY)
.update(JSON.stringify(req.body))
.digest('hex');
if (hash !== req.headers['x-paystack-signature']) {
console.error('Invalid webhook signature');
return;
}
var event = req.body;
if (event.event === 'charge.success') {
var reference = event.data.reference;
var channel = event.data.channel;
// Log the channel for analytics
// 'mobile_money' for M-Pesa, 'card' for cards
console.log('Payment via ' + channel + ': ' + reference);
// Process the payment
processPayment(reference, event.data);
}
});
Settlement in Kenya:
Settlement timelines in Kenya are generally longer than in Nigeria. The exact timeline depends on your account tier, transaction volume, and the payment channel used. Check your Paystack dashboard under Settings for your specific settlement schedule.
Things to plan for:
For detailed settlement timelines and reconciliation strategies, see settlement and payouts on Paystack in Kenya.
This is the question every Kenyan developer faces. M-Pesa has its own API (Daraja) that gives you direct access to STK push, C2B, B2C payouts, and more. Paystack wraps M-Pesa alongside other payment channels behind a unified API. So which do you use?
Use Paystack when:
Use direct Daraja when:
Use both when:
Many production Kenyan systems use both. Paystack handles the checkout, and Daraja handles the disbursement. This is a valid architecture. The key is to keep your payment records normalized so you can reconcile across both providers.
Testing Paystack in Kenya uses the same test mode as other markets, but there are Kenya-specific things to watch for.
Testing mobile money: In test mode, mobile money transactions are simulated. You will not receive an actual STK push on your phone. The test dashboard lets you simulate successful and failed mobile money payments. Test the full flow including webhook handling.
Common pitfalls for Kenyan integrations:
currency: 'KES', the API behavior may not match your expectations. Always be explicit about currency.KES 2,999
The definitive guide to building payment systems with Paystack — from your first transaction to production-grade payment infrastructure across Africa. 9 modules, 47 lessons. Free preview available.
Start Paystack Course