Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Undo restock if refund fails

Undo restock if refund fails

aacssh
Shopify Partner
1 0 0

We are implementing refund as per the following article. We are using refundSessionResolve to resolve the refund and refundSessionReject to reject the refund. In this flow, we observed that if we select restock and the refund fails then the product will be restocked.

https://shopify.dev/apps/payments/processing-a-refund#resolve-a-refund

For context, after we successfully processed the refund request, we can resolve it by using the refundSessionResolve mutation.
We are putting job in a queue and if it fails for some reason, we try for 18 times within 24 hours.

We have a situation where the refund fails even after 24 hours and 18 retries because the payment method do not support refund.
The refund won't be a success But the quantity will be restocked. Is there a way to undo the restock of quantity when the refund fails?
Replies 0 (0)