Integrating Power Automate into our WooCommerce online store
Since I am automating my online shop I wanted to share some of the key elements that I came across.
Background:
I have a website where I sell 3d printed Harry Potter wands and I want to automate the whole process, starting when I get the order, to 3d printing and scheduling the order in the post office. (If you want to check it out > https://leviosashop.rs/)
The Plan:
The first thing for me would be to integrate Power Automate with WooCommerce so my flow can run each time I receive an order.
This automation is going to be expanded, in a way that it is going to serve as Inventory Management (it is going to check if the ordered item is in stock or not), and as Order Tracking System / Customer Notification, where I am going to check if the customer has received his order or not and notify them about the state in which their order is).
I will write more on that once I complete the parts of the implementation.
In today's blog post, I am going to focus on how I integrated Power Automate and WooCommerce and explain two different ways of doing this - one with paid Plugin from WooCommerce and the second one free using Rest API.
Power Automate for WooCommerce?enables our WooCommerce store to be connected to over 675 services through Microsoft Power Automate. It is a paid plugin so we need to buy it from WooCommerce Marketplace
How to install it?
Now we need to create a REST API key (this is also going to be needed for an alternative connection method that does not require the plugin).
Go to:?WordPress Admin > WooCommerce > Settings > Advanced > REST API?and create a?REST API Key. Once created, make a note of the?Consumer Key?and?Consumer Secret.
This plugin is very powerful and it has one of the capabilities that we need and that is to create a trigger for our flow to start once we receive a new order.
If it is our first time connecting Power Automate to one of our websites we need to create a connection first
Here we can write the Consumer Key and Consumer Secret that we have just created on the REST API key page.
After that we should be able to see the trigger below:
There is only 1 trigger and we can configure it for multiple use cases. We can trigger our flows on Customers, Coupons, Orders, Products, and Subscriptions.
Other than that Power Automate for WooCommerce has multiple actions that we can use:
The activities above are really powerful to use.
Example: If we have an online shop that is growing, we could create a trigger that is monitoring certain changes in one of our online files or folders, and once the BOT detects the changes it would take all the items from the spreadsheet and add them to our webshop.
For our current automation, we don't need these activities.
领英推荐
2. WooCommerce REST API configuration
Since I don't want to pay for WooCommerce Plugin (maybe in the future) I opted out of the second approach which is invoking WooCommerce Rest API and getting new orders from my Website.
This approach will be slightly different since we are not triggering the BOT on new Order, we are triggering the BOT on the Email that we receive when we get a new Order (It is the same, but different in the view of automation and implementation).
Let's head to WooCommerce Rest API documentation.
There is a lot of activity that we can do but we are interested only in one, and that is getting the new Order.
Since my Website is generating emails with order numbers I can easily extract that information and query this API to get the results.
Let's first test the call in Postman to see what kind of response we can expect (And write down that response)
These are the configurations of the call
As we can see from the response, we can easily extract Customer information such as First and Last Name, City, Address, and phone number.
We can also extract the information about the order, the name of the item, quantity, and total price (we will need this information later when we check if we have this item in stock)
Save this response somewhere because we will need it during implementation in Power Automate.
Let's do the same call in Power Automate.
The activity that we need for this is HTTP Request.
In the Username and Password fields we need to type in Consumer Key and Consumer Secret values.
We are querying our WooCommerce webshop for any Orders that are in status processing.
The next activity that we need is Parse JSON. We can use the response from Postman and create a Schema according to the response that we are going to receive.
After that, it is really easy to get all the information that we need since we will have them as variables when choosing Dynamic values.
Take a look at the sample that I extracted for one of my customers
This in combination with the email trigger will give me exactly what I need to continue with the automation.
Did you find this blog interesting or do you want to do something similar for your e-commerce shop? Feel free to reach out to me.
Nice post ??
Customer Technology Solution Specialist ,at FedEx Express | BE | Post Graduate Diploma in Supply Chain Management - Symbiosis
1 年Thanks for sharing
AI/RPA Automation Consultant | 4 x UiPath MVP
1 年Interesting use case Sr?an Su? I remember trying to implement an e-commerce process in Shopify a few years back since all of the extensions were paid and some were kind of overpriced, but it was all through web automation rather then using APIs. My question is, if you were to want to deploy the same process for another store, is it as simple as sharing the process and downloading the PA extension?
Automating boring task's so you don't have to! | UiPath MVP | RPA Developer | RPA Business Analyst | RPA Solution Architect | 3D Print enthusiast
1 年Special thanks to Milan Mili?ev for inspiring me to write this