#krystian

1 messages · Page 1 of 1 (latest)

winged crownBOT
subtle zodiac
#

Hi 👋 no, canceled is a terminal state for a Subscription, it should not move to another state after that one.

If a user subscribes again, they will have a new Subscription created.

indigo solar
#

got it. how would i prevent giving the same user another free trial in this case?

#

currently i am automatically creating a free trial subscription for them the first time they login

subtle zodiac
#

Are you creating the Subscriptions directly, or using a hosted experience like Checkout Sessions to create those?

indigo solar
#

both. i am only creating a trial subscription directly via the API the first time the user signs in, and beyond that i am using checkout sessions

#

i am directly creating the trial subscription for the same price_id as one of the two checkout sessions (Starter). The other is Pro.

#

question that might help: lets say the user resubscribes after a canceled subscription. will the subscription object contain both the new active subscription, as well as the old canceled subscription, for that customer/user?

#

actually nvm that wouldn't make sense

subtle zodiac
#

No, a Subscription is a singular object. You'll likely need to implement a way to track whether you already provided a user with a free trial, and then avoid creating the new Subscription with a free trial if so.

#

If you're reusing Customer objects, and only selling a limited number of products, then you may be able to track this inside of metadata on the Customer object.

indigo solar
#

i think that would work! thank you!

subtle zodiac
#

Any time!