#alex-nolio_api

1 messages ¡ Page 1 of 1 (latest)

vast patioBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1242818574825820232

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

stoic portal
#

Depends. The portal only works with Customer objects (cus_xxx) not acct_xxx IDs. So unless your have Express accounts mapped to a Customer object on your platform, then no

#

What is it you want to do on the portal exactly?

lunar abyss
#

We just want to enable the portal on all of our connected account

So that we can generate session for customers of our connected accounts to have access to history of billing

Like this

" session = stripe.billing_portal.Session.create(
customer=self.stripe_customer_athlete_id,
return_url='https://www.nolio.io/company',
# URL to which the customer returns after managing their billing details
stripe_account=self.coach.stripe_connect_id
)
url = session.url"

stoic portal
#

Ah ok. So cus_xxx IDs that exist on your connected accounts

#

Basically make the API request to create the session with the platform key, but pass the acct_xxx of the conncted account to the stripeAccount option

lunar abyss
#

Sorry that's already what I am doing if you look at my code

#

But the API fail if the connected account does not have "portal" activated

#

but only way to enable is to "log as" account and do it for them, not even sure they can with express dashboard

stoic portal
lunar abyss
#

Nah it's your python lib

#

behing the hood it's doint is as header

#

doing it*

stoic portal
#

Apologies, you're right. Can you share a req_xxx ID?

lunar abyss
#

The request works, that's not the issue

The issue is that the requests works ONLY if on the settings of the connected account, I go to "customer portal" and then enable

#

then the API works, but if not, it 400 and tells to "go to dashboard"

#

but for 100s of connected accounts that's not possible ..

stoic portal
#

So I can track down the error internally and see if this is supported

lunar abyss
#

req_ZzoPc5wn5sz13J

stoic portal
#

Appreciate it, let me check on this

lunar abyss
#

thanks

stoic portal
#

OK, I think the issue is related to the omission of the configuration parameter: https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-configuration

If that is omitted, then the portal will attempt to use the default which is configured in the Dashboard. Obviously that is not configured/enabled on some of your accounts hence the error

lunar abyss
#

OK great, but looking at the doc I do not see a "customer_portal" option on the configuration ?

#

oh sorry

#

it's just 'active' : 'true' ?

stoic portal
lunar abyss
#

OK will test and get back to you, thx a lot

vast patioBOT