#Thierry
1 messages ยท Page 1 of 1 (latest)
moving the context here
Stripe.apiKey = "sk_test_xxxxxxxxxxxxxxxxx";
CalculationCreateParams params = CalculationCreateParams.builder() .setCurrency("usd") .addLineItem( CalculationCreateParams.LineItem.builder() .setAmount(1000L) .setReference("L1") .build() ) .setCustomerDetails( CalculationCreateParams.CustomerDetails.builder() .setAddress( CalculationCreateParams.CustomerDetails.Address.builder() .setLine1("333 S Miami Ave") .setCity("Miami") .setState("FL") .setPostalCode("33131") .setCountry("US") .build() ) .setAddressSource(CalculationCreateParams.CustomerDetails.AddressSource.BILLING) .build() ) .addExpand("line_items.data.tax_breakdown") .build(); Calculation calculation = Calculation.create(params); log.info("total: " + calculation.getAmountTotal()); log.info("total: " + calculation.getTaxAmountExclusive()); log.info("total: " + calculation.getTaxAmountInclusive());
What I would expect is to get a AmountTotal > $10.00 but I always get 0% tax applied. My taxe settings are: Preset product tax code > General
I have tried many different states and origin but I keep getting 0% taxes. Would you help me spot my mistake?
Can you share a request ID for this?
if you look at the line_items object in the response, it actually lists out tax breakdown
{
id: "tax_li_Of39VTFLhrDccI",
object: "tax.calculation_line_item",
amount: 1000,
amount_tax: 0,
livemode: false,
product: null,
quantity: 1,
reference: "L1",
tax_behavior: "exclusive",
tax_breakdown: [
{
amount: 0,
jurisdiction: {
country: "US",
display_name: "Florida",
level: "state",
state: "FL",
},
sourcing: "destination",
tax_rate_details: null,
taxability_reason: "not_collecting",
taxable_amount: 0,
},
{
amount: 0,
jurisdiction: {
country: "US",
display_name: "MIAMI-DADE",
level: "county",
state: "FL",
},
sourcing: "destination",
tax_rate_details: null,
taxability_reason: "not_collecting",
taxable_amount: 0,
},
{
amount: 0,
jurisdiction: {
country: "US",
display_name: "MIAMI",
level: "city",
state: "FL",
},
sourcing: "destination",
tax_rate_details: null,
taxability_reason: "not_subject_to_tax",
taxable_amount: 0,
},
],
tax_code: "txcd_20030000",
},
]```
right correct but it is always 0
I guess because of this:
taxability_reason: "not_subject_to_tax",
but I would like to show some non-zero value
is it because this is in development account?
AFAIK it should show calculations in test mode too, hang on.. Checking..
Can you try changing the tax code?
https://stripe.com/docs/tax/tax-codes
You can pass it in when calculating tax
https://stripe.com/docs/api/tax/calculations/create#calculate_tax-line_items-tax_code
ok let me try that
ah you need to add a tax registration for FL in test mode
https://dashboard.stripe.com/test/tax/registrations
Once you do that, the API should start calculating taxes for that location
humm - no luck - I have tried many taxe code:
CalculationCreateParams.LineItem.builder()
.setTaxCode("txcd_20060044")
.setAmount(1000L)
.setReference("L1")
.build()
and also used an address in NY - I still get always zero tax
here is my last ID: taxcalc_1NrjbnFcH38zU2M5dzVkHT6e
did you add tax registration for the location on the link I shared above?
oh sorry I missed that -- sorry -- doing now
๐ stepping in as hanzo needs to step away
Taking a look
The address used is for NY, no?
If you look at the creation request: https://dashboard.stripe.com/test/logs/req_gIi1tOnr5Bas4W you can see: tax_breakdown: [ { amount: 0, jurisdiction: { country: "US", display_name: "New York", level: "state", state: "NY", }, sourcing: "destination", tax_rate_details: null, taxability_reason: "not_collecting", taxable_amount: 0, },
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
the origin address is in FL
but in the last example I use NY yes
this is just for testing
because I want to use Stripe Tax API so that I do not have to set the tax for every single states
isnt it the purpose of the Stripe Tax API?
You have to register for each state in your Dashboard if you are going to collect for each state
oh ok but the calculation it self will be done what Stripe API?
ok let me try again
Yep
We just won't calculate anything if you don't have a registration for that location
ok I am back to FL with having FL state registered
taxcalc_1NrjoOFcH38zU2M5lSJkCV5u
same
Looking
Your tax code is for Training but looks like you registered to collect for Communications, no?
correct - it has to match?
I did not pay attention
let me align
yes!!! taxcalc_1Nrk1nFcH38zU2M5YtUTEliq
it is finally working now - cool - thx you so much!
๐
so I have a lot of takaway on my end ... one last thing: each call to this API is $0.5 correct?