Shopify API - GET Order ID based on Order Number

Hi Parabola Community!

I have a CSV file that lists daily returns by Order Number from our Shopify store. As you would guess, one column is named order_number. I’d like to find the Order ID by adding the order_number as a variable through the API Enrichment step.

This endpoint should allow me to retrieve a list of orders (with Order IDs) by searching the Order Number:

GET /admin/api/2020-04/orders.json?name={order_number}

However, only 1 order comes up with an Order ID which is correct. The rest of that column is blank. Any ideas as to what may cause that?

Thanks for any help you might provide!
Daniel

Hi Daniel! I reviewed the Shopify API to make sure, but it doesn’t look like “Order Number” is a parameter you can use for retrieving order data from the Shopify API. That one Order ID that was returned in your screenshot, does the correspond to the right Order Number?

Where are you getting the CSV file from? Are you exporting from Shopify, or is it from a different service?

To accomplish this, I would recommend using the Pull from an API step to import your Shopify order data. Then, you can use the Combine tables step to join your CSV file data with the order data you imported from Shopify, using Order Number as the shared value.

1 Like

Hi Sachi! I was able to retrieve the Order IDs by adding &status=any to the end of the URL. This is what the final endpoint looks like:

GET /admin/api/2020-04/orders.json?name={order_number}&status=any

For context, I’m getting the CSV file through our logistics partner. Customers return their orders and include their order numbers which are logged to that file. The process is extremely manual since I refund each order row by row. The goal is to batch process refunds on a daily basis using those Order IDs

I like your suggestion of using an API Import with a Join step. My only concern is that we have thousands of orders spanning the course of 3 years. If I were to import those orders, would that take a while to return a response? I guess I could add some date parameters to narrow that search down. I’ll have to try out your method next.

Thanks again for all of your help!
Daniel

Huh, that’s really interesting. I learned something new! Thanks for sharing.

Cool use case too! So, are you thinking you’ll export a CSV from Parabola and upload to Shopify to batch process the refunds?

Yes, you’re right in that importing all orders from the past three years will likely be more time consuming and taxing than the solution you were able to come up with. If you haven’t already seen this thread, we’re actively working on a deeper, improved integration with Shopify. The updated integration will make it really easy for you to filter down your Order Data based on dates! Stay tuned for when we launch the new integration! Should be very soon.

Of course! Always happy to share with the Parabola community. The end goal is to aggregate the data from different endpoints and send a POST request to the Refund API. After doing some tweaking this weekend, I was successfully able to build this flow.

The biggest challenge was extracting the line_items.id from the line_items object. When flattening the array, rows would duplicate and the values from each column wouldn’t line up. This was especially true when customers returned only part of their order. I was able to get around this by using an If/Else step.

If anyone else is interested, I’m thinking of making a post in the Show and Tell category this weekend that provides a bit more insight about how I built this flow.

Thanks again for all of your help and for building such a powerful tool!
Daniel

3 Likes

Hey Daniel! Just making sure you see our update about the Shopify integration here:

1 Like

Hey Sachi! Thanks for the update. I’ll definitely check these out and start implementing them into my flows.

Congrats on the soft launch. Excited to hear what’s next! :rocket:

2 Likes