#nugax_tax-multiple
1 messages ยท Page 1 of 1 (latest)
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.
- nugax_api, 41 minutes ago, 157 messages
- nugax_invoice-email, 3 days ago, 54 messages
๐ 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.
Hi ๐
The request you shared creats an empty invoice. Do you have an example of the actual invoice with tax information?
There is nothing in that invoice. It's the same as the other one
invoice items: req_vRs2pO2GFHDFfZ
its a finalized invoice with an item, invoice items, price id, and prod
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
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
And you can see it clearly in the JSON response to this request: https://dashboard.stripe.com/test/logs/req_5xagCQyFCcwBgw
The code i though producted it was: $lineitem->tax_amounts[0]->amount;
The tax_amounts proptery returned in the JSON response includes the amount of 255 and the taxable_amount of 3000
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?
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
full amount being amount * quantity
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
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.
Yup. So if you wanted to represent your taxes on a per item basis you would divide the tax_amounts.amount by the quantity
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
Happy to help ๐
for the lineitems, is there a way to see the line total.
items * quanitity + taxes for the line?
When you say Line total, do you mean the total for each line item (including tax)?
Okay that would just be the line_items[0].amount + line_items[0].taxabale_amounts.amount
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
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!
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).
Sorry I don't know what you are referring to here. How is that different from what we've just discussed?
Sorry that is the total tax for the invoice. how can I get the tax rate applied (8.5%)
for all invoiceitem lines
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
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
right, got it