Marketplace payouts

Take a payment, then split it โ€” a ledger of what each seller is owed.

class=com># on a completed sale
fee = int(price_cents * 0.15)              class=com># 15% platform fee
app.money.split([(listing.seller, price_cents - fee),
                 ("platform", fee)], sku="listing:%d" % listing.id)

Read & settle the ledger

app.money.owed("seller:alice")     class=com># cents currently owed (pending rows)
app.money.payouts("seller:alice")  class=com># the payout rows
app.money.mark_paid(payout_id)     class=com># settle one when you pay the seller out

Amounts can be "$8.50" strings or integer cents. Pass a unique ref to split() and skip if it already exists to avoid double-recording on page refresh.

Dynamic per-item prices

Pair the ledger with app.money.require(req, sku=..., cents=...) โ€” an imperative paywall for catalogs where the price isn't known until request time โ€” plus file uploads for product images. Full walk-through: the free marketplace course and the marketplace example.