#tgalanis_api
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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.
- tgalanis_checkout-coupon, 21 hours ago, 8 messages
Hi ๐ does the value in amount_subtotal align with the value you're hoping to retrieve from us?
https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-amount_subtotal
It may not include the tax amount depending on how you added tax to the session.
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?
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
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"
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"
I'm not following this, do you have the ID of a Checkout Session from your testing that I can look at?
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
amount_total is expected to contain tax
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
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?
yes
So then it's included in the subtotal, so your subtotal should be amount (including tax) before discounts.
yes i want subtotal without tax
but i need to keep the "inclusive" attribute
in the tax rate
So is amount_subtotal - amount_tax giving you the value you want?