#alex-nolio_api
1 messages ¡ Page 1 of 1 (latest)
đ 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.
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?
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"
Ah ok. So cus_xxx IDs that exist on your connected accounts
Then yes, you can facilitate that via the Stripe-Account header: https://docs.stripe.com/connect/authentication
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
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
You're not though, you're passing it as a parameter. Should be more like:
Apologies, you're right. Can you share a req_xxx ID?
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 ..
Right, but you described a failing API request with a 400 status. I'd like to see an example of that
So I can track down the error internally and see if this is supported
req_ZzoPc5wn5sz13J
Appreciate it, let me check on this
thanks
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
What you'll need to do is create a configuration on these accounts, and pass that when creating the session: https://docs.stripe.com/api/customer_portal/configurations/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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' ?
See the API I linked. You'd configure the features available in the session, etc
OK will test and get back to you, thx a lot