question

wm1 avatar image
wm1 asked wm1 edited

Ecommerce : . *** UPDATED Refunding items messes up itemized sales reports

Hi there.

We're facing a refund behavior which seems to incorrectly apply per-item taxes on refunded items, which subsequently causes Clover itemized sales reports to show incorrect information.

In short:

1. Create and pay for an order with 2 items : Pizza, $16.00 + $1.16 tax, Drink, $1.50, no tax.
Total for Order : $18.66

2. Refund the order. Sales report shows refunds:
Drink : $1.60 (should be $1.50)
Pizza: $17.06 (should be $17.16)

3. In addition, sales shows "fractional" item count for each sold and refunded item : 1.065 instead of "whole"

Screenshot below shows 2 such refunds (2 identical orders for $18.66)

clover-sales-refund-bug.png


It seems that during refund, tax amount ($.1.16) is split between all order items and applied to EACH item using the tax rate present in the order (on "Pizza"), despite the fact that "Drink" item has no tax rate.

***Update - this seems to happen on all orders with tax regardless whether there are "mixed" tax items in the order.


-----

Longer version with posts/reponses:

1. Create an item "Pizza" : $16.00 with 7.25% tax (rate: 725000 === $1.16)

2. Create another item "Drink" for $1.50 without tax

3. Create atomic order (taxes are applied per product)

Response (shortened)
{
    "id": "TH3W*****",
    "total": 1866,
    "paymentState": "PAID",
    "taxRemoved": false,
    "state": "locked",
    "payType": "FULL",
    "lineItems": {
        "elements": [
            {
                "id": "BFZ*****",
                "item": {
                    "id": "SRM*****"
                },
                "name": "Pizza",
                "price": 1600,
                "taxRates": {
                    "elements": [
                        {
                            "id": "BQ2*****",
                            "lineItemRef": {
                                "id": "BFZ*****"
                            },
                            "name": "Sales Tax",
                            "rate": 725000,
                            "isDefault": false
                        }
                    ]
                }
            },
            {
                "id": "ANMK*****",
                "item": {
                    "id": "A0R*****"
                },
                "name": "Drink",
                "price": 150,
                "taxRates": {
                    "elements": [
                        {
                            "id": "SVQ*****",
                            "lineItemRef": {
                                "id": "ANMK*****"
                            },
                            "name": "NO_TAX_APPLIED",
                            "rate": 0,
                            "isDefault": false
                        }
                    ]
                }
            }
        ]
    },
    "taxRates": {
        "elements": [
            {
                "id": "BQ2*****",
                "name": "Sales Tax",
                "amount": 116
            },
            {
                "id": "SVQ*****",
                "name": "NO_TAX_APPLIED",
                "amount": 0
            }
        ]
    }
}


4. Pay for the order v1/orders/{ID}/pay (taxes are applied per product)

Charge Response (shortened)
{
    "id": "14C9****",
    "order": {
        "id": "TH3W****",
        "currency": "USD",
        "total": 1866,
        "taxRemoved": false,
        "state": "locked",
        "payType": "FULL"
    },
    "amount": 1866,
    "taxAmount": 116,
    "offline": false,
    "result": "SUCCESS",
    "taxRates": {
        "elements": [
            {
                "id": "SVQM****",
                "paymentRef": {
                    "id": "14C9T****"
                },
                "name": "NO_TAX_APPLIED",
                "rate": 0,
                "isDefault": false,
                "taxableAmount": 150,
                "taxAmount": 0
            },
            {
                "id": "BQ2T****",
                "paymentRef": {
                    "id": "14C9T****"
                },
                "name": "Sales Tax",
                "rate": 725000,
                "isDefault": false,
                "taxableAmount": 1600,
                "taxAmount": 116
            }
        ]
    }
}


5. Refund the order via v1/refunds with the above "charge.id " and $18.66

{
    "id": "A7K86***",
    "orderRef": {
        "id": "TH3W***",
        "currency": "USD",
        "total": 1866,
        "taxRemoved": false,
        "isVat": false,
        "state": "locked",
        "payType": "FULL"
    },
    "amount": 1866,
    "payment": {
        "id": "14C9T3***",
        "order": {
            "id": "TH3WS***"
        },
        "amount": 1866,
        "tipAmount": 0,
        "taxAmount": 116,
        "result": "SUCCESS"
    },
    "lineItems": {
        "elements": []
    },
    "taxableAmountRates": {
        "elements": []
    },
    "voided": false,
    "status": "SUCCESS"
}


ecommerce
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community