#duracel

1 messages · Page 1 of 1 (latest)

slate groveBOT
vivid ermine
#

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

wispy seal
#

And then you can specify that Configuration when you create Portal Sessions.

vivid ermine
#

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```
wispy seal
#

Your command was garbled from Discord's formatting, can you use three backtickts to create a code block and share again?

vivid ermine
#

my bad, just updated

wispy seal
#

Yep, seems like you're on the right track.

vivid ermine
#

Not sure what I'm doing wrong here

wispy seal
#

You only specified the Product ID.