Discount on "Create Order" causing order total mismatch

I am trying to create an order with an ORDER scope discount but running into order total mismatch.

Lets say this is the order I created:
Items:

  • Pizza : $12 [15% tax applies on it]
  • Drink : $1 [NO tax applies]
    Discount: $1

Items Total: $13
Discount: $1
SubTotal: $12
Tax: $1.65
Order Total: $13.65

Now when I send this order to Square, in the response what I get back is that the $1 discount applies to both the line items (Pizza and Drink). Pizza has discount of 92 cents and Drink has 8 cents.

Response has:
Pizza: $12
Discount: $0.92
Tax: $1.66
Item Total: $12.74

Drink: $1
Discount: $0.08
Tax: $0.0
Total: $0.92


Order Total In Response: $13.66
Which is 1 cent higher than it suppose to be which result in mismatch when we add the payment to this order with correct amount of $13.65

Issue is that the discount is being applied on all line items which mess up the line item tax amount and eventually the line item total.

Total mismatch grows more when we have more items in cart and more discounts.

:wave: What’s the order_id? Also have you reviewed How totals are calculated in our documentation? :slightly_smiling_face:

Order Id: 1n6mxTqTZYYvyTk96XvTcSiG615YY

Attached is the image which shows how the order looks like on our end.

Basically, we have two items:
Hot Chocolate: $1 with no tax
Brownie: $2 with 5% tax

Also has a $1 off discount, which is set to reduce the tax amount. Which means calculate the tax after applying the $1 discount on the total taxable amount.

Taxable amount = $2 (From Brownie)
Now Add $1 discount
Total Taxable amount = $2 - $1 = $1

5% tax on $1 = $0.05

BUT Square adds a tax of $0.07

I am looking into the " [How totals are calculated]" right now.