A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Yes I am aware there's a previous post : https://community.shopify.com/c/shopify-apis-and-sdks/refund-line-items-cannot-remove-more-than-the-...
This was happening on my live Shopify app, the Calculate Refund API returns a HTTP status 422 Error with message "cannot remove more than the fulfillable quantity." , if I set the "restock_type" of the refund_line_items to "cancel".
But if I set it to "return" , then it returns back a proper response, and the "restock_type" returned in the response is "cancel" !
This workaround works but I am afraid it might mess up inventory of other orders if the response returned back somehow is not "cancel" if I put in "return" as input.
I would be really thankful if any Shopify Staff can look into this issue as this has caused issues to merchants using my app.
The Request ID is 24f742a0-0e64-48ae-9f94-d86fb5d836f8
I ran into this issue today - and was not able to find a solution on the internet. Here is how I solved it
Steps to recreate this issue:
1. Create an order with more than one items.
2. Go to your admin, fulfil one of the items.
3. Attempt the request - it will throw this error that you are seeing.
Why does it happen?
In refund_line_items: You could be sending quantity for both the items (but since you had already fulfilled some of the items, the quantity needs to be decreased) When you chooserestock_type to cancel, you must only send the quantity which is unfulfilled for the variant.