#Nik-checkout-tax
1 messages ยท Page 1 of 1 (latest)
The session only provides
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 410,
"breakdown": null
}
How can I find tax type & rate?
The tax type is based on the tax registration in your dashboard: https://dashboard.stripe.com/test/settings/tax
What kind of tax type are you referring here?
Have you tried taking a look at total_details.breakdown.taxes hash? https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-total_details-breakdown-taxes
Oops sorry! I just noticed the breakdown is null here
that's right. If I set my tax to UK & AU. I do have no idea what tax type is
unless, I check customer address or calculate tax percentage
Can you share a sample checkout session or payment intent ID?
cs_test_a1Y1lQ0TrKEB1m6xVqIp3W4ilBee09LN81PsOnoBRT2DzxxkoYcklHI09v
I'm checking with coworker whether this is any way to obtain tax information from the given checkout session ID
After checking, you can use total_details.breakdown field to get the tax details (https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-total_details-breakdown-taxes) I suggested earlier with expand feature: https://stripe.com/docs/api/expanding_objects
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-total_details-breakdown
Breakdown of individual tax and discount amounts that add up to the totals. This field is not included by default. To include it in the response, expand the breakdown field.
It'll include tax type and percentage
When I handle Events.CheckoutSessionCompleted, the session object has breakdown is null.
It's not included in the event, you will need to do a retrieve session call with total_details.breakdown expanded after checkout session is completed: https://stripe.com/docs/api/checkout/sessions/retrieve
Ok. Thanks
No problem ๐