barok robel
barok robel

Reputation: 1

How to implement postpaid billing with prorated charges when changing plans in Stripe?

I'm building a subscription-based system using Stripe, and I'm trying to implement postpaid billing with prorated charges when users switch plans mid-cycle. Here's the flow I'm aiming for:

  1. Plans: I have two subscription plans:

    • £5/month
    • £10/month
  2. Postpaid Billing:

    • When a user subscribes to the £5/month plan, I do not want to charge them immediately. Instead, they should be billed at the end of their billing cycle for the portion of the plan they've used. For example, if a user subscribes today, they will be billed on October 19 for the usage from today until then.
  3. Prorated Billing on Plan Change:

    • If the user changes their plan midway through the billing cycle (e.g., from the £5 plan to the £10 plan), I want to calculate the prorated amount for the days they've used from the £10 plan. For example, if they use 15 days of the £5 plan, they should be billed £2.5 for that.
    • After switching to the £10 plan, the new billing cycle should start, and the user will be billed for the new plan at the end of the next billing cycle, again using postpaid billing (not prepaid).

Is it possible to achieve this in Stripe? How should I set up the subscription and handle the plan changes to support both postpaid billing and prorated charges? Any advice or examples would be appreciated!

Is it possible to achieve this in Stripe? How should I set up the subscription and handle the plan changes to support both postpaid billing and prorated charges? Any advice or examples would be appreciated!

Upvotes: 0

Views: 46

Answers (1)

Pompey
Pompey

Reputation: 1354

This is possible with Stripe but would take two workarounds stacked on top of each other.

Currently all of Stripe's Subscription functionality charges at the beginning of the month, with the one exception being usage based billing. As a workaround, it is possible to define a tiered usage-based price[0] with one tier that has a flat price[1]. For your usecase, you would would set up two of such prices, one for £5 and one for £10.

The catch here is that that configuration does not support Stripe's proration functionality. So as a second workaround you would need to specify proration_behavior='none' when updating your subscription and then provide your own invoice items representing the proration. The update subscription endpoint does have an add_invoice_item parameter, so you can pre-calculate the proration and add the items while upgrading your subscription.

I understand that that is not ideal, but that is the best way to accomplish the billing model that you described via Stripe. You can reach out to Stripe's support to create feature requests for the things that would make this use-case easier[2] but for now these would be the workarounds to go with.

[0] https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide#subscribe-customer-to-usage-based-price

[1] https://docs.stripe.com/api/prices/create#create_price-tiers-flat_amount

[2] https://docs.stripe.com/api/subscriptions/create#create_subscription-add_invoice_items

Upvotes: -1

Related Questions