3 ms·
How did you go about implementing a referral program in Stripe?
by james_s_tayler 8y ago
How did you go about implementing a referral program in Stripe?
- stickfigure 8y agoI have a polymorphic ledger table of Credit, Spend, Payout. I scan recent invoice history periodically to keep Credits up to date. Payouts are via PayPal masspay. Spends (using credit balance to offset their SaaS bill) are created on the invoice.created webhook, which adds a corresponding negative line item to the invoice. I considered doing everything in Stripe - you can add pending invoice items instead of credits and payouts, then 'spends' are just the natural processing of bills - but it would have been very difficult to get analytics (eg, total outstanding payout liability).