#Mathieu Ducrot-customer-portal
1 messages ยท Page 1 of 1 (latest)
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.
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 ?
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.
ok that is more clear to me now thanks !
Awesome, happy to help!
And just for information, did you have any similar feedback from other developers on that topic (advanced redirection settings for the customer portal) ?
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.
yep
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.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
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"
}
In terms of that error, it looks like you didn't end an array within default_allowed_updates
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
indeed thanks (also added 'payment_method_update' => ['enabled' => true],) and now it works
Excellent!
so to close up with this thread if you guys does some improvement on the portal configuration to handle such edge case i'll by happy to test it ๐