TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How did you set up usage-based billing?

4 点作者 Dwolb超过 1 年前
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?

2 条评论

rogerkirkness超过 1 年前
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&#x27;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&#x27; account in Stripe, but don&#x27;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&#x27;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
评论 #38264189 未加载
评论 #38250400 未加载
lucasbedout超过 1 年前
You should check <a href="https:&#x2F;&#x2F;hyperline.co" rel="nofollow noreferrer">https:&#x2F;&#x2F;hyperline.co</a>, does everything (metering, subs, invoicing) and it&#x27;s self-serve if needed
评论 #38250408 未加载