How can I track the status change of a refund transaction on Shopify Payments?

How can I track the status change of a refund transaction on Shopify Payments?

Zenoti
Shopify Partner
13 0 1

Hi, can anyone give some insight into the issue I'm currently facing with refunds. I have Shopify Payments setup in my store. While refunding the order through Shopify payment, the status field in Transaction property of the Refund resource from the web hook payload of refunds/create topic shows up as 'pending' as the refund amount usually takes some time to process (usually within 10 days according to documentation). How do I know when the refund transaction is changed to 'success' ? and also get this information along with the Refund object. we currently do not have a topic called refund/update. Is there any topic or event we can subscribe so we get the Refund Object when the status is updated to success. Thanks.

Replies 4 (4)

magecomp
Shopify Partner
426 29 42

Hello @Zenoti 

 

When you refund an order through Shopify Payments, the status of the refund will initially be set to "Pending". This is because Shopify Payments needs to process the refund before it can be marked as "Success". The processing time for refunds can vary depending on a number of factors, such as the payment method used and the amount of the refund."

To be notified when the refund status changes to "Success", you can subscribe to the refunds/update webhook topic. This topic will fire whenever the status of a refund is updated. The payload of the webhook will include the Refund object, which will contain the new status of the refund.

Helping voluntarily. Please like and accept the solution if it helps. Thanks!
Our Bestseller Shopify Apps    |      Mobile App Builder by MageComp    |      Shoplock Hide Pages/Collections

Need a developer?  Just visit MageComp website
Zenoti
Shopify Partner
13 0 1

Hi @magecomp Thanks, really appreciate your time. As mentioned above refunds/update is not a valid topic. Please find the list of valid topics we can subscribe to https://shopify.dev/docs/api/admin-rest/2023-04/resources/webhook#event-topics

Have tried registering this topic through postman. got the following error 

"errors": {
        "topic": [
            "Invalid topic specified: refunds/update. Does it exist? Is there a missing access scope? Topics allowed: app/uninstalled, carts/create, carts/update, checkouts/create, checkouts/delete, checkouts/update, collection_listings/add, collection_listings/remove, collection_listings/update, collections/create, collections/delete, collections/update, customer_groups/create, customer_groups/delete, customer_groups/update, customers/create, customers/delete, customers/disable, customers/enable, customers/update, customers_marketing_consent/update, draft_orders/create, draft_orders/delete, draft_orders/update, fulfillment_events/create, fulfillment_events/delete, fulfillments/create, fulfillments/update, order_transactions/create, orders/cancelled, orders/create, orders/delete, orders/edited, orders/fulfilled, orders/paid, orders/partially_fulfilled, orders/updated, product_listings/add, product_listings/remove, product_listings/update, scheduled_product_listings/add, scheduled_product_listings/update, scheduled_product_listings/remove, products/create, products/delete, products/update, refunds/create, segments/create, segments/delete, segments/update, shop/update, themes/create, themes/delete, themes/publish, themes/update, variants/in_stock, variants/out_of_stock, inventory_levels/connect, inventory_levels/update, inventory_levels/disconnect, inventory_items/create, inventory_items/update, inventory_items/delete, tender_transactions/create, app_purchases_one_time/update, app_subscriptions/approaching_capped_amount, app_subscriptions/update, domains/create, domains/update, domains/destroy, profiles/create, profiles/update, profiles/delete, selling_plan_groups/create, selling_plan_groups/update, selling_plan_groups/delete, bulk_operations/finish\n"
        ]
    }
}

 

olivia-returbo
Shopify Partner
1 0 0

Any updates regarding this? Was just looking into this specific scenario. The current documentation for the order_transactions/create webhook states that it fires "[...] when it's status is updated."
https://shopify.dev/docs/api/admin-rest/2024-04/resources/webhook#event-topics-order-transactions-cr...
Does anyone know if it is possible to only subscribe to refund transactions instead of all transactions? In that case maybe this solves the problem 🤔

Zenoti
Shopify Partner
13 0 1

Hi @olivia-returbo ,I guess the only one way to achieve my use case is to subscribe to orders/update itself (which I already am). The response from orders/update seems to contain the refund details. Will have to process the data from the response of orders/update as it would be triggered on updating the refund, thanks