#cyber_s
1 messages · Page 1 of 1 (latest)
Hello, can you tell me more about what you have in terms of Stripe objects here? Do you have an existing subscription in the Stripe system that you want to make free?
ya im getting the free sub data like this js const stripeSub = await stripe.subscriptions.list({ limit: 1, customer:newUser.stripeId });
so its a free sub that i created
but i want to change the subscription to the paid version they had on chargebee
Gotcha, we have this doc on upgrading and downgrading subscriptions https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
You will make an update call on the subscription where you give it a new price and tell Stripe whether to or not to create a prorated charge with the change
so like this ```js
stripe.subscriptions.update(subscription.id, {
cancel_at_period_end: false,
proration_behavior: "i dont know what to put here for false",
items: [{
id: oldSubItem,
price: newPriceVariable,
}]
});
i want it not to charge til end of billing cycle
You have two options here. You can set proration_behavior: "none" if you don't want the user to be charged at all for this change or you can set proration_behavior: "create_prorations" if you want to charge/credit the user at the begginning of the next month
Sorry, forgot the context for a second. This is a free trial/subscription so you will want to set none that way the user won't get charged at all until the next month