#Mathieu Ducrot-customer-portal

1 messages ยท Page 1 of 1 (latest)

white totem
#

Hi ๐Ÿ‘‹ you can specify the return_url that dictates where a customer is directed when they leave the portal, but you can't configure the portal to redirect them there automatically after they complete an action.

fierce lark
#

ok so i guess there is not any other alternative such as the billing portal to let the customer update his subscription on stripe ? So i need to make this part on our side and use the stripe API instead, is that it ?

white totem
#

If you're looking for a flow where your customer is immediately returned to your site after making a single change, then yes.

The customer portal will redirect to the provided return_url but it will allow customers to take multiple actions (for example, upgrade subscription, then update their payment method) within the portal and only redirects when they leave the portal.

fierce lark
#

ok that is more clear to me now thanks !

white totem
#

Awesome, happy to help!

fierce lark
#

And just for information, did you have any similar feedback from other developers on that topic (advanced redirection settings for the customer portal) ?

white totem
#

Not that I've personally seen.

#

But now you have me wondering if you could build something similar with existing functionality, bear with me a moment.

fierce lark
#

yep

white totem
#

So it would take some work to pull it off, but you could create very granular portal configurations 0 such that each one only allows a specific action ... hm, but I still don't think that would force a redirect after the customer completes the action, I think it would allow them to take that action repeatedly. Nevermind, I don't think that will do what you're looking for either, sorry.

#

I can capture your feedback to relay to our product teams though, could you help explain the use case that you have in mind where you would like to redirect a customer after they take any action in the portal?

fierce lark
#

the portal configuration was the first track that i experimented with ๐Ÿ™‚

My use case is to have a subscription workflow that use less code as possible and rely on your full integration.
For the first subscription i did use checkout session that works very well.
Then the user must be able to change his subscription and i thought the billing portal would perfectly fit this use case.

First i saw that you can reference multiple product/prices on the portal from the dashboard but if we do this the customer can still change his mind once he is on the portal.
Here is a brief look at our price list (sorry if it's in french), as you can see the user first select his plan. Then the goal is to redirect him on the stripe billing portal but with only that one choice that he made (so that why i begin to look at portal configuration ressource api).
But as i tested with multiple product the customer can indeed perform multiple action on the portal which can lead him to hesitate or lack some feeback from our side that we take on consideration his plan change.

So the end goal that we wanted was :

  • a portal configuration with a mono product/price
  • the billing portal serves as a confirmation page and the customer could still change his payment method for exemple if he wants to
  • and as soon as he confirm his payment on the portal => redirect him on our site instead of returning back to the "home" of the billing portal
#

Also i'm trying, just for sake of knowing how it works, to use the configuration portal and pass it to a portal. But i got some error with prices configuration.
Here is what i sent :

{
"features": {
"invoice_history": {
"enabled": "true"
},
"subscription_update": {
"default_allowed_updates": {
"price": "price_1KZHtBEHsAIKY6jwAgHAD2pC",
"quantity": "1"
},
"products": {
"0": {
"product": "prod_LFnUwrohbq0veO",
"prices": {
"0": "price_1KZHtBEHsAIKY6jwAgHAD2pC"
}
}
},
"enabled": "true"
}
},
"business_profile": {
"privacy_policy_url": "https://example.com/privacy",
"terms_of_service_url": "https://example.com/terms"
},
"default_return_url": "http://app.localhost/subscription/plan"
}

queen orbit
#

In terms of that error, it looks like you didn't end an array within default_allowed_updates

#

array of enum values

#

so should be:

"default_allowed_updates": ['price'],
#

It's a list of the kinds of updates you can make

#

ie, change price, change quantity, change coupon

fierce lark
queen orbit
#

Excellent!

fierce lark