#nick_api

1 messages ¡ Page 1 of 1 (latest)

gleaming bluffBOT
#

👋 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/1328865020280442892

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

tough mural
#

Hi there! Looking now

hearty jolt
#

Hello! No rush at all; appreciate it!

tough mural
#

Do you have a more minimal example that illustrates the issue you're facing? Perhaps an Invoice with a single line item and tax rate, if possible?

hearty jolt
#

Unfortunately I don't have one that is more broken down; I could get one up in 15 mins~ if that'll be helpful though

tough mural
#

That would be great. Otherwise, we'll need a really specific breakdown of the issue with the example Invoice you already provided - where we should be looking, what is happening currently, and what you are expecting to see that is not happening.

hearty jolt
#

Makes sense! I'll get one of those spun up here in a few, in the meantime this migth also be helpful:

In the /updateLines call i'm applying 5 tax rates to two different line items, to narrow it down to one for a specific use case: I'd expect line item il_1QhI9bCEQnHi4E9WrjbkDOs4 to have San Francisco Access line Tax (VoIP) be a flat rate fee of $51.12 . I do pass percentage: 0 in that request on that tax_rate; so I would expect it to be a flat rate based on the docs

Invoice ID in_1QhI9bCEQnHi4E9WKddJizCb

hearty jolt
#

I am a little confused here though, because now i'm seeing actual taxes

#

For reference on the older one; which just had it always be 0% -> $0.00

tough mural
#

thanks for that; looking

#

The main thing that I notice between the previous example and your latest is that in the previous example, none of the line items have tax amounts, and that's where you are getting the $0 tax amounts. That's this Invoice update request: https://dashboard.stripe.com/test/logs/req_W7Lv64WpnqON8D

#

It seems to make sense that tax can't be calculated on negative values. Is it expected that you are passing negative values for taxable amount? If yes, what is the reason?

hearty jolt
#

Some of those cases will have tax calculated on negative values to support prorations/refunds/etc. There's a few cases our company has where a users invoice will have a line item with a negative amount, mainly prorations though

#

Oh sorry taxable_amount- misread; Yes that was most likely me running through various scenarios trying to get the flat rate working.

That is always set back to what Avalara gives us back as the taxable measure; the negative values there are me testing out different ones

#

Originally I had taxable_amount set to 0 or 1 and neither fixed the fixed rate display though- i'll get an invoice up with that change now

#

In the most recent example you have positive values for taxable_amount, as here: https://dashboard.stripe.com/test/logs/req_xoMyR6aukPkJaf

I might be misunderstanding this one, I see the request has a mix of positive and negative taxable_amounts, but the math ends up just being the sub total anyways.

I would expect this request to properly update the flat rate, especially since the one with all negatives (https://dashboard.stripe.com/test/workbench/logs/req_W7Lv64WpnqON8D) is properly showing the amounts I would expect, but the request bodies are incredibly similar

tough mural
#

In req_W7Lv64WpnqON8D, you're updating the Invoice's line item and passing four taxable_amount , all of which are negative. As far as I can tell, that's the only thing that defines the amount that tax can be calculated on for that line item. Because all of the taxable amounts are negative, we don't charge tax.

hearty jolt
#

That's not true for req_W7Lv64WpnqON8D

All taxable amounts are negative, and it is the only invoice that is properly displaying the negative flat rates I expected to see

#

But req_xoMyR6aukPkJaf has a mixture of the two; interestingly the amount that displays on the tax items is exactly equal to the subtotal amount, so Stripe is properly accepting both negative and positive taxable_amounts here and computing the sum I would expect.

But that request has the tax items all as 0% on $486.04; the request bodies are exactly the same minus the difference in taxable_amounts/amount

tough mural
#

req_W7Lv64WpnqON8D is updating a single line item with four negative tax amounts. req_xoMyR6aukPkJaf is updating two Invoice line items, the first of which has a mix of positive and negative tax amounts and the second of which has only positive amounts.

Overall, there is a lot going on here and its difficult to diagnose. I think we really need a truly minimal example with a single taxable_amount

gleaming bluffBOT
hearty jolt
#

Understood, i'll work on getting a more minimal invoice in this thread. We're coming up on my end of day so it might be tomorrow AM- is that fine? I'm not sure on how the Discord support channel works

I am wondering if flat rate fees can only be a applied to a single line item, and if I try to apply that same fixed fee to multiple it ends up breaking. That is one consistency I'm noticing between these requests.

Appreciate the help! This one has a doozy to wrap my head around