Reputation: 1332
I'm creating a SaaS with 4 subscription plans: 1 free and 3 paid.
Users can stay in the Free Plan always as they want, but when a user change to a paid subscription, I want to set same billing date as previous Free Plan and only pay (at billing cycle end) from current date to previous free plan end date. I'm using the checkout session create API endpoint, I don't want to use the subscription create API endpoint because I need to control a lot of more things.
For example:
billing_cycle_anchor
timestamp. Then the subscription billing cycle will be 20-02 / 20-03.There are any way to do it without trials or subscription schedules?
Thanks!
UPDATE 1: Maybe I can cancel the subscription on webhook and create a new subscription with the correct billing_cycle_anchor
? It's a "right-way" solution?
Upvotes: 0
Views: 2016
Reputation: 21834
billing_cycle_anchor
can be set via the Checkout session since since 26 April, 2023. See docs.
Example in JSON pseudo-code:
{
"mode": "subscription",
"subscription_data": {
"billing_cycle_anchor": 1682985600
}
}
Upvotes: 1
Reputation: 1981
It sounds like you want to do a proration update. It should be done via the regular Subscription API, in other words, you can't do it with just the Checkout API, and also shouldn't cancel and recreate the Subscription as you mentioned.
When it's not necessary for Subscription Schedule, it's still more "right" to use the regular Subscription Update API. Stripe has a comprehensive guide on their Doc and their API Reference that worth checking out.
By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a ¥100 price, she'll be billed ¥100 immediately. If on May 15 she switches to a ¥200 price, then on June 1 she'll be billed ¥250 (¥200 for a renewal of her subscription, plus a ¥50 prorating adjustment for half of the previous month's ¥100 difference). Similarly, a downgrade will generate a credit to be applied to the next invoice. We also prorate when you make quantity changes.
Upvotes: 1