May 9, 2024 update: An Update Order action is now available for the Shopify app on Zapier which will allow you to update existing orders!
Hey Zapier Community! Jared here from the Zapier Support Team.
Have you ever wanted to update an order in Shopify using Zapier?
Maybe add tags or change the email address associated with the order.
If so - you might have noticed that Zapier doesn’t currently have an action to Update an Order in Shopify.
We can create an order but not update one.
However - there is a way to update at least some of the data on an existing Order using Webhooks by Zapier.
Webhooks by Zapier
My first thought when we don’t have an existing action is maybe we can use Webhooks by Zapier to send the request.
In order for that to work we need 2 things to be true.
-
The App has to provide Basic Authentication or API Key authentication for their API. If they require OAuth - Webhooks by Zapier won’t work.
In this case - Shopify does provide API Key and Password access to the API. This link describes how to generate those credentials in your Shopify account by creating a Private App.
When setting that up - you’ll want to be sure to give the Private App Read & Write access to Orders since we’ll need that level of access to be able to update the Orders.
-
They have to have an endpoint for updating the Order.
And Shopify does. You can see the full details on that endpoint here:
https://shopify.dev/docs/admin-api/rest/reference/orders/order#update-2020-10
Adding a Tag to an Existing Order
So now that we have our Endpoint and our Credentials - we can set up our Zap.
It’s important to note that your Zap will have to give you the Shopify Order ID from a previous step. We don’t have the ability to search for an Order in Shopify.
As an example - any of Zapier’s Shopify Order Triggers (like New Order or Updated Order) would provide the Order ID.
But you might also keep that Order ID in your CRM or a Google Sheet.
In my Zap below - I’m using Shopify New Order (Any Status) for my trigger since I know that will give me the Order ID.
Then at Step 2 - we’ll use a Webhooks by Zapier Custom Request.
When you set up your Shopify API Key - you’ll get an example URL that will have the important details you’ll need.
We can see in that screenshot that the general structure of the url is:
https://{apikey}:{password}@{hostname}/admin/api/{version}/{resource}.json
Everything before /admin - you can get from the sample URL that Shopify gives you.
Everything after that you can get from the Shopify Order Endpoint documentation.
In this case we want to update (PUT) an order and Shopify says that we should use the following endpoint to do that:
/admin/api/2020-10/orders/{order_id}.json
So the URL we will use for our PUT request is:
https://{apikey}:{password}@{hostname}/admin/api/2020-10/orders/{order_id}.json
Again - you would replace everything before /admin with the values that Shopify gives you for your store.
I’m using non-working testing values below just so I can show you the complete screenshot. :)
So let’s go through each piece of the Custom Request.
-
Method
For the Method - we are using PUT. This is typically the method that would be used to update a record via an API.
-
URL
For the URL - we’re using the structure from above. The one thing to note here is that we have mapped in the Order ID from the trigger. This way it will update dynamically each time the Zap runs.
-
Data
For data we’re using the structure that Shopify provided us here:
Again note that we have mapped in the Order ID from the trigger so that it updates dynamically when the Zap runs.
I’m only using 1 tag in my test but you can do multiple tags separated by a comma like the example above.
-
Headers
Under the header section you’ll want to put “Content-Type” on the left and “application/json” on the right.
And that’s it! All the other settings can remain at their default values.
Clicking Continue and then testing the Action - shows the Tag is indeed Added to the Order in Shopify!
What Can We Update?
So now that we know we can send a Webhook to update the order in Shopify - exactly what can we update on the Order?
First - I wasn’t able to update Draft Orders - only Orders that had already been created.
My test was for Tags specifically - but Shopify provides examples in their documentation for updating the following information on an Order.
-
Add a note to order
-
Add note attributes to an order
-
Change an order's email address
-
Change an order's phone number
-
Change whether the buyer accepts marketing
-
Add a metafield to an order
-
Update the shipping address of an order
-
Remove the customer from an order
-
Update an order's tags
I hope this post helps you build more powerful Shopify Zaps knowing there is a way to update some of the data on the Orders.
Thank you for reading and please feel free to provide any of your own examples of updating an order in Shopify in the comments below!