McTaba Labs logo
Software EngineeringThe WhiteboardProjectsEventsMasterclassesWebinarsLearn
Book Call

500+ developers already in the community

Get answers, find accountability partners, and stay ahead

Join Discord →
McTaba Labs logo

Educating 1 million students in tech by 2030.

Programs

  • HighSchool Graduates Launchpad
  • AI & Business Automation
  • Corporate Training
  • McTaba Story & Mission
  • Full-Stack Curriculum
  • Course Pricing & Plans
  • Frequently Asked Questions

Resources

  • Join Discord Community
  • Tech Events in Nairobi
  • Masterclasses
  • Free Resources
  • Learn
  • Campus
  • Africa Tech Talent Report
  • Partner With Us
  • Start a Project
  • Our Work

Contact Us

  • 124 Manyani East Road, Lavington, Nairobi
  • +254727795603
  • Book a Discovery Call

Office Hours:

Mon-Fri: 9am - 2pm EAT

Sat: 10am - 12pm EAT

© 2027 McTaba Labs - A product of Edtech Industries. All rights reserved.

Privacy PolicyTerms of ServiceRefund Policy
  1. Learn
  2. Paystack for African Developers
  3. Split Payment Reconciliation and Subaccount Reporting
Bonaventure OgetoBy Bonaventure Ogeto|Updated July 22, 2026

Split Payment Reconciliation and Subaccount Reporting

Query GET /transaction?subaccount=SUB_xxx to list all transactions for a specific subaccount. Compare the amount field (minus fees) against your internal orders table for that vendor. Build vendor earnings statements by joining your orders table with subaccount settlement data. Flag transactions where the expected vendor share differs from the actual settled amount by more than NGN 1.

In this article

  1. 1. Per-Vendor Earnings from Your Database
  2. 2. Weekly Reconciliation Script
  3. 3. Learn More

Per-Vendor Earnings from Your Database

-- Vendor earnings statement for a specific month
SELECT
  v.id as vendor_id,
  v.business_name,
  v.subaccount_code,
  COUNT(o.id) as order_count,
  SUM(o.total_amount) as gross_sales,
  SUM(o.platform_commission) as platform_commission,
  SUM(o.total_amount - o.platform_commission) as net_earnings,
  SUM(o.paystack_fee_absorbed) as fees_absorbed,
  SUM(o.total_amount - o.platform_commission - o.paystack_fee_absorbed) as settled_amount
FROM vendors v
JOIN orders o ON o.vendor_id = v.id
WHERE o.status = 'paid'
  AND o.paid_at BETWEEN '2026-07-01' AND '2026-07-31'
GROUP BY v.id, v.business_name, v.subaccount_code
ORDER BY net_earnings DESC;

Weekly Reconciliation Script

// Pull Paystack transactions per subaccount and compare
async function reconcileSubaccount(subaccountCode) {
  var response = await fetch(
    'https://api.paystack.co/transaction?subaccount=' + subaccountCode + '&status=success&perPage=100',
    { headers: { Authorization: 'Bearer ' + process.env.PAYSTACK_SECRET_KEY } }
  );
  var { data } = await response.json();

  var discrepancies = [];

  for (var tx of data) {
    var localOrder = await db.orders.findOne({
      where: { reference: tx.reference, subaccount_code: subaccountCode }
    });

    if (!localOrder) {
      discrepancies.push({ type: 'missing_local', reference: tx.reference });
      continue;
    }

    var expectedVendorShare = localOrder.total_amount - localOrder.platform_commission;
    var actualVendorShare = tx.subaccount?.amount / 100;

    if (Math.abs(expectedVendorShare - actualVendorShare) > 1) {
      discrepancies.push({
        type: 'amount_mismatch',
        reference: tx.reference,
        expected: expectedVendorShare,
        actual: actualVendorShare,
      });
    }
  }

  return discrepancies;
}

Get weekly developer tips

Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.

No spam. Unsubscribe anytime.

Learn More

This guide is part of the Paystack split payments guide.

Sign up for the McTaba newsletter

Key Takeaways

  • ✓Use GET /transaction?subaccount=SUB_xxx to pull all transactions for a specific vendor subaccount.
  • ✓Your local database is the source of truth for expected vendor share — compare against Paystack API data.
  • ✓Build per-vendor monthly earnings statements from your orders table for vendor portal dashboards.
  • ✓Run a weekly reconciliation script that flags any transaction where actual settlement differs from expected.
  • ✓Use the Paystack settlement endpoint (GET /settlement) to see what has actually been paid out to each subaccount.
  • ✓Store the subaccount_code on every order record to enable fast per-vendor reporting without calling the Paystack API.

Frequently Asked Questions

How do I show vendors their earnings in a vendor portal?
Query your local orders table by vendor_id for the date range. Display: total sales, platform commission deducted, Paystack fee (if vendor bears), and net earnings. Do not call the Paystack API on every vendor portal page load — use your local database for fast queries.
What is the difference between transaction amount and settled amount for a subaccount?
The transaction amount is what the customer paid. The subaccount settled amount is what Paystack transferred to the vendor after deducting the platform commission and any applicable Paystack fee. Always reconcile against settled amounts, not transaction amounts.
Can I get a bulk settlement report from Paystack?
Yes. Use GET /settlement to list all settlements. Pass subaccount=SUB_xxx to filter by vendor. The settlement endpoint shows the exact NGN amount transferred to each subaccount bank account, which is your definitive payout record.
How do refunds affect vendor earnings in reconciliation?
A refund reverses the split. If you refund NGN 5,000 on a transaction where the vendor received NGN 4,000, Paystack deducts NGN 4,000 from the vendor subaccount settlement. Reflect this in your vendor earnings reports by subtracting refunded amounts from gross sales.

Learn Paystack Integration

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

Not ready? Create Free Account

Keep reading

Paystack Split Payments and Marketplaces: Complete Guide

Everything you need to split payments on Paystack: creating subaccounts, choosing between percentage and flat splits, multi-split transactions, fee configuration, delayed settlement, escrow-style patterns, and building real marketplace products with working Node.js code.

Read more

Percentage vs Flat Split Configuration on Paystack

A detailed comparison of percentage and flat split configurations on Paystack. Covers how each model works, worked margin calculations across different transaction sizes, when to use percentage vs flat, implementing per-transaction overrides, and building hybrid models that combine both approaches.

Read more

Escrow-Style Flows on Paystack and Their Limits

A thorough analysis of what escrow-style flows you can and cannot build on Paystack. Covers the difference between true escrow and delayed settlement, how to use manual settlement for hold-and-release patterns, the limits around hold duration and fund recovery, regulatory considerations in African markets, and when Paystack is not the right tool for escrow.

Read more

Building a Freelance Marketplace on Paystack

A freelance marketplace holds client funds until the work is approved, then releases to the freelancer. This guide covers implementing that hold-and-release pattern using Paystack delayed settlement, collecting platform commission via splits, and handling disputes and refunds.

Read more

Transfer OTP: Enabling, Disabling and Automating

Paystack requires OTP confirmation for transfers by default. This guide explains the OTP flow, how to disable it for automated payout systems, the security trade-offs of disabling OTP, and how to build your own application-level approval controls to replace OTP with something better suited to production automation.

Read more

Explore related topics

M-Pesa & African Stack

M-Pesa Daraja API tutorials, USSD development, and WhatsApp Business API guides. The African Stack that global bootcamps do not teach.

Learn to Code in Kenya

Everything a Kenyan needs to know before writing their first line of code. Career paths, real costs, hardware requirements, and honest answers about what it takes.

Learning to Code

Roadmaps, language guides, and practical advice for learning to code and launching a programming career.

Breaking Into Tech

Practical, no-nonsense guides for anyone looking to start or change their career in tech. From choosing your first language to acing interviews.

The African Stack: Skills for This Market

The skills that make Kenyan developers hard to replace: M-Pesa, USSD, WhatsApp, fintech, and building for the African market.

Bonaventure Ogeto

Bonaventure Ogeto

Founder, McTaba Labs

Bonaventure is the founder of McTaba Labs, a coding bootcamp in Nairobi, Kenya. He has spent years building products for the African market and mentoring the next generation of developers across the continent.