A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I'm using the Shopify Admin REST API (as documented at https://help.shopify.com/en/api/reference/orders/refund) to refund items from an order.
The API calls (POST /admin/orders/<order_id>/refunds/calculate.json, followed by POST /admin/orders/1985144127624/refunds.json) succeed (only unexpected thing being an empty refund_line_items in the return to /calculate).
But the problem is the order's status does not change to "refunded" - even if we refund the only product. What happens is that:
Has anyone else encountered this issue or something similar before? Does anyone know of a workaround?
Hey @aandrei,
The refund you created didn't include a refund transaction, so on that order the product was restocked but no money was returned to the customer. The payment status will only change if money is returned to the customer.
When you create the refund, make sure to include a refund transaction as outlined in the examples here. Once you include a refund transaction which references the original sale transaction, you should see the order payment status update as expected.
JB | Solutions Engineer @ Shopify
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog