#nugax_tax-multiple

1 messages ยท Page 1 of 1 (latest)

supple crownBOT
atomic magnetBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

supple crownBOT
#

๐Ÿ‘‹ 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/1239612492137762957

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

left mulch
#

Hi ๐Ÿ‘‹

The request you shared creats an empty invoice. Do you have an example of the actual invoice with tax information?

dusk olive
#

sure

#

one sec ill create one

#

req_uUfl6FpZWQQoUG

left mulch
#

There is nothing in that invoice. It's the same as the other one

dusk olive
#

invoice items: req_vRs2pO2GFHDFfZ

#

its a finalized invoice with an item, invoice items, price id, and prod

left mulch
#

that isn't the request you shared but let's ignore that for now. What are you trying to get at here?

#

The line item has tax amounts, I'm looking at them

dusk olive
#

so the invoice tax that i am showing in my applications, has tax amounts, but it shows them as combined. tax + quantity. I want to know how to get the tax amount for qty 1 of the lineitem

left mulch
dusk olive
#

The code i though producted it was: $lineitem->tax_amounts[0]->amount;

left mulch
#

The tax_amounts proptery returned in the JSON response includes the amount of 255 and the taxable_amount of 3000

dusk olive
#

thats for the quantity of 3

#

i wanted tax for quantity of 1. does stripe have a value that shows that?

#

or do i have to just calculate?

left mulch
#

No, it applies the tax rate to the full amount for the invoice item

#

If you want to represent the tax on a per item basis, you'll need to divide it by the quantity

dusk olive
#

full amount being amount * quantity

left mulch
#

The tax rate on the invoice item applies to the amount on the InvoiceItem. That amount is calculated from both the price.unit_amount and quantity

dusk olive
#

thats what I suspected. i gave me the abillity to see indvidual price amounts but it does not individual tax amounts. i just wanted to confir,

#

confirm

#

it*

#

but thats easy enough to obtain.

left mulch
#

Yup. So if you wanted to represent your taxes on a per item basis you would divide the tax_amounts.amount by the quantity

dusk olive
#

right, my code was correct it just wasnt divided.

#

and i wanted to make sure i knew what i was getting (and supposed to get)

#

thanks for confirming

left mulch
#

Happy to help ๐Ÿ™‚

dusk olive
#

for the lineitems, is there a way to see the line total.

#

items * quanitity + taxes for the line?

left mulch
#

When you say Line total, do you mean the total for each line item (including tax)?

dusk olive
#

yes

#

invoiceItem total i guess

left mulch
#

Okay that would just be the line_items[0].amount + line_items[0].taxabale_amounts.amount

dusk olive
#

and unit_amount isn the individual amount?

#

amount / quantity

#

is*

left mulch
#

unit_amount is a property on the price object. That is used, in conjunction with the quantity, to determine the amount for the Invoice Item. Invoice Item amount is the total (minus the tax) for that line item

dusk olive
#

so if you werent using quantity you wouldnt even need the price object?

#

you could just create a line item with an amount

#

im just trying to understand, appreciate explanations!

left mulch
#

You need to specify either a Price ID or price_data when creating an Invoice item (providing price_data will create a new Price object when the Invoice Item is created).

dusk olive
#

ok

#

got it

#

so where it says Local Tax - how can I get from stripe the tax rate?

left mulch
#

Sorry I don't know what you are referring to here. How is that different from what we've just discussed?

dusk olive
#

Sorry that is the total tax for the invoice. how can I get the tax rate applied (8.5%)

#

for all invoiceitem lines

left mulch
#

In the line items, since that is where you provided the tax rate, there is a tax_rates array. That array contains a single object with display_name and an effective_precentage properties. I think that is what you are looking for

dusk olive
#

ok.

#

one more question

#

so is $invoice->tax the correct total of tax on the invoice?

left mulch
#

Yup

#

If you had multiple tax rates or different tax rates applied to different items, that would represent the total funds collected for all taxes on the Invoice

dusk olive
#

right, got it

supple crownBOT