Bonaventure OgetoBy Bonaventure Ogeto|

Funding Your Paystack Balance Programmatically

Paystack balances are funded in two main ways: through customer payments (which settle into your balance automatically) and through direct deposits to a dedicated funding account (bank transfer to the account shown in your Paystack dashboard). Paystack does not provide an API endpoint for depositing money. Monitor your balance programmatically using GET /balance and set up alerts before scheduled payout runs.

How Your Paystack Balance Gets Funded

Your Paystack balance grows from two sources.

Customer payments. Every successful payment through your Paystack integration adds to your balance. The money enters your total balance immediately but is not available for transfers until it completes the settlement cycle. The settlement cycle depends on your account configuration and market (often T+1 or next business day in many markets).

Direct deposits. You can fund your balance by making a bank transfer to a dedicated account provided by Paystack. Log into your Paystack dashboard and look for the "Fund Balance" or "Dedicated Account" section. Paystack assigns you an account number at a partner bank. Any deposit to that account is credited to your Paystack balance.

Direct deposits are useful when your payout obligations exceed your incoming payments, or when you need to pre-fund payouts (like payroll) that are not covered by customer revenue.

Dedicated Virtual Accounts

Paystack can assign a dedicated virtual account (DVA) to your business. This is a permanent bank account number at one of Paystack's partner banks. Any transfer to this account is credited to your Paystack balance.

To set up a DVA, check your Paystack dashboard under Settings or Contact Paystack support. The availability and configuration of DVAs depends on your market and account type.

Once you have a DVA, your finance team can set up a standing order or recurring transfer from your company's bank account to keep your Paystack balance funded. This is especially useful for companies that run regular payouts (weekly vendor settlements, monthly payroll) and need a predictable balance.

// You cannot create DVAs through the API for balance funding
// But you can monitor when funds arrive using the balance endpoint

async function checkForNewFunding(previousBalance, currency) {
  var current = await getAvailableBalance(currency);

  if (current.total > previousBalance) {
    var increase = current.total - previousBalance;
    console.log(
      'Balance increased by ' + (increase / 100) + ' ' + currency
      + '. New balance: ' + (current.total / 100)
    );

    // Check if we now have enough for pending payouts
    var pendingTotal = await db.payouts.sumPendingAmount(currency);
    if (current.total >= pendingTotal) {
      console.log('Balance sufficient for all pending payouts. Ready to execute.');
      return { ready: true, balance: current.total };
    }
  }

  return { ready: false, balance: current.total };
}

Automated Balance Monitoring

// Run every hour or on a schedule matching your payout cadence
async function monitorBalance() {
  var currencies = ['NGN', 'KES', 'GHS'];

  for (var i = 0; i < currencies.length; i++) {
    var currency = currencies[i];
    var balance = await getAvailableBalance(currency);

    // Check against upcoming payouts
    var upcomingPayouts = await db.payouts.sumApprovedAmount(currency);

    var status = {
      currency: currency,
      available: balance.total / 100,
      upcoming: upcomingPayouts / 100,
      surplus: (balance.total - upcomingPayouts) / 100,
      canCoverPayouts: balance.total >= upcomingPayouts,
    };

    // Low balance alert
    if (!status.canCoverPayouts) {
      await sendAlert({
        type: 'funding_needed',
        message: currency + ' balance (' + status.available
          + ') cannot cover upcoming payouts (' + status.upcoming
          + '). Shortfall: ' + Math.abs(status.surplus) + ' ' + currency,
        urgency: 'high',
      });
    }

    // Healthy balance log
    console.log(
      currency + ': Available=' + status.available
      + ', Upcoming=' + status.upcoming
      + ', Surplus=' + status.surplus
    );
  }
}

Set the monitoring frequency based on your payout cadence. If you run daily payouts, check the balance every 2-4 hours. If payouts are weekly, a daily check is sufficient. The key is to catch shortfalls before the payout execution window, giving your finance team time to fund the balance.

Integrating Funding Into Your Payout Pipeline

The best payout systems do not fail when the balance is short. They hold payouts until the balance is funded.

async function executePayoutsWithFundingCheck(currency) {
  var approved = await db.payouts.findApprovedByCurrency(currency);
  if (approved.length === 0) return;

  var totalNeeded = 0;
  for (var i = 0; i < approved.length; i++) {
    totalNeeded += approved[i].amountMinorUnit;
  }

  var balance = await getAvailableBalance(currency);

  if (balance.total >= totalNeeded) {
    // Full execution
    console.log('Balance sufficient. Executing all ' + approved.length + ' payouts.');
    await executeBatch(approved, currency);
    return;
  }

  // Partial execution: prioritize by age (oldest first)
  var sorted = approved.sort(function(a, b) {
    return new Date(a.createdAt) - new Date(b.createdAt);
  });

  var runningTotal = 0;
  var canExecute = [];
  var mustWait = [];

  for (var j = 0; j < sorted.length; j++) {
    if (runningTotal + sorted[j].amountMinorUnit <= balance.total) {
      runningTotal += sorted[j].amountMinorUnit;
      canExecute.push(sorted[j]);
    } else {
      mustWait.push(sorted[j]);
    }
  }

  if (canExecute.length > 0) {
    console.log(
      'Partial execution: ' + canExecute.length + ' payouts now, '
      + mustWait.length + ' held for funding.'
    );
    await executeBatch(canExecute, currency);
  }

  if (mustWait.length > 0) {
    await sendAlert({
      type: 'partial_execution',
      message: mustWait.length + ' payouts held due to insufficient '
        + currency + ' balance. Fund ' + ((totalNeeded - balance.total) / 100)
        + ' ' + currency + ' to cover the remainder.',
    });
  }
}

This approach maximizes the number of payouts processed with the available balance while holding the rest for later. It is better than the alternative of failing the entire batch because the balance is 10% short.

Aligning Payouts with Settlement Timing

If your payouts are funded by customer payments (the most common model for marketplaces), you need to align your payout schedule with your Paystack settlement cycle.

Example: If your settlement cycle is T+1 (next business day), customer payments received on Monday settle into your available balance by Tuesday. If you run vendor payouts on Monday, you only have access to funds from Saturday's payments and earlier. Monday's customer payments are not yet available.

Practical guidelines:

  • Run payouts at least one full settlement cycle after the revenue period ends
  • Weekly payouts for the Monday-Sunday period should run on Wednesday or later
  • Monthly payouts for July should run on the 3rd or 4th of August
  • Always check the actual available balance before executing, regardless of what you expect

For the broader payout scheduling picture, see payout scheduling and batching strategies. For balance checks, see transfer balance checks before initiating payouts.

Build Reliable Payout Systems

Balance management is the unglamorous part of payout systems that makes everything else work. Get it right, and payouts flow smoothly. Get it wrong, and your vendors stop trusting you.

The McTaba bootcamp covers the full payment infrastructure stack, including the operational aspects that textbooks skip.

Create a free McTaba account

Key Takeaways

  • Paystack balances are funded through customer payments (automatic) and direct bank deposits to your dedicated funding account (manual).
  • There is no API endpoint for depositing money into your Paystack balance. Funding is done through bank transfers to the account shown in your dashboard.
  • Customer payments settle into your available balance on the settlement schedule configured for your account.
  • Monitor your balance programmatically using GET /balance and build alerts that notify your team when the balance drops below thresholds.
  • Integrate balance checks into your payout pipeline so payouts are held (not failed) when the balance is insufficient.
  • For platforms that rely on customer payments to fund payouts, align your payout schedule with your settlement cycle.

Frequently Asked Questions

Can I fund my Paystack balance through the API?
No. Paystack does not provide an API endpoint for depositing money into your balance. You fund it through bank transfers to your dedicated account or through customer payments. You can monitor your balance programmatically using the GET /balance endpoint.
How long does it take for a direct deposit to appear in my Paystack balance?
This depends on the bank transfer speed and Paystack processing. Interbank transfers may take a few hours. Same-bank transfers are typically faster. Check with Paystack for the expected processing time for deposits to your dedicated account.
Can I move funds between currencies in my Paystack account?
Paystack does not provide currency conversion between balances. Your NGN balance and KES balance are separate. To fund your KES balance, you need KES payments or KES deposits. You cannot convert NGN to KES within Paystack.

Ready to build real-world apps?

Join the McTaba Labs full-stack marathon (4 months full-time · 6 months part-time). Learn M-Pesa, USSD, and WhatsApp engineering while shipping 8 production apps.

Apply to the McTaba Marathon