#mladen_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/1286004239813841080
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! When creating a new account you must make the API request on your platform. The request you shared is trying to create a new account on one of your connected accounts, not your platform account. It's likely your code is setting a connected account ID somewhere when it shouldn't be.
Have a look here: https://docs.stripe.com/connect/authentication#stripe-account-header
That page explains how you make API calls on your connected accounts, which is what you shouldn't be doing when creating a new account.
Does that make sense? If not, no worries, happy to explain another way!
Hello, thank you for fast response. I'm looking at our code right now, I can share the part where we create an account:
public Account createAccount() {
try {
final AccountCreateParams accountCreateParams =
AccountCreateParams.builder().setType(STANDARD).build();
return Account.create(accountCreateParams, requestOptionsBuilder.build());
} catch (final StripeException ex) {
throw new StripeApiException(
ex.getMessage(), ex.getRequestId(), ex.getCode(), ex.getStatusCode());
}
}
As you can see, nothing unusual here
in requestOptionsBuilder we provide API key
public RequestOptions.RequestOptionsBuilder requestOptionsBuilder() {
return RequestOptions.builder().setApiKey(apiKey);
}
Do you have setStripeAccount anywhere?
let me double check
Oh, I have just figured it out with your help. We do have setStripeAccount when we are creating Price and CheckoutSession
The problem is, we are using THE SAME requestOptionsBuilder for all requests
so when we make first call to create price or checkout session it gets dirty
and all subsequent calls to create new account fails
Thank you vary much!
Ah, yep, that's the issue.