We have been working with the Square API and have some issues with tax calculations that result in: “The total of the requested payments does not match the total of the sale order”. We have found that in some cases Square uses Banker’s rounding but in other cases it uses conventional rounding. I will provide some examples below. The tax rate I am using is 8.875%

Order #1:

- Item 1: $18.80
- Item 2: $6.95

Subtotal: $25.75

Itemized Tax:

- Item 1: $1.6685
- Item 2: $0.6168125

Itemized Tax Total: $2.2853125

Subtotal Tax: 25.75 * 0.08875 = $2.2853125

Square’s Tax: $2.29

Using conventional rounding at 3dp for both itemized tax total and subtotal tax ($2.285) results in $2.29, since we would round up at 5 and is consistent with the Square’s tax. But for banker’s rounding at 3dp, $2.285 would round to $2.28 which is inconsistent with Square’s tax. If we applied banker’s rounding from the tail end of the number $2.2853125 would round to $2.28 where ($2.285313 → $2.28531 → $2.2853 → $2.285 → $2.28) it is still inconsistent.

In this example, we see that conventional rounding resulted in the tax calculation that is consistent with square but not with banker’s rounding. I will provide another example where using banker’s rounding is consistent with square’s tax calculation.

Order #2:

- Item 1: $15
- Item 2: $8
- Item 3: $6.95
- Item 4: $6.95

Subtotal: $36.90

Itemized Tax:

- Item 1: $1.33125
- Item 2: $0.71
- Item 3: $0.6168125
- Item 4: $0.6168125

Itemized Tax Total: $3.274875

Subtotal Tax: 36.90 * 0.08875 = $3.274875

Square’s Tax: $3.27

Using conventional rounding at 3dp $3.274 would round to $3.27, because we would round down at 4. Same with banker’s rounding at 3dp $3.274 would round down to $3.27.

However, if we applied banker’s rounding from the tail end of the number $3.274875 would round to $3.28 where ($3.274875 → $3.27488 → $3.2749 → $3.275 → $3.28).

We would like some clarity as to how Square actually calculates tax. Does banker’s rounding happen at 3dp or at every digit from the tail end of the number until it reaches 2dp? In addition, does Square apply tax to each item, then apply rounding and finally add up the total tax or is the tax only applied on the subtotal?