Marketplaces are harder to bill than SaaS. You have two-sided fees (listing charges and final-value commissions), multi-recipient payouts, premium seller tiers, and refunds that have to ripple back through both the seller’s fees and the buyer’s payment. This guide shows how to compose Monigo’s primitives — metrics, plans, subscriptions, and events — into a working end-to-end marketplace billing layer.Documentation Index
Fetch the complete documentation index at: https://docs.monigo.co/llms.txt
Use this file to discover all available pages before exploring further.
The patterns here apply to most marketplaces — auction-style platforms like eBay, goods marketplaces like Etsy and Jumia, and services marketplaces. The worked example uses an eBay-style auction flow.
Mapping marketplace concepts to Monigo
| Marketplace concept | Monigo primitive |
|---|---|
| Sellers | Customers, tagged with metadata.role = "seller" |
| Listing fee per item | Metric with count aggregation, priced on a collection plan |
| Final-value commission | Metric with sum aggregation over a property you populate on each sale event |
| Seller earnings (payout) | Metric with sum aggregation, priced on a payout plan |
| Premium seller tier | A second collection plan with different pricing |
| Seller bank account | Payout account on the seller customer |
End-to-end flow
1. Create sellers as customers
Every seller is a Monigo customer. Tag them withmetadata.role so your code can distinguish sellers from buyers downstream.
2. Register the seller’s payout account
Sellers receive their earnings into a bank account linked to the customer record. Register it before the first payout is due.currency when a payout is initiated, so set is_default: true on the seller’s primary account in each currency you pay out.
3. Define the usage metrics
Monigo bills from metrics — named aggregations over the events you ingest. A marketplace needs three:| Metric | Event | Aggregation | Purpose |
|---|---|---|---|
listings | item_listed | count | One unit per listing — drives the listing fee |
platform_commission | item_sold | sum of commission_amount property | Total commission owed by the seller that period |
seller_earnings | item_sold | sum of seller_share property | Total amount the seller is owed that period |
sum-aggregation metrics require an aggregation_property naming the event property that carries the numeric value. You compute the commission (10%) and seller share (90%) in your own code when the sale completes, and pass both as properties on the item_sold event.
4. Create the fee plan and the earnings plan
A seller is billed by a collection plan (the fees you charge them) and paid by a payout plan (the earnings you owe them). Both plans point at the metrics you just defined. Collection plan — listing fee + commission:platform_commission. Because platform_commission sums the commission_amount property and you pass the commission in naira, one unit = ₦1 and the commission is passed through literally.
Payout plan — seller earnings:
5. Subscribe the seller to both plans
A customer can hold at most one active collection subscription and one active payout subscription at a time. Create both:409 Conflict.
6. Ingest a listing event
Events are sent in batches toPOST /v1/ingest. For each listing, send one event against item_listed:
idempotency_key must be unique per listing — resending the same key is a safe no-op. See Idempotency.
The ingest API requires an API key with the
ingest scope. Create a dedicated key in Dashboard → API Keys and use it from your event-emitting services.7. Ingest a sale event
When a buyer completes a purchase, compute the commission and seller share on your side, then ingest a singleitem_sold event carrying both values in its properties. One event drives two metrics:
platform_commissionrolls up by 2 500, adding ₦2 500 to the seller’s fees invoice.seller_earningsrolls up by 22 500, adding ₦22 500 to the seller’s payout bill.
8. Period close and payout
At the end of each billing period, Monigo runs two jobs automatically:- Invoice generation for the collection plan — a draft invoice is created with line items for listings and commission, then finalized and sent for payment on the seller’s payment method.
- Bill generation for the payout plan — a draft bill is created with a
seller_earningsline item, then finalized.
payout.success or payout.failed as the payment provider confirms settlement.
Premium seller tiers
Power sellers often get reduced commission in exchange for higher volume commitments. Model this as a separate collection plan — free listings and a lower commission multiplier — then move the seller onto it when they qualify.final_price instead of 10% when populating commission_amount. This way, changing commission rates never requires touching Monigo plans.
To move an existing seller onto the Power Seller plan, cancel their current collection subscription and create a new one. Their payout subscription is unaffected.
Refunds and disputes
When a buyer is refunded after the billing period has closed, both the seller’s commission invoice and the seller’s payout bill may need reversing. The public API supports two operations on finalised invoices and draft bills:POST /v1/invoices/<invoice_id>/void— voids an unpaid invoice. Firesinvoice.voided.- Void bills from Dashboard → Bills before payout is initiated.
payout.reversed. Subscribe to this webhook and settle the clawback against the seller’s next payout in your own books.
For in-period refunds (before the billing cycle closes), the simplest pattern is to subtract from the ongoing rollups by ingesting a compensating event with negative property values:
sum aggregation respects negative property values, so the rollups for platform_commission and seller_earnings drop by the refunded amount before the period closes. Use a distinct idempotency_key prefix (e.g., refund_) so refunds and sales can’t collide.
Alternative: seller-collects model
If you don’t want to be merchant of record, each seller can use their own Paystack or Flutterwave account. Buyers pay sellers directly; Monigo only bills sellers for platform fees. In this model, drop the payout plan and subscription entirely. Each seller has just a collection subscription, connects their own payment processor in the dashboard, and Monigo charges them at period end from their connected account. This is operationally simpler (no merchant-of-record obligations, no held funds, no payout step) but gives you less control over buyer experience and refund timing. Pick it when your sellers already run their own payment accounts.Webhooks to subscribe to
| Event | What it signals |
|---|---|
invoice.finalized | Seller’s monthly fees invoice is ready |
invoice.paid | Seller paid their listing + commission fees |
invoice.voided | An invoice was voided — used for refund reconciliation |
payout.success | A bill transfer completed successfully |
payout.failed | A bill transfer failed — surface to the seller and retry |
payout.reversed | A completed transfer was reversed by the provider |
subscription.suspended | Seller was suspended after failed dunning — pause their listings |
Related
- Metering — how events become usage rollups and line items
- Pricing Models — full reference for
flat_unit,tiered,package, and other models - Subscription Lifecycle — pausing a seller, plan changes, cancellation
- Event-Driven Payouts — deeper background on the collection/payout plan split
- Idempotency — why every listing, sale, and refund needs a stable idempotency key

