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. Build a Classifieds Site with Featured Listing Payments
Bonaventure OgetoBy Bonaventure Ogeto|Updated July 22, 2026

Build a Classifieds Site with Featured Listing Payments

Build a classifieds site with paid features by allowing free listing creation but gating "featured" and "bumped" placement behind a Paystack payment. Create the listing immediately on submission, but only elevate it to featured status after the charge.success webhook confirms payment. Auto-expire featured status after the paid duration.

In this article

  1. 1. Listing Creation and Featured Upgrade
  2. 2. Featured Expiry and Renewal Reminders
  3. 3. Learn More

Listing Creation and Featured Upgrade

Tables: listings (seller_id, category, title, description, price, images[], location, status, is_featured, featured_until, bumped_until, paystack_ref), feature_packages (name, price, duration_days, benefit).

var FEATURE_PACKAGES = {
  featured: { price: 500000, duration: 7,  label: 'Featured — top of search for 7 days' }, // NGN 5,000
  bumped:   { price: 200000, duration: 3,  label: 'Bumped — pushed to top for 3 days' },   // NGN 2,000
  urgent:   { price: 150000, duration: 3,  label: 'Urgent badge — highlight for 3 days' }, // NGN 1,500
};

// Free listing — goes live immediately
async function createListing(sellerEmail, sellerId, listingData) {
  return await db.listings.create({
    seller_id: sellerId, ...listingData,
    status: 'active',
    is_featured: false,
  });
}

// Seller wants to feature an existing listing
async function purchaseFeature(sellerEmail, listingId, packageName) {
  var pkg = FEATURE_PACKAGES[packageName];
  if (!pkg) throw new Error('Invalid package');

  var reference = 'FEAT-' + listingId + '-' + Date.now();
  await db.listings.update(listingId, { paystack_ref: reference });

  var res = 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: sellerEmail,
      amount: pkg.price,
      currency: 'NGN',
      reference,
      metadata: { listing_id: listingId, package_name: packageName, duration_days: pkg.duration },
    }),
  });
  return (await res.json()).data.authorization_url;
}

// Webhook: activate featured status
if (event.event === 'charge.success') {
  var meta = event.data.metadata;
  if (!meta.listing_id) return res.sendStatus(200);

  var featuredUntil = new Date();
  featuredUntil.setDate(featuredUntil.getDate() + meta.duration_days);

  var updateData = { is_featured: true };
  if (meta.package_name === 'featured') updateData.featured_until = featuredUntil;
  if (meta.package_name === 'bumped')   updateData.bumped_until = featuredUntil;

  await db.listings.update(meta.listing_id, updateData);
}

Featured Expiry and Renewal Reminders

// Cron: expire featured listings and send renewal reminders
async function processFeaturedExpiry() {
  var now = new Date();

  // Expire featured listings
  var expiredFeatured = await db.listings.findAll({ is_featured: true, featured_until_lt: now });
  for (var listing of expiredFeatured) {
    await db.listings.update(listing.id, { is_featured: false, featured_until: null });
    await sendFeaturedExpiredNotification(listing.seller_id, listing.id);
  }

  // Send renewal reminders 1 day before expiry
  var tomorrow = new Date(now.getTime() + 24 * 60 * 60 * 1000);
  var expiringSoon = await db.listings.findExpiringSoon(tomorrow);
  for (var listing of expiringSoon) {
    await sendRenewalReminder(listing.seller_id, listing.id, listing.featured_until);
  }
}

// Seller dashboard: listing performance
async function getListingStats(listingId) {
  var listing = await db.listings.findById(listingId);
  var views = await db.listingViews.countByListing(listingId);
  var contacts = await db.listingContacts.countByListing(listingId);
  return {
    views,
    contacts,
    contact_rate: views > 0 ? (contacts / views * 100).toFixed(1) + '%' : '0%',
    is_featured: listing.is_featured,
    featured_until: listing.featured_until,
  };
}

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

See build a job board with paid listings for the same paid listing model applied specifically to job postings.

Sign up for the McTaba newsletter

Key Takeaways

  • ✓Free listings go live immediately; featured status requires Paystack payment first.
  • ✓Support multiple upgrade options: featured (7 days), bumped (3 days), urgent badge (3 days).
  • ✓Auto-expire featured status via cron and send renewal prompts 1 day before expiry.
  • ✓Use the same pattern for any listing category: cars, property, electronics, services.
  • ✓Track which featured listings generate more views/contacts to refine your pricing.

Frequently Asked Questions

Should all listings require payment, or just the featured upgrade?
Start with free listings to build inventory — a classifieds site with no listings has no value for anyone. Once you have enough active listings (100+), you can test paid features. Some large classifieds (Jiji, OLX) start free, add featured upgrades, and only later gate basic posting. Free listings + paid upgrades is the proven model for early-stage growth.
How do I prevent the same listing from being posted multiple times by the same seller?
Add a duplicate detection check: before saving a new listing, query for active listings from the same seller in the same category with a similar title (fuzzy match) or same price. Flag duplicates for admin review or block them outright. For professional sellers (car dealers, agents), allow multiple listings but require account verification first.
Can I support a subscription model where sellers pay a flat monthly fee for unlimited featured listings?
Yes. Create a Paystack Plan for the seller subscription. On subscription.create, set a seller_plan: "pro" flag in your sellers table. In the purchaseFeature function, check if the seller has an active pro subscription and skip the Paystack charge if so. This is a good upsell for power sellers who post frequently.

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

Things You Can Build with Paystack: Project Guides

A complete map of real-world projects you can build using the Paystack API. From online store checkouts and subscription platforms to savings apps and solar pay-as-you-go systems, each category links to step-by-step build guides with working code.

Read more

Build a Parking Payment App

A build guide for a parking payment app where drivers scan a QR code on entry, pay for their session via Paystack (card or M-Pesa), and the system validates payment before the barrier lifts for exit. Covers time-based pricing, session management, and overstay handling.

Read more

Build a Referral Payout System

A build guide for a referral payout system where users share referral links, earn commissions when referrals convert, and withdraw their balance via Paystack Transfers to their bank account or M-Pesa wallet.

Read more

Build a Farmers Market Ordering Platform

A build guide for a farmers market ordering platform where customers order fresh produce from multiple farmers in one cart, the platform collects the combined payment via Paystack, and each farmer receives their share via Paystack Split Payments or Transfers. Covers inventory management, order routing to individual farmers, and delivery coordination.

Read more

WhatsApp Bot That Collects Payment via Paystack

How to build a WhatsApp bot that handles the full purchase flow: product browsing, order confirmation, Paystack payment link generation, webhook-driven payment confirmation, and order status updates back in the chat.

Read more

Onboarding Sellers to a Paystack Marketplace

A step-by-step guide to building a seller onboarding flow for a Paystack marketplace. Covers collecting bank details, validating with the Resolve Account endpoint, creating subaccounts, handling validation failures, designing the onboarding UI, and deciding when and how to add identity verification to the flow.

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.