#gabrielvrl-customer-portal
1 messages · Page 1 of 1 (latest)
Hi 👋
So you don't have any live mode customer portal settings?
I mean, That wasn't even necessary when I launched
Can you provide example request IDs for a successul portal session and one where you see this error?
SCan you share an API request ID for this? It will start with req_
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
ok
i will try it
req_UXHNStU1r1Y9yh
this one is a error
that's weird, my teammate tested this endpoint /v1/billing_portal/sessions on production when we launched last month
but looking at the logs
there's no status 200
but what's more weird
i can do everything locally
what's that portal session that i need to create it?
what's that portal session that i need to create it?
I'm sorry but I don't know what you are referring to here. Also when you are doing things "locally" are you in Test mode?
yeah yeah, i'm in test mode
i'll try to explaning about the portal session
the log has this message:
{
"error": {
"message": "You can’t create a portal session in live mode until you save your customer portal settings in live mode at https://dashboard.stripe.com/settings/billing/portal.",
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
so, what i'm trying to understand is
Right
i didn't know that i had to create this portal billing
and do i need to do this on the code
In Live Mode
in live mode yeah
Either in code or directly in the dashboard
Here is how you can do it via the API https://stripe.com/docs/api/customer_portal/configurations/create
it will like, be specific for each custumer?
ok
but let me show you something
const handleManageSubscription = async () => {
try {
if ($subscriptionId && $subscriptionId.length > 0) {
const currentEnvironment = window.location.href;
const response = await stripe.billingPortal.sessions.create({
customer: $customerId,
return_url: `${currentEnvironment}`,
});
openManageSubscriptionModal.set(false);
window.location.href = response.url || "";
}
} catch (err) {
// TODO: handle error
}
};
i'm creating the billing portal session
this is the method that handles it
but why does it say im not?
There is not a configuration specified there
you mean like that:
const configuration = await stripe.billingPortal.configurations.create({
business_profile: {
headline: 'Cactus Practice partners with Stripe for simplified billing.',
},
features: {
invoice_history: {
enabled: true,
},
},
});
You wouldn't do it the same flow.
You would create a specific portal configuration that allows your customers to do the specific actions you want them to have access to
And then you would store the ID of that configuration and include it when creating the customer portal https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-configuration
ok, that makes sense now
I recommend spending some time reviewing our docs and testing out different portal configurations before you implement any of this in Live mode
It can be a useful way to restrict what your customers change do/change but you want to make sure they can still do everything you need them to do
you're right
let me ask one more thing
i activated this setting: Customer portal Active
and then i asked a coworker to test it
and it worked
I don't know what that means
is this equivalent?
ok, i will try to explaning it differente
https://dashboard.stripe.com/settings/billing/portal the error send me to this link
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
settings -> Customer Portal
ok?
and this Customer portal was not active
i activated
Okay
is this equivalent of doing the billing portal configuration by code?
because my coworker was able to go to the right flow with this change
Not exactly. That is the no-code version
You should read the docs I linked to above to understand how they are different
Happy to help 🙂