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. Building an Events Ticketing Platform with Splits
Bonaventure OgetoBy Bonaventure Ogeto|Updated July 22, 2026

Building an Events Ticketing Platform with Splits

Create an organizer subaccount at event registration. Set the split so the organizer receives the ticket price minus the platform booking fee. Initialize each ticket purchase with the organizer's subaccount and percentage_charge set to the organizer's share. On charge.success, generate and email the ticket to the buyer. Hold organizer funds until post-event to protect against cancellations.

Ticket Checkout with Split

// Sell a ticket with organizer split
app.post('/api/events/:id/tickets', async (req, res) => {
  var { ticketType, email, quantity } = req.body;
  var event = await db.events.findById(req.params.id);
  var organizer = await db.organizers.findById(event.organizer_id);

  var ticketPrice = event.ticket_prices[ticketType]; // e.g., 5000 NGN
  var totalAmount = ticketPrice * quantity;
  var platformFee = 500; // NGN 500 per order flat booking fee
  var organizerShare = totalAmount - platformFee;

  var reference = 'tkt_' + event.id + '_' + Date.now();

  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,
      amount: totalAmount * 100,
      subaccount: organizer.subaccount_code,
      transaction_charge: platformFee * 100, // Platform booking fee in kobo
      bearer: 'account',
      reference,
      metadata: {
        event_id: event.id,
        ticket_type: ticketType,
        quantity,
      },
    }),
  });

  var data = await response.json();
  res.json({ authorization_url: data.data.authorization_url });
});

// Webhook: generate and send tickets on payment
if (event.event === 'charge.success') {
  var meta = event.data.metadata;
  if (meta?.event_id) {
    var tickets = await generateTickets(meta.event_id, meta.ticket_type, meta.quantity);
    await sendTicketEmail(event.data.customer.email, tickets);
    await db.sales.create({
      reference: event.data.reference,
      event_id: meta.event_id,
      email: event.data.customer.email,
      ticket_type: meta.ticket_type,
      quantity: meta.quantity,
      status: 'paid',
    });
  }
}

Learn More

This guide is part of the Paystack split payments guide.

Sign up for the McTaba newsletter

Key Takeaways

  • ✓Create an organizer subaccount per event host. Reuse the same subaccount for all events by that organizer.
  • ✓Set the organizer's percentage_charge per transaction (e.g., 85%) — your platform keeps 15% as a booking fee.
  • ✓Generate tickets (PDF or QR code) only after charge.success webhook confirms payment.
  • ✓Hold organizer settlement until after the event date to protect against last-minute cancellations.
  • ✓For multi-tier tickets (VIP, Regular, Early Bird), use the same subaccount but different transaction amounts per ticket type.
  • ✓Issue refunds via the Paystack refund API. Partial refund the ticket price if a service fee is non-refundable.

Frequently Asked Questions

When should I release ticket revenue to the organizer?
Best practice: release after the event date passes without a cancellation. This protects buyers if the event is cancelled. Communicate this to organizers upfront. Set a manual settlement window and trigger payout 24-48 hours after the event end date.
How do I handle event cancellation refunds?
If the event is cancelled before the event date and organizer settlement has not been initiated, issue full refunds via the Paystack refund API. If organizer funds have already been released, you must recover from the organizer directly. This is why holding funds until post-event is important.
Can I support multiple ticket tiers (VIP, Regular, Early Bird) with splits?
Yes. The split configuration (subaccount + platform fee) is the same regardless of ticket tier. The difference is only the transaction amount per ticket type. Store ticket prices in your events table and calculate the split based on the chosen tier's price.
How do I issue QR code tickets after payment?
In your charge.success webhook handler, generate a unique QR code per ticket (encode ticket_id + event_id + buyer_email in the QR payload). Store it in your database and send via email. At event check-in, scan the QR code and verify against your database.

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

How Paystack Transfers Work End to End

Walk through the entire Paystack transfer lifecycle: how money moves from your Paystack balance to a bank account or mobile wallet, the status transitions along the way, what happens when things go wrong, and how to track every step with webhooks.

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.