This question was **closed** Apr 02 at 09:52 PM by Clover_Community_Bot for the following reason: automated

Hi,

I am sending an order to clover where: - item1 is $2.99 and taxable - 8.25% tax - item2 is $2 but NOT taxable - 0% tax - total order has discount of $2.99

https://www.clover.com/r/PTGW0XCK1BJ58

On Clover, the tax is coming out to be $0.1 whereas I don't think there should be any tax for a customer in this scenario. Please help and tell what can we do to prevent this tax mismatch.

Comment

@jacobabrams we have seen another discrepancy when calculating the tax for the below scenario

We have two items - 10.99 each for one item we have two taxes 9.25% and 8.50% and the second item has a tax of 7.75%. We also have a discount of 2.99 for which we proportionally applied to both the items - $1.50 & 1.49.

Item 1: Discounted amount: 10.99-1.50 = 9.49 Tax: 9.49*17.75% = 1.68

Item 2: Discounted amount: 10.99 - 1.49 = 9.50 Tax: 9.5 * 7.75% = 0.74

Total tax: 2.42

On clover side we are seeing a tax of 2.43. https://www.clover.com/r/ERQA66PTEF3W2

Can you please look into this.

The tax computation computes each tax individually, it doesn't sum 8.5% and 9.25%. This is because each tax authority will desire that their tax is rounded up to the nearest penny and doesn't care about other tax authorities. So yes 17.75% gives $1.68 but then you would need to pay your taxes to two different authorities and one would see they didn't get rounded up. So our computation is $9.49 * 8.5% = round up to $0.81 and $9.49 * 9.25% = round up to $0.88. Now each tax authority gets rounded up.

**Answer** by Jacob Abrams
·
Nov 25, 2015 at 03:09 PM

An order-level discount is applied proportionally to all items when computing taxes. If the discount is intended for a single item you should make it an line item-level discount instead.

Also taxes are computed individually for each tax rate being applied. So if you have two tax rates on an item, we will not sum the taxes before calculating the tax, instead we calculate the tax for the first rate and round up, then calculate the tax for the second rate and round up, then sum the taxes for the total tax. This ensures each tax authority sees that their tax has been rounded up.

If you want to replicate Clover's calculations exactly you may want to actually just want to use a java library we provide, you can find information about that here: http://devask.clover.com/question/221

Here is the calculation based on the items in your question:

```
Item 1 (non-taxable): 2.00
Item 2 (taxable): 2.99
Undiscounted subtotal: 4.99
Subtotal discount: 2.99
Item 2 tax: (2.99 - (2.99 / 4.99) * 2.99) * 0.0825 = 0.10
Tax: 1.20
Total: 4.99 - 2.99 + 0.10 = 2.10
```

Actually, this issue started after item2 was made non-taxable. Before that, there was never a tax mismatch with this very same order level discount API. Ok, so $1.5=$2.99/2 is discount for each item. Please help in understanding the calculation steps: After-discount item1=$1.49 = $2.99-$1.5 and item2=$0.5 = $2-$1.5. Since only item1 is taxed at 8.25%, tax=$0.13 = 8.25%*$1.49. Now order total=$2.12 = $1.49+$0.5+$0.13. Still tax=$0.13 but its $0.1 on Clover & total=$2.12 but its $2.10 on clover.

Another order with tax mismatch- https://www.clover.com/r/HARJSQ9H9KNJG. I understand that we have to apply item level discounts. But even after that, tax calculation logic is unclear to me. Please explain TAX CALCULATION on the order so that we can replicate the logic on our end. We find that if item2 IS taxable, then there is no mismatch at all - https://www.clover.com/r/AYPKK8CB5QM2G

I misspoke, discount is not applied evenly, it is applied proportionally. See updated answer.

Thanks! So if we have 5 items $2 each (discounted, taxed) but 2 items $2 each (not discounted, not taxed), and an overall order discount of $5 for the 5 items, then we should send to clover $1 (proportionate) discount for each of the 5 items (discounted) but nothing for the remaining 2 items. Then order tax `= 8.25% * ($2-$1)*5 = $0.45`

and total order `= $1*5+ $2*2 + $0.45 = $9.45`

Clover Developer Community

Follow
### Follow this Question

Rounding discrepancies 0 Answers

Taxes & Discounts 1 Answer

Service Charge and Discount through Clover SDK 1 Answer

Copyright © 2010-16 DZone, Inc. - All rights reserved.

- Anonymous
- Sign in
- Create
- Ask a question
- Post an idea
- Create an article
- Spaces
- App Market Developer Platform
- Clover GO
- Ideas & Feedback
- Semi-Integration
- Explore
- Topics
- Questions
- Ideas
- Articles