For those who’ve built systems that need to charge by an ‘event’, like an API call, how did you meter usage and then bill customers?<p>How’s that system holding up today?
We used Stripe to build it. Something like:<p>- Set users to a subscription cadence once they upload a payment method<p>- Add a backend job that aggregates usage in the form that you're metering (with lots of lots of unit tests to make sure you know what to expect) and post that as an invoice item to the customers' account in Stripe, but don't collect<p>- Periodically have a subscription in Stripe (typically monthly) go and bill for all the open invoice items. This grabs all of the usage that hasn't been invoiced in the period and bills for it. If the total value is $0, skip that month.<p>- Let users manage receipts and invoices in Stripe, and make sure the line items on the invoices correspond with user meaningful usage metering
You should check <a href="https://hyperline.co" rel="nofollow noreferrer">https://hyperline.co</a>, does everything (metering, subs, invoicing) and it's self-serve if needed