#FluffyCat - Subscriptions

1 messages · Page 1 of 1 (latest)

vestal tapir
#

Hello! Give me some time to type out some responses. 🙂

#

3-A) If the trial expires with a valid payment method, we charge the subscription amount and want to reset the billing cycle to provide a full month duration from the charge date. ( Best way to do this? Can we configure this behavior up-front at the time the trial starts? Do we need to take this action in response to a webhook received at the time the trial expires? Is it a bad idea to delete the initial subscription and create a new one charged immediately when the trial expires? )

There are several ways to do this. For the most granular control you can use a Subscription Schedule to schedule in advance exactly what happens to the Subscription over time: https://stripe.com/docs/billing/subscriptions/subscription-schedules

You can also do this by listening to Events with a webhook endpoint and modifying the Subscription as a result.

It is a bad idea to delete the initial Subscription and create a new one. You can update the existing Subscription's billing_cycle_anchor and set it to now when the trial ends: https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_cycle_anchor

#

3-B) If the trial expired without a payment method and the user decides to input a payment method to continue the subscription, we want the same effect: users should always receive a full month of access from the date they are charged. ( Best way to handle this? Deleting the prior subscription? Updating it with a reset billing cycle? )

Same as above, update the billing_cycle_anchor on the Subscription.

#

In general, which webhook event(s) are best to listen for to know when 3-A and 3-B happen? ( is it customer.subscription.updated for 3-A and customer.subscription.deleted for 3-B?

Yep.

any unique attributes in the event to reliably identify it as 3-A happening? )

You probably want to look at the status of the Subscription and see if it's still trialing or not: https://stripe.com/docs/api/subscriptions/object#subscription_object-status

brazen delta
#

Thank you for the fast response and clear suggestions. Leaning towards setting billing_cycle_anchor=now as the solution there. Really appreciate Stripe offering this kind of help on Discord. thankyou