#duracel
1 messages · Page 1 of 1 (latest)
The way my app works now: When a user subscribes for the first time, I make an API call to https://api.stripe.com/v1/checkout/sessions to create a checkout session
The problem is once they're already subscribed, I can't use https://api.stripe.com/v1/checkout/sessions anymore to let them switch plans, because each checkout session creates a new subscription (rather than updating an existing subscription, which is what I want)
So I figured I would use https://api.stripe.com/v1/billing_portal/sessions once they're subscribed. Only issue is I'm not sure how to pass the subscription ID along with the plan ID that they want to switch to
Hello! You can create a Portal Configuration that defines how the Customer Portal behaves: https://stripe.com/docs/api/customer_portal/configurations/create
And then you can specify that Configuration when you create Portal Sessions.
Would that look something like this?
-u sk_test_*****************: \
-d "features[subscription_update][default_allowed_updates][price]"="price_*******" \
-d "features[subscription_update][default_allowed_updates][quantity]"=1```
Your command was garbled from Discord's formatting, can you use three backtickts to create a code block and share again?
my bad, just updated
Yep, seems like you're on the right track.
The Product ID is required, and so is a list of the Price IDs: https://stripe.com/docs/api/customer_portal/configurations/create?lang=curl#create_portal_configuration-features-subscription_update-products
You only specified the Product ID.