4
3 Comments

Please explain Stripe subscriptions to me

I'm working on Stripe integration for an upcoming project and I'm very confused, so hoping someone can help me out.

I want to use pricing similar to most cloud hosting providers: You use the resources you need and once per month you get billed for what you've used. Usage intervals are not fixed at a month, instead I only bill for the time a resource is used (used 1 hour -> get charged for 1 hour only). I also want to generate just one invoice per month and not one per resource.

So I've built this using Stripe subscriptions. When a resource is created, I create a matching Stripe subscription for the customer. It will instantly generate an invoice, which is not what I want. I think I could modify the invoice date using the billing_cycle_anchor setting, but it would still generate one invoice per resource.

I've been looking around the Stripe docs and I don't understand how to make this work. Are subscription items the answer? I could create a single subscription per customer and add all resources as items. But 1) will this work with items that are created and then deleted before the invoice is generated (if it existed for one day I want to have it create a prorated charge for that day)? And b) can I even add multiple subscription items of the same product/price? The dashboard won't let me do this. Or is the answer to modify the quantities and it will automatically handle proration?

Or am I missing something? What I want to avoid is to record usage myself and create invoice items manually.

Thanks.

on September 3, 2021
    1. 1

      Thanks, you're right, using metered billing would solve my problem. But I'm trying to not have to record and report usage manually; everything I offer is fixed price and not dynamic so it shouldn't be necessary.

      I did play with subscription items a bit and it does seem to work how I want it to. But every time you change a quantity it generates a prorated deduction and then another prorated charge, which makes for very messy invoices. Hmm.

      1. 1

        Metered billing does sound like what you'd want, if you're charging based on usage. But if it's more that you're charging based on discrete products used in a month, should be able to look at https://stripe.com/docs/billing/subscriptions/multiple-products

        So I've built this using Stripe subscriptions. When a resource is created, I create a matching Stripe subscription for the customer.

        If you're creating multiple subscriptions per user per resource, sounds more like multiple products is what you'd want.