How to change refund status?

Shopify Partner
69 1 5

I am using a HPSDK and with some payment methods the payment will be pending at first. It takes some time for the payment to go through and then it will change to "DONE" in the payment backend. When i refund through Shopify it will then be pending at first, because from payment gateway payment status came back. Now when later it goes through, how could i change the pending to completed in shopify?

Replies 3 (3)
Shopify Partner
69 1 5

Bringing this up again, have not got an answer.

Shopify Staff
Shopify Staff
1134 84 226

Hey there, 


In order to transition a pending refund into a completed one, you can send a separate POST request to the same URL that you used for x_url_callback when you created your pending refund.


You would just need to use a new value for x_gateway_reference and make sure that your x_result was set to completed instead of pending, and that will complete the refund. 


It's worth noting that doing this will overwrite your previous pending refund, but it doesn't create a brand new, separate transaction on the order. It overwrites the pending one with the payload that you sent to complete it.


At this time, in the admin you will still see a transaction message of 'Transaction pending' if you expand the refund information in the order timeline. That is just left over from your previous pending refund though. It does not mean that the completion didn't work, it just isn't being overwritten currently. Everything else on the transaction and order should work normally, and I've reported this as a bug so that our engineers are able to look into a fix.


Hope this helps, enjoy! 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

New Member
1 0 0

May I ask is somone looking into this bug? It's pending for ~3 yrs already.