#.tbhaxor
1 messages · Page 1 of 1 (latest)
Hello! You can do it either way. A Subscription Schedule can create the Subscription for you in the future, or a Subscription Schedule can be used to control an existing Subscription.
If start_time is now it will be created now right?
Yes.
Makes sense.
Also if in phase 1, I have price_a_id with quantity 1 and in the second phase I want to delete price_a_id and use price_b_id with same quantity.
So do i have to explicitly set the price_a_id quantity 0 in second phase or just adding price_b_id quantitty 1 is sufficient
This
const subscriptionSchedule = await stripe.subscriptionSchedules.create({
customer: subscription.customer,
from_subscription: subscriptionId,
phases: [
{
items: [
{
price: 'PRICE_A_ID',
quantity: 1,
},
],
},
{
items: [
{
price: 'PRICE_B_ID',
quantity: 1,
},
],
},
],
});
or
const subscriptionSchedule = await stripe.subscriptionSchedules.create({
customer: subscription.customer,
from_subscription: subscriptionId,
phases: [
{
items: [
{
price: 'PRICE_A_ID',
quantity: 1,
},
],
},
{
items: [
{
price: 'PRICE_A_ID',
quantity: 0,
},
{
price: 'PRICE_B_ID',
quantity: 1,
},
],
},
],
});
You need to be explicit.