Paystack direct debit allows you to charge a customer bank account directly on a recurring basis after the customer authorizes a mandate. The mandate specifies the amount and frequency. Once authorized, you can initiate debits without the customer taking action each time. It is suitable for subscription billing, loan repayments, and recurring collections where card expiry is a problem.
Direct debit is a payment method where you (the merchant) pull money from a customer's bank account. Unlike a bank transfer where the customer pushes money to you, direct debit gives you the ability to initiate the charge on your end.
The customer authorizes this upfront by creating a "mandate": a formal agreement that says "I authorize [Your Business] to debit my account at [Bank] for [Amount] every [Frequency]." Once the mandate is active, you can initiate debits according to the agreed schedule without the customer taking any action.
Direct debit is different from other Paystack payment channels:
The result is the most hands-off recurring payment method available: set it up once, charge on schedule, and the money arrives without the customer doing anything.
Direct debit makes sense when the payment is recurring, predictable, and the customer relationship is ongoing:
Subscription billing
Monthly SaaS subscriptions, media subscriptions, or membership fees. Card-based recurring billing fails when cards expire. Direct debit from a bank account does not have this problem.
Loan repayments
Lending platforms need reliable, automated collections. Direct debit lets you pull the repayment on the due date without depending on the borrower to remember and act.
Insurance premiums
Monthly or quarterly insurance payments that need to arrive on time to keep coverage active.
Savings and investment contributions
Automated savings apps that pull a fixed amount weekly or monthly from the customer account.
Utility and service bills
Internet service providers, co-working spaces, or any service with regular billing.
Direct debit is not ideal for one-time payments, variable-amount charges where the amount changes unpredictably, or transactions where the customer expects to control exactly when payment happens.
Get weekly developer tips
Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.
No spam. Unsubscribe anytime.
Once a mandate is active, you can initiate debits according to the agreed schedule. Each debit is a separate transaction that references the mandate.
// Initiate a direct debit charge
async function chargeDirectDebit(mandateRecord) {
var response = await fetch('https://api.paystack.co/direct_debit/charge', {
method: 'POST',
headers: {
Authorization: 'Bearer ' + process.env.PAYSTACK_SECRET_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
mandate: mandateRecord.mandate_id,
amount: mandateRecord.amount,
reference: 'dd_' + mandateRecord.user_id + '_' + new Date().toISOString().slice(0, 7),
}),
});
var data = await response.json();
return data;
}
// Scheduled job: run on the 1st of each month
async function processMonthlyDebits() {
var activeMandates = await db.mandates.findAll({
where: { status: 'active' },
});
for (var i = 0; i < activeMandates.length; i++) {
var mandate = activeMandates[i];
try {
var result = await chargeDirectDebit(mandate);
console.log('Debit initiated for mandate: ' + mandate.mandate_id);
} catch (err) {
console.log('Debit failed for mandate: ' + mandate.mandate_id);
console.log('Error: ' + err.message);
}
}
}
Direct debit charges are not instant. The debit is initiated, and it takes time for the bank to process and confirm. You receive a webhook when the debit is confirmed or when it fails. Do not grant value based on the initiation alone. Wait for the confirmation webhook.
Direct debits can fail or be reversed for several reasons:
// Webhook handler for direct debit events
app.post('/webhooks/paystack', function(req, res) {
res.sendStatus(200);
var event = req.body;
if (event.event === 'charge.success') {
// Direct debit confirmed
handleSuccessfulDebit(event.data);
}
if (event.event === 'charge.failed') {
// Direct debit failed
var reason = event.data.gateway_response;
handleFailedDebit(event.data, reason);
}
// Handle mandate-specific events if available
if (event.event === 'mandate.revoked') {
handleMandateRevocation(event.data);
}
});
async function handleFailedDebit(data, reason) {
var mandate = await db.mandates.findByReference(data.reference);
// Update the mandate status
await db.mandates.update(mandate.id, {
last_failure_reason: reason,
consecutive_failures: mandate.consecutive_failures + 1,
});
// After 3 consecutive failures, notify the customer to update their mandate
if (mandate.consecutive_failures + 1 >= 3) {
await notifyCustomerMandateIssue(mandate.user_id);
}
}
Both direct debit and card-based recurring billing (using saved authorization codes) achieve the same goal: charge the customer periodically without their active involvement. Here is how they compare:
| Factor | Direct Debit | Card Billing |
|---|---|---|
| Payment source | Bank account | Debit/credit card |
| Expiry risk | Low (accounts rarely change) | High (cards expire every 2-5 years) |
| Setup friction | Higher (mandate authorization) | Lower (one card payment) |
| Processing speed | Slower (bank processing) | Faster (instant or near-instant) |
| Customer base | Anyone with a bank account | Only cardholders |
| Availability | Limited to supported banks | All Paystack-supported cards |
In markets where card penetration is low but bank account ownership is high, direct debit can reach more customers. In markets where customers are accustomed to card payments, card billing is simpler to set up and faster to process.
Many businesses use both: card billing as the default and direct debit as an option for customers who prefer it or do not have cards.
Direct debit involves pulling money from someone's account. Clear communication is not optional. Here is what to communicate at each stage:
Customers who feel informed about charges are far less likely to dispute them. Customers who see unexpected debits go to their bank and reverse them, which costs you time and money.
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