Paystack in Kenya supports mobile money (including M-Pesa), card payments (Visa, Mastercard), and bank transfers. Mobile money is the highest-converting channel for consumer-facing products. Cards serve business customers and higher-value purchases. You can restrict channels using the channels parameter when initializing transactions.
Paystack in Kenya gives you three payment channel categories. Each serves a different customer segment and has different engineering characteristics.
To specify channels when initializing a 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: 300000, // 3,000 KES in cents
currency: 'KES',
channels: ['mobile_money', 'card', 'bank_transfer'],
reference: 'ke_' + Date.now(),
}),
});
If you omit the channels parameter, Paystack shows all available channels for your market.
Mobile money is the most important channel in Kenya. M-Pesa alone processes the vast majority of digital payments in the country. When you offer mobile money through Paystack, you are tapping into the payment method that most Kenyans use daily.
How the STK push flow works:
charge.success webhook to your serverPhone number handling:
// Normalize Kenyan phone numbers for Paystack
function normalizeKenyanPhone(phone) {
// Remove spaces, dashes, and brackets
var cleaned = phone.replace(/[s-()]/g, '');
// Convert 07XX to +2547XX
if (cleaned.indexOf('07') === 0 || cleaned.indexOf('01') === 0) {
return '+254' + cleaned.substring(1);
}
// Already has country code
if (cleaned.indexOf('+254') === 0) {
return cleaned;
}
if (cleaned.indexOf('254') === 0) {
return '+' + cleaned;
}
return cleaned;
}
Conversion characteristics:
Get weekly developer tips
Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.
No spam. Unsubscribe anytime.
Card payments in Kenya work for Visa and Mastercard holders. Card penetration is lower than in South Africa or Nigeria, but the segment is growing, especially among urban professionals, tech workers, and businesses.
Card flow:
When cards work well in Kenya:
Card-specific engineering considerations:
// Reuse a stored card authorization for recurring billing
var response = await fetch('https://api.paystack.co/transaction/charge_authorization', {
method: 'POST',
headers: {
Authorization: 'Bearer ' + process.env.PAYSTACK_SECRET_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
authorization_code: storedAuthCode,
email: customerEmail,
amount: 500000, // 5,000 KES
currency: 'KES',
reference: 'recurring_' + Date.now(),
}),
});
Bank transfers allow customers to pay by transferring directly from their bank account. This channel is less common for consumer purchases in Kenya (where M-Pesa dominates) but useful for specific scenarios.
When to offer bank transfers:
How it works:
Bank transfers are asynchronous. The customer needs to switch to their banking app to complete the transfer. This adds steps to the flow but is familiar for business transactions.
Your channel strategy in Kenya should be driven by your customer base. Here are common patterns:
Consumer e-commerce (B2C):
SaaS / subscriptions:
B2B / invoicing:
Marketplace (mixed audience):
// Channel selection based on transaction type
function getChannels(transactionType) {
if (transactionType === 'subscription') {
return ['card', 'mobile_money'];
}
if (transactionType === 'b2b_invoice') {
return ['bank_transfer', 'card'];
}
// Default: consumer purchase
return ['mobile_money', 'card'];
}
Before going live, test each payment channel you plan to offer. Use Paystack test mode with your test API keys.
Testing mobile money:
Testing cards:
Testing bank transfers:
A thorough testing checklist:
Each channel has different failure modes and conversion characteristics. Optimize for each one:
Mobile money optimization:
Card optimization:
General optimization:
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