Is the shipping_refund net or gross?

jbockler
Shopify Partner
1 0 1

We noticed a strange behaviour regarding the "shipping_refund" order adjustment of refunds.
One of our customers (we are an App-Developer) stated out, that the we had an error in the calculation of the refunded amount. This is caused by the shipping refund not including the tax. The extra field for tax_amount is correct, but it is not included in the amount. Which differs from the "shipping_lines" of the original order where the tax is already included in the price.

Of course, that wouldn’t be a problem if it were always like this. But after analyzing the refunds of other customers, i found that the tax is included in the "amount"-field for roughly half of our customers. We even have some customers where we sometimes receive a gross shipping refund and sometime a net one.

Is there some way for us to identify if we receive a net or gross shipping refund?
Could it be some setting which can cause this or can the user decide this while creating a refund? 

Some technical details:
API: REST Admin API
Version: 2021-01 and 2023-01
Endpoint: Orders

An example:
shipping_lines:

 

"shipping_lines": [
    {
        "phone": null,
        "carrier_identifier": null,
        "requested_fulfillment_service_id": null,
        "title": "Versand",
        "discounted_price": "6.90",
        "source": "shopify",
        "price": "6.90",
        "discounted_price_set": {
            "shop_money": {
                "amount": "6.90",
                "currency_code": "EUR"
            },
            "presentment_money": {
                "amount": "6.90",
                "currency_code": "EUR"
            }
        },
        "price_set": {
            "shop_money": {
                "amount": "6.90",
                "currency_code": "EUR"
            },
            "presentment_money": {
                "amount": "6.90",
                "currency_code": "EUR"
            }
        },
        "id": 123456789,
        "tax_lines": [
            {
                "price_set": {
                    "shop_money": {
                        "amount": "1.15",
                        "currency_code": "EUR"
                    },
                    "presentment_money": {
                        "amount": "1.15",
                        "currency_code": "EUR"
                    }
                },
                "price": "1.15",
                "channel_liable": false,
                "rate": 0.2,
                "title": "AT VAT"
            }
        ],
        "delivery_category": null,
        "code": "Versand",
        "discount_allocations": []
    }
]

 

 

and the order_adjustment of the refund:

{
    "kind": "shipping_refund",
    "id":123456789,
    "refund_id": 123456789,
    "order_id": 123456789,
    "tax_amount_set": {
        "shop_money": {
            "amount": "-1.15",
            "currency_code": "EUR"
        },
        "presentment_money": {
            "amount": "-1.15",
            "currency_code": "EUR"
        }
    },
    "amount": "-5.75",
    "tax_amount": "-1.15",
    "reason": "Shipping refund",
    "amount_set": {
        "shop_money": {
            "amount": "-5.75",
            "currency_code": "EUR"
        },
        "presentment_money": {
            "amount": "-5.75",
            "currency_code": "EUR"
        }
    }
}

 

 

 

Replies 0 (0)