I'm attempting to incorporate line item editing into my integration application. I can see how changes are saved when line item quantity is increased. I can also see how refund line items are used to reflect decreased item quantity on a line. The problem is with taxes. The line item taxes on the refund are exactly the same as the line item nodes on the order line item. There are no 'net change' tax nodes on the refund line to show the change in tax by tax title.
Can anyone point me in the right direction? I've spent hours poring through the returned order JSON.
Hey @BAASS_Developme ,
You are correct that there is no "net change" tax field on the Order object from Shopify which would show the change in tax due to a refund. The best workaround to achieve this would be take the order.total_tax field (which is the original total tax amount pre-refund) and then subtract that value by each of the order.refunds.refund_line_items.total_tax fields that are present. This will get you the new total tax amount for the order after the refund, and the sum of all the refund line items total_tax fields will be the net change in tax.
Hassain | Developer Support Specialist @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
Thank you for the reply.
I understand how that works to get total tax, however it doesn't solve the problem. When dealing with orders that have multiple tax authorities (GST / PST) it doesn't work to use the total tax amount on the refund line. We need net change by tax authority, and there is no way to get that using the refund line. I was hoping to see the refund line items node contain nodes for taxes at the tax total, and further tax lines showing each authority - just like the regular order line.
To me it doesn't make much sense to simply replicate the whole order line item node in the refund line items.