#king-subscription
1 messages · Page 1 of 1 (latest)
im using laravel cashier
just to clarify, do you specifically want to completely cancel the customer's existing subscription and start a new one? In most cases it makes more sense to keep the existing subscription, but change the products that it is for, for instance https://stripe.com/docs/billing/subscriptions/upgrade-downgrade#switching
Yes because they are totally new products and system we want to keep naming seperate for clerical purposes. Going forward any upgrade/downgrade of products will simply add remove prices
more soo i want to change the subscription instead of renewing them on the current subscription
so bassically turn subscription renewing off for legacy products and upon expiry (hopefully trigger a webhook) and i can progromatically create the new subscription from cashier
if you can identify these subscriptions using the legacy subscriptions in some fashion then you could
- set
cancel_at_period_endon those subscriptions(https://stripe.com/docs/billing/subscriptions/cancel#canceling), while taking note of the Subscription object IDsub_xxxor adding metadata to the objects to recognise later - listen to the
customer.subscription.deletedwebhook event - when you see the subscription that has just cancelled was one of those ones, you can kick off the process to create a new Subscription for a different product.
so basically when a subscription expires it triggers the customer.subscription.deleted
for ease if i archive a product does any subscriptions run until the end of their original expiry or will it expire immediately?
archiving a product has no effect on any existing subscriptions at all, it just prevents creating new subscriptions with the same product
for now this use case of moving from an old product to a new one is quite manual unfortunately
no problem and thanks for your help.
lastly where can i see an example of the customer.subscription.deleted response object
and is there a way to prevent renewal completely?
the event body contains a Subscription object so it's basically the same as any other customer.subscription.* event; if you want to see an example the easiest way would be to use stripe-cli(https://stripe.com/docs/cli/trigger) and run stripe trigger customer.subscription.deleted