#rakari_api

1 messages Ā· Page 1 of 1 (latest)

unborn kilnBOT
#

šŸ‘‹ 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/1249985112691441696

šŸ“ Have more to share? Add details, code, screenshots, videos, etc. below.

tawny bay
#

Yeah can you check that you have enabled Stripe Tax?

sullen jackal
#

@tawny bay we think yes we did by following the link the error response gave us. Here's a screenshot. We think that is the right page. Please let us know if we need to activate it elsewhere. We're working in testmode

tawny bay
#

Hi, qq did you register the places you would collect Tax?

sullen jackal
#

@tawny bay where would we do this? We just added the Business information origin address

tawny bay
#

Yeah do you see the "Add registration" blue-purple button?

sullen jackal
#

yes, we just added one address in NY, but if we do the request afterwards, it's returning the same error message

#

This is the request

curl --location 'https://api.stripe.com/v1/tax/calculations'
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Authorization: ••••••'
--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 1'
--data-urlencode 'line_items%5B0%5D%5Btax_behavior%5D=inclusive'
--data-urlencode 'line_items%5B0%5D%5Btax_code%5D=txcd_99999999'

#

{
"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_1PQ4xbAoSN5FqK2L/test/logs/req_9PmkGHcfePCaor?t=1718090845",
"type": "invalid_request_error"
}
}

Learn more about error codes and how to resolve them.

tawny bay
#

Okie which account have you enabled Stripe Tax?

#

acct_xxx

sullen jackal
#

@tawny bay acct_1PQ4G2FQ8VtqazKz

tawny bay
#

req_9PmkGHcfePCaor is made on a Standard Account acct_1PQ4xbAoSN5FqK2L, belongs to a Platform account acct_1PQ3niFCMR2CSvcs

#

I think you changed the settings on a different Stripe Account

#

You would want to enable on acct_1PQ4xbAoSN5FqK2L

sullen jackal
#

@tawny bay wait, we don't get it. We don't use the account number anywhere. We do have one stripe account acct_1PQ3niFCMR2CSvcs where we've generated the API keys and enabled stripe tax for

tawny bay
#

I see, where did you get acct_1PQ4G2FQ8VtqazKz?

#

Trying to make sure we are on the same page

sullen jackal
#

We don't remember anymore. If we check in our profile we only see: acct_1PQ3niFCMR2CSvcs

#

@tawny bay we've just double checked the API keys for account acct_1PQ3niFCMR2CSvcs and we're using the proper secret for Oauth

tawny bay
#

Okie so it looks like you have set the Stripe Tax settings for the Platform. However this request (req_9PmkGHcfePCaor) is made on a Standard Account acct_1PQ4xbAoSN5FqK2L

#

So you would want to enable Stripe Tax on that Connected Account instead

sullen jackal
#

The screenshots we've shared with you are from the account: acct_1PQ3niFCMR2CSvcs

#

and the registration we also did on : acct_1PQ3niFCMR2CSvcs

#

@tawny bay I'm not fully getting what you mean by Platform Account. Where can we see in the Dashboard which if we do have a platform account or not?

tawny bay
#

Sure, so Platform is acct_1PQ3niFCMR2CSvcs, and there is a Standard Connected Account to it: acct_1PQ4xbAoSN5FqK2L

#

When you made the request req_9PmkGHcfePCaor, you used the Platform key, but with a Stripe Account header to acct_1PQ4xbAoSN5FqK2L

#

Can you double check your code which sent out that request?

sullen jackal
#

that's the above curl request basically

#

we do it in postman

tawny bay
#

Yes, you may have set it somewhere else

#

Can you check around the Postman config

unborn kilnBOT
sullen jackal
#

@tawny bay we've just checked in postman and we don't send it anywhere

plush kiln
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

plush kiln
#

Also, I suggest you to use a larger amount, e.g. amount=10000 - 100 USD, for testing. 10 cents is too little for most payment method types.

sullen jackal
#

@plush kiln thank you. We're checking this but we've created yesterday a stripe developer account with the account number: acct_1PQ3niFCMR2CSvcs and used the API keys to call the Tax calculator endpoint

plush kiln
#

What's the prefix of --header 'Authorization: ••••••' \? sk_test_?

sullen jackal
#

@plush kiln yes: sk_test_51PQ4

#

So we basically used the API key and secret from acct_1PQ3niFCMR2CSvcs to initiate the Oauth flow and got the sk_test_token back which we're using in the postman to do the Tax Calculator call. Stripe tax has been enabled on: acct_1PQ3niFCMR2CSvcs account

#

Let me get one of my teammates here who can probably answer more precisely

plush kiln
#

This sounds too complicated. When you create a Stripe account, you go to the Developers page on the Dashboard and get the secret keys from there. No need to use OAuth.

last token
#

Hi @plush kiln we are implementing a new integration and would like to use oAuth flow
it is why we are using token we receive on the end of oAuth

plush kiln
#

Why do you need to use OAuth flow?

last token
#

to integrate with stripe and make API calls

#

it is one of the ways to communicate with the API

plush kiln
#

Where did you learn about this flow?

#

As I suggested earlier:

When you create a Stripe account, you go to the Developers page on the Dashboard and get the secret keys from there. No need to use OAuth.

last token
plush kiln
#

That's an advanced flow to connect multiple Stripe accounts together using Stripe Connect.

If you just want to make API calls with your own Stripe accounts, see the flow I suggested above ā˜ļø

last token
#

the interesting thing is that we can create products using same authentication

last token
unborn kilnBOT
plush kiln
#

OAuth flow is something completely different. Unless you need to use Stripe Connect (not in all cases even), you don't use OAuth.

fiery temple
#

šŸ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

last token
#

thank you, with test key it is working, but I also would like to check and fix on our side oAuth flow

fiery temple
#

what is the issue with the OAuth flow?

sullen jackal
#

@fiery temple here is the use case: We wanted to implement a Stripe Tax integration for a eCommerce system like Shopify. Merchants should connect their Stripe account via OAuth, so that we can call in their name the Stripe Tax Calculator endpoint and display taxes on their stores

#

This is why we thgouht we need a main account which is "the Stripe Tax App" and holds the Oauth Secret. The merchant can install the "Stripe Tax Add for ecommerce platform like Shopify" and connect with their Stripe account, so that the app can do API on their behalf to the Tax Calculator endpoint

#

does that make sense?

#

So we don't want to have a 1:1 integration, but a 1:n integration

fiery temple
sullen jackal
#

That's basically the flow @last token implemented

fiery temple
sullen jackal
fiery temple
#

ok so now the question becomes how to do API calls on behalf of your connected account right?

sullen jackal
#

@fiery temple we assume, yes. Here is the call we did before including the response. We were following the link in the response and registered destinations and activated stripe tax but still receiving the same exception
curl --location 'https://api.stripe.com/v1/tax/calculations'
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Authorization: ••••••'
--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 1'
--data-urlencode 'line_items%5B0%5D%5Btax_behavior%5D=inclusive'
--data-urlencode 'line_items%5B0%5D%5Btax_code%5D=txcd_99999999'
{
"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_1PQ4xbAoSN5FqK2L/test/logs/req_9PmkGHcfePCaor?t=1718090845",
"type": "invalid_request_error"
}
}

Learn more about error codes and how to resolve them.

fiery temple
#

taking a look

sullen jackal
#

the Authorization keys prefix is: sk_test_51PQ4

#

@last token please support @fiery temple to get the information needed

fiery temple
#

the auth is correct

#

that's not the issue

#

the issue is that the Stripe Tax isn't activated on the account

last token
#

yes
and we do not understand why it is not activated

fiery temple
#

you need to enable it on the connected account

last token
#

can you point me where and how?

fiery temple
#

it's not on the platform's account