#tgalanis_api

1 messages ยท Page 1 of 1 (latest)

ebon muskBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1253719021346357420

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

static radishBOT
#

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.

near drift
somber warren
#

no the subtotal - total

#

is the discount with tax

near drift
#

Sorry, you asked for the undiscounted price in your post, so subtotal seemed right. If you want the total amount including tax and discounts, that's in the amount_total field.

If it still sounds like I'm not grasping what you're asking, can you share more context or a specific example?

somber warren
#

wait it might be that I am not understating correctly : subtotal = undiscounted price with tax , total = discounted price with tax, subtotal-total = discount with tax and totalnetprice = total-taxamount

near drift
#

From our API ref that I linked above

amount_subtotal nullable integer
Total of all items before discounts or taxes are applied.
This is the part where it may depend on how you've added the tax to the checkout session to know whether the subtotal includes the "tax"

somber warren
#

i have tested order where we had a discount of 5 euros in a coupon code and the subtotal was 1200 and the total was 700, the amount of tax was 40 which is 700-700/106 so 700 is with tax and thus 1200 should also be with tax because then the total should have been 1160 ?

#

from what I understand discounts are applied on the final price so they are themselves "with tax"

near drift
somber warren
#

I have also looked at other orders if you just incloud a tax rate in the checkout session the amount_total is with tax for example : in a test order without discount i have amount total = 1200 and tax = 68 with 6% which is exactly 1200-1200/106 so the total was with tax

near drift
#

amount_total is expected to contain tax

somber warren
#

here are the data from said session (i asked my supervisor they are not in line with sharing the ssions code since it contains in the metadata information of our db) "amount_subtotal": 1200,
"amount_total": 700, "total_details": {
"amount_discount": 500,
"amount_shipping": 0,
"amount_tax": 40
}, and the tax rate was 6% included

near drift
#

Gotcha, I may have more clarifying questions then to understand what you're doing if you can't share the session. Is the tax you're adding inclusive?

somber warren
#

yes

near drift
#

So then it's included in the subtotal, so your subtotal should be amount (including tax) before discounts.

somber warren
#

yes i want subtotal without tax

#

but i need to keep the "inclusive" attribute

#

in the tax rate

near drift
#

So is amount_subtotal - amount_tax giving you the value you want?

ebon muskBOT
somber warren
#

i see your point

#

but i think wthat with incluisive tax the subtotal only calculates the discount

#

and still has the tax included

#

nevermind i will delve into it more probably you are correct and that is the right value

#

but thanks for the help