#serhiy-lv_api
1 messages Β· Page 1 of 1 (latest)
π Welcome to your new thread!
β²οΈ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
β±οΈ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1250039779706540125
π Have more to share? Add details, code, screenshots, videos, etc. below.
@fallen elm our previous thread was closed. Can you catch up with us here?
We've enabled also tax for the account: acct_1PQS2LHOgBsfft6i
here is a request we are making:
curl --location 'https://api.stripe.com/v1/tax/calculations'
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Authorization: Bearer sk_test_51PQS4dBAqQmLHpv8mUtQAzXESdxv4WTuHeAi5gdUx1Guah3m2ub759b8wdyBGarO8yOn0PlsmN16EafKScQqYO3w008DIlWQsm'
--header 'Cookie: __stripe_orig_props=%7B%22referrer%22%3A%22%22%2C%22landing%22%3A%22https%3A%2F%2Fdashboard.stripe.com%2Facct_1PQ4xbAoSN5FqK2L%2Ftest%2Flogs%2Freq_ja04M6XNTPf1jz%3Ft%3D1718035660%22%7D; cid=109c3ac3-5be3-425d-8512-7eb6c0131d3e; machine_identifier=fKsBuH31HWkgsomgxnfPdVqjz%2Bvl2H8OtgIY8gZCYXQtRGn3lMu%2B93sWjPb1yDs9T5w%3D; private_machine_identifier=DOMWImUEwdEz4rUgq8Ccps6sV1OgZObdFBfeesIDUPJzFTNXBwyLB73SsK8xH6D4b4Y%3D; stripe.csrf=5a40y5B-zK4H42ZXf8tI8Icyyq3WpqtLfgjzjZEZfqUre_fdsl0VoVseKcszCRTSAhS39e5IXvl_nP96zhCcgzw-AYTZVJx5wkESwwVbN70md6wm4yVimYqUUtjxuVQSCMmbCCzlJg%3D%3D'
--data-urlencode 'currency=USD'
--data-urlencode 'line_items%5B0%5D%5Bamount%5D=10'
--data-urlencode 'line_items%5B0%5D%5Bquantity%5D=1'
--data-urlencode 'line_items%5B0%5D%5Breference%5D=test product 3'
--data-urlencode 'line_items%5B0%5D%5Btax_behavior%5D=inclusive'
--data-urlencode 'line_items%5B0%5D%5Btax_code%5D=txcd_99999999'
--data-urlencode 'customer_details%5Baddress%5D%5Bcountry%5D=US'
--data-urlencode 'customer_details%5Baddress%5D%5Bcity%5D=Seattle'
--data-urlencode 'customer_details%5Baddress%5D%5Bline1%5D=920 5th Ave'
--data-urlencode 'customer_details%5Baddress%5D%5Bpostal_code%5D=98104'
--data-urlencode 'customer_details%5Baddress%5D%5Bstate%5D=WA'
--data-urlencode 'customer_details%5Baddress_source%5D=shipping'
Did you follow all the steps here to configure the platform correctly? https://docs.stripe.com/tax/tax-for-marketplaces
here is the response:
{
"error": {
"code": "stripe_tax_inactive",
"doc_url": "https://stripe.com/docs/error-codes/stripe-tax-inactive",
"message": "Stripe Tax has not been activated on your account. Please visit https://dashboard.stripe.com/test/settings/tax/activate to get started.",
"request_log_url": "https://dashboard.stripe.com/acct_1PQS4dBAqQmLHpv8/test/logs/req_WoE5QC5cA2hlmC?t=1718102386",
"type": "invalid_request_error"
}
}
Yes, we can see all those details from the req_xxx. No need to dump everyting
ok
Taking a look anyway
yes
@misty crown we would like to provide tax calculation s in the Checkout for a ecommerce System like Shopify, so we were following "Tax for software platforms"
Stripe Tax isn't enabled on acct_1PQS4dBAqQmLHpv8 (the connected account): https://docs.stripe.com/tax/tax-for-platforms#set-up
@misty crown wait a second. acct_1PQS2LHOgBsfft6i is the new account we've just created that is acting like a "merchant" account, and for this account we've enabled the tax settings and registered a location. We've performed with this account an Oauth flow and received a token back
Where is this id coming from acct_1PQS4dBAqQmLHpv8 ?
From req_WoE5QC5cA2hlmC that you shared, the request that errors
Cany ou check based on the token to which account this is assigned?
acct_1PQS2LHOgBsfft6i has Stirpe Tax activated. But you haven't shared an error for a request on that account
Which token?
sk_test_51PQ3niFCMR2CSvcskvP5wbJZnFAXJng5obI5akmb8bWeaTbDq3UwNHpQxr7ZKrYu3xttFsnT6YVD1HM56uZ06KW500DwyV4ZB5
this is the token we're using in the request Authorization header
we got this token back from the new account we run the Oauth flow with
Yep, it's for acct_1PQS4dBAqQmLHpv8
Not acct_1PQS2LHOgBsfft6i as you expect. You need to generate a new OAuth token
can you let me know to which email acct_1PQS4dBAqQmLHpv8 this is assigned to?
None, there wasn't one provided
We have basically two accounts: Platform Account A (we get the connect client id there, and the api secret) and Merchant Account B (the one that we're using to call the Oauth URL acct_1PQS2LHOgBsfft6i ), at the end of the Oauth flow we're getting back a token, which we assum is for account: acct_1PQS2LHOgBsfft6i because this account clicked the "Connect" button
Well clearly you're complete the OAuth onboarding flow signed in to acct_1PQS4dBAqQmLHpv8
Overall, you shouldn't be using OAuth anyway
?
We don't want to have a 1:1 connection, we need a 1:n connection
This use case needs to be implemented
So there are a lot of merchants that should be able to see Tax rates coming from their connected Stripe account in the checkout
In order to achieve this, they should connect their stripe accounts
Not sure what Stripe Tax has do with how you're onboarding accounts. But you should be using Account Links really. OAuth is mostly deprecated: https://docs.stripe.com/connect/hosted-onboarding
Onboard connected accounts by redirecting them to a Stripe-hosted onboarding flow.
and how if not via OAuth2 ?
In any case, the error you're seeing is because the secret key you're using was generated for an account that does not have Stripe Tax activated
I suspect when you've followed the OAuth onboaridng URL you've been authenticated into a different Stripe account then what you expected
You either:
- Enable Stripe Tax on
acct_1PQS4dBAqQmLHpv8 - Re-generate a token/key for
acct_1PQS2LHOgBsfft6iand use that
We've tripple check and saw the email address of the new merchant account we've created
here is an account we are connecting:
The email address is not unique. A Stripe sign in can have multiple accounts (acct_xxx)
So that's not a reliable way to identify accounts
well, it's just following the flow we're seeing π
If you use the Account Link method, then you created the Account object (acct_xxx) upfront and then onboard it directly
there's not a lot we can configure
The OAuth method will either use an existing acct_xxx if the email/user has one (they can select in that dropdown) or will genertae you one as part of the flow
But this is the underlying issue and why the API request you're trying to make is erroring
@misty crown but if we just created a complete new account with one email address how can this become a problem? I mean there is nothing else to match and no sub-accounts added and even if I would have subaccounts I'd expect that the system is requesting for which subaccount i want to grant access
I don't understand what you're asking me
but if we just created a complete new account with one email address how can this become a problem?
Created where? The issue is whoever onboarded the account had an existing Dashboard session with a sign in. If they use an OAuth link, then they can onboard to the platform that created the OAuth link using any number of the accounts accessible under their Stripe account
This is the advantage of Account Links β you explicitly create the Account and use the returned acct_xxx with the Account Link so you know you're explicitly onboarding that account. Then you can make API requests using your platform secret key, and passing the connected account ID in the headers: https://docs.stripe.com/connect/authentication
we created a new account in other browser and initated oauthFlow from there
there is no possiblity for sessions intersections
No
We've opened another browser, went to stripe.com and created a new account
with the email address serhiy.m+stripe@itembase.com
Well however you generated the key, it was not with the account you think it was
after that we've clicked on the Connect button to initaite the Oauth flow and ended up on
What happens if one clicks on "Skip this form" ?
Does that has any effect on the OAuth2 flow?
Yes, but it'll create a new account regardless:
The process of creating a Stripe account is incorporated into our authorization flow. You donβt need to worry about whether or not your users already have accounts.
https://docs.stripe.com/connect/oauth-standard-accounts#connect-users
As I said, OAuth is not recommended anyway. It's deprecated:
OAuth is not recommended for new Connect platforms. We recommend using Connect Onboarding for Standard accounts instead.
When onboarding standard accounts, we'l create a new acct_xxx that is for the sole purpose of the connection to the platform. Which is why it doesn't match the ID you have from the Dashboard
The new acct_xxx ID should be returned in the response from the call to generate the token: https://docs.stripe.com/connect/oauth-standard-accounts#connect-users:~:text=Stripe returns a response that includes the account ID (stripe_user_id) for the user%3A
Thanks, we're going to check this
@misty crown we've added 2FA to the new account and now when we're running the OAuth flow we're seeing an account that we can select, and in the end the flow is working
You're all set then?
I'd strongly recommend migrating to the Account Links onboarding flow
Well, I'm not sure if we're all set then π It's seems a lot inconsistent in terms of onboarding with OAuth2 (for whatever reasons). Well, we're enforced to migrate