#der_toboter
1 messages · Page 1 of 1 (latest)
👋 happy to help
for this
Upgrades should be applied instantaneously. Any change is an upgrade if the net amount for one billing period is higher than the one on the old subscription.
Downgrades should only apply with the next billing period.
you don't really need subscription schedules
for the upgrade it's actually related to this https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment
for downgrading you would have to use 2 parameters:
1- https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior set to 'none'
2- https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_cycle_anchor set to 'unchanged'
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
in both cases you should provision the features by listening to the invoice.paid events
and check for the billing_reason https://stripe.com/docs/api/invoices/object#invoice_object-billing_reason
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
if the value is subscription_update this means that you need to update the provisioning of your services
does that answer your question @subtle birch ?
Thank you @woeful heron
This approach is not much different than the solution I suggested.
Let's consider the following case: A customer makes a price/product downgrade, and before the billing cycle ends performs a quantity upgrade. With the solution suggested this would still mean the downgrade is also applied as soon as the upgrade is applied, wouldn't it?
no not really
because even though the subscription has been updated your provisioning didn't happen
With "apply" the subscription I mean listening to the invoice paid event, getting the subscription from the invoice and provisioning the service based on the data of the subscription.
When the upgrade is made in my example above I get the invoice paid event, read the subscription and provision what is in the subscription.
However now the downgrade from before is already part of the subscription and not just the upgrade.
With "apply" the subscription I mean listening to the invoice paid event, getting the subscription from the invoice and provisioning the service based on the data of the subscription.
ok, we're aligned on this
However now the downgrade from before is already part of the subscription and not just the upgrade.
I'm not sure I understand this part
Say on 1st of January I subscribed to the product "Premium" with a monthly billing period, and a quantity of 5.
Now on 5th of January I decide I want to downgrade to "Starter" for the next billing period. This downgrade should be active on the 1st of February.
In Stripe this causes a subscription update without proration and without billing anchor change.
On 7th of January I also increase my quantity from 5 to 7. This is an upgrade and should be applied instantly.
In Stripe this causes a subscription update with prorations and an invoice to be generated.
As soon as the invoice paid event for this update gets processed, the services are provisioned for quantity 7 AND product "Starter".
On 7th of January I also increase my quantity from 5 to 7. This is an upgrade and should be applied instantly.
with what price?
with Starter?
In Stripe this causes a subscription update with prorations and an invoice to be generated.
this happens if you don't override the default behavior
with what price?
In customer portal I guess this will already show "Starter", however the customer still has "Premium" and expects to use "Premium" until the end of the period.