#HVMP
1 messages ยท Page 1 of 1 (latest)
Good question. Checking in to this and will get back to you.
Thanks Pompey! Either way I think we'd be able to make it work, but detailed attribution of tax amounts back to what caused the tax would be 
I should have asked, are you using Subscriptions/Invoices or Checkout? Looks like invoices has data on each line item: https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_amounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Oh and it looks like Checkout has this as well! https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-amount_tax
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
We would be using neither, actually.
We would directly be using the payment intents API
So any taxes we would include the tax calc in a metadata key, and just include the tax amount in the payment intent amount.
"would be", we currently are using payment intents. Also love payment intents btw ๐
Can you show me how you are passing this line item data in to the payment intent? I did not think that they had that functionality
It does not.
Basically i want to calculate tax before creating a payment intent.
Once I have cost of all the line items (including shipping and tax), I would then create the payment_intent amount (with all of that summed up).
In our internal 'order' records, we currently attribute taxes on a line-item basis since our current tax calculator provides this. Given our platform it is also beneficial to get this breakdown as well.
Also eyeing TaxJar, seems like a stripe company.. Perhaps better for our more "custom" usecase than stripe tax.. Still exploring.
Would this doc cover what you are trying to do here? Looks like we just came out with this API and it does support giving a line item breakdown after the calculation https://stripe.com/docs/tax/custom#calculate-tax
Learn how to calculate tax in your custom payment flow, and record the tax collected for reporting.
Yeah, this is the doc I was looking at. I think there just isn't, currently, support for line item breakdown.
I suspect ya'll use TaxJar under the covers since it's a stripe company, so maybe at some future point it'll be available ๐
Apologies I am not as familiar with that API and am just getting to look deeper. I see our sample code on that page shows getting line item level tax info via line_items.data.tax_breakdown', is that a different kind of breakdown than you want or have you been testing and finding that those are not populated? https://stripe.com/docs/api/tax/calculations/object#tax_calculation_object-line_items-data-tax_breakdown
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
OH!
I didn't realize that was in the response object. Perfect. All the doc examples didn't include that, and I scanned over it because I thought it was just scoped to the request objs in the line item.
This looks exactly like what we would need.
Thanks a ton!!
Awesome! Glad that API is useful here, that kind of stuff is definitely a pain to DIY