A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hello everyone,
We have a GraphQL query to fetch the suggested refund for an order without applying any taxes and duties. However, the SuggestedRefund endpoint doesn't accept the argument refundImportTaxes. Our goal is to dynamically obtain the suggested refund value based on the selection of items, shipping, duties, and taxes.
Is there a workaround to achieve this?
{ "id": "gid://shopify/Order/12345678", "refundLineItems": [ { "lineItemId": "gid://shopify/LineItem/13579876", "quantity": 1, "restockType": "CANCEL", "removal": true } ], "refundDuties": [], "refundImportTaxes": false, "refundAdditionalFees": [], "shippingAmount": { "amount": "0.0", "currencyCode": "USD" } }
Solved! Go to the solution
This is an accepted solution.
Thanks for this. We have figured out with the SuggestedRefund API. The process is similar to what you have shared.
You can try this
Start by fetching the order details—you need to get the prices, taxes, and duties from the Shopify API.
Next, calculate the refund—take the total amount for the selected items and subtract the duties and taxes. This gives you the exact amount to refund without any extra charges.
Finally, create the refund—use your calculated amount to process the refund through Shopify’s API, ensuring that only the correct amount is refunded, excluding any duties and taxes.
This is not what we intend to do. This is what we have already done. However we would like to utilize SuggestedRefund GraphQL endpoint to achieve those which is explained above in the query.
This is an accepted solution.
Thanks for this. We have figured out with the SuggestedRefund API. The process is similar to what you have shared.
This is elaborated by @conversionist . That is the same process that we did using suggested refund api.