#Thierry

1 messages ยท Page 1 of 1 (latest)

pallid swanBOT
dreamy mountain
#

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?

unborn frost
#

oh sure - one sec

#

taxcalc_1Nrj30FcH38zU2M5DK3MKgv8

dreamy mountain
#

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",
      },
    ]```
unborn frost
#

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?

dreamy mountain
#

AFAIK it should show calculations in test mode too, hang on.. Checking..

#

Can you try changing the tax code?

unborn frost
#

ok let me try that

dreamy mountain
#

Once you do that, the API should start calculating taxes for that location

unborn frost
#

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

dreamy mountain
#

did you add tax registration for the location on the link I shared above?

unborn frost
#

oh sorry I missed that -- sorry -- doing now

pallid swanBOT
unborn frost
#

ok I did but same thing:

#

taxcalc_1NrjexFcH38zU2M5yOxPTVlL

placid meadow
#

๐Ÿ‘‹ 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, },

unborn frost
#

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?

placid meadow
#

You have to register for each state in your Dashboard if you are going to collect for each state

unborn frost
#

oh ok but the calculation it self will be done what Stripe API?

#

ok let me try again

placid meadow
#

Yep

#

We just won't calculate anything if you don't have a registration for that location

unborn frost
#

ok I am back to FL with having FL state registered

#

taxcalc_1NrjoOFcH38zU2M5lSJkCV5u

#

same

placid meadow
#

Looking

#

Your tax code is for Training but looks like you registered to collect for Communications, no?

unborn frost
#

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!

placid meadow
#

๐ŸŽ‰

unborn frost
#

so I have a lot of takaway on my end ... one last thing: each call to this API is $0.5 correct?

placid meadow
#

Yes that's correct

#

Err that might not be the right amount

#

We really don't know much about fees/pricing here....