Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
Hi Shopify Team,
I'm a developer of the app.
I want to my system be able to cancel the order and make a refund automatically after webhook for "orders/create" were triggered.
How can I refund the order? Cause Shopify API documenation says that I need to specify the location_id of the items that were in that order (location_id is required).
So how can I get these location_ids ?
Thanks,
Alex
Hey Alex,
To get potential location_ids for a refund, there are GraphQL and REST examples in our guide here.
While the guide is for updating inventory, the same steps still apply for retrieving a location_id - you'll just only need the 'Step 1' and 'Step 2' parts.
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
Hi @Josh I'm trying to do the same thing. Was able to get potential location ID's, but do you know how to get the location ID that Shopify assigns?
Example: When you look at the order details page, you see a location for each line item. How do you get that location that shows in the line item in the orders page?