Larz › Marketplace payments in Python
A marketplace, with payouts, in Python
Most frameworks help you take a payment. Larz also helps you split it — so a marketplace knows exactly what each seller is owed.
pip install larz
@app.get("/bought/<id:int>")
def bought(req):
lst = Listing.get(req.params["id"])
fee = int(lst.price_cents * 0.15) # 15% platform fee
app.money.split([(lst.seller, lst.price_cents - fee),
("platform", fee)], sku="listing:%d" % lst.id)
return "Thanks for your purchase!"
app.money.owed("seller:42") # cents pending
app.money.mark_paid(payout_id) # when you settle the seller
Money-native, end to end
Combine the split ledger with per-listing checkout (app.money.require for dynamic
prices), file uploads for product images, and any of Larz's 14 payment providers. The
marketplace
example puts it all in one file, and the free
marketplace course builds it step by step.
FAQ
How are payouts tracked?
app.money.split() records a ledger row per party (seller, platform). owed(party) sums the pending rows; mark_paid() settles one.
Can I use dynamic, per-item prices?
Yes. app.money.require(req, sku=..., cents=...) is an imperative paywall for catalogs where the price isn't known until request time.