#localpath
1 messages · Page 1 of 1 (latest)
The best way to do this would be to use Subscription Schedules (https://stripe.com/docs/billing/subscriptions/subscription-schedules)
You'd create a Schedule with a single phase that goes for 10 iterations (https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-iterations) and has a end_behavior of cancel https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-end_behavior
Ok nice. So when creating our normal subxn if we know this customer is going to only need a set number of charges, create the schedule and associate the subxn we will make to it or do we make the subxn first then attach the schedule? probably make subxn first and attach the schedule huh?
You have two options:
- Don't create the subscription at all and use the subscription schedule to create one for you. If you create a schedule that starts immediately it'll create the subscription for you and you don't need to create it separately
- Creat the Subscrpition first and then attach the subscription schedule to it afterwards (https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#existing-subscription).