Tax calculations rounding issue

I’m integrating an app with Square’s Orders API and Payments API and have encountered an issue that I hope you can help with. Despite adjusting my tax calculation rounding function four times to align with Square’s banker’s rounding method, discrepancies still occur. For instance, today a transaction amounted to $18.41, with a tax rate of 9.75%, totaling $1.794975. My function rounded the tax to $1.80, whereas Square rounded it to $1.79.

This inconsistency poses a problem because the Orders API uses my tax calculation to create orders. However, when I attempt to make an external payment using the Payments API, it does not allow me to input my tax calculation. Square recalculates the tax, and if there’s a mismatch, it rejects the payment. This results in businesses not seeing the orders in Square, leading to situations where customers arrive to pick up orders that the shop is unaware of.

Is there a way to push my tax amount through the Payments API, or to prevent payments from being rejected due to mismatched totals? Any advice on handling this would be greatly appreciated.

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Payments Requirements
Payment API: Process Online and In-Person Payments
Collect Application Fees

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

What’s the order_id that’s causing this error? :slightly_smiling_face:

@Bryan-Square the order I referenced above is 29g86Niu0oZNyzEgCYPyJTa3yXTZY