WooCommerce#
WooCommerce is a customizable, open-source e-commerce plugin for WordPress.
Credentials
You can find authentication information for this node here.
Basic Operations#
- Customer
- Create a customer
- Delete a customer
- Retrieve a customer
- Retrieve all customers
- Update a customer
- Order
- Create a order
- Delete a order
- Get a order
- Get all orders
- Update an order
- Product
- Create a product
- Delete a product
- Get a product
- Get all products
- Update a product
Example Usage#
This workflow allows you to create, update, and get a product from WooCommerce. You can also find the workflow on n8n.io. This example usage workflow uses the following nodes. - Start - WooCommerce
The final workflow should look like the following image.
1. Start node#
The start node exists by default when you create a new workflow.
2. WooCommerce node (create: product)#
This node will create a new product in WooCommerce.
- First of all, you'll have to enter credentials for the WooCommerce node. You can find out how to do that here.
- Enter the product name in the Name field.
- Click on Add Field and select 'Description'.
- Enter a description in the Description field.
- Click on Add Field and select 'Regular Price'.
- Enter the price in the Regular Price field.
- Click on Execute Node to run the node.
In the screenshot below, you will notice that the node creates a new product.
3. WooCommerce1 node (update: product)#
This node will update the product that we created in the previous node. We will update the quantity of the product.
- Select the credentials that you entered in the previous node.
- Select 'Update' from the Operation dropdown list.
- Click on the gears icon next to the Product ID field and click on Add Expression.
- Select the following in the Variable Selector section: Nodes > WooCommerce > Output Data > JSON > id. You can also add the following expression:
{{$node["WooCommerce"].json["id"]}}
. - Click on Add Field and select 'Stock Quantity'.
- Set the quantity in the Stock Quantity field.
- Click on Execute Node to run the node.
In the screenshot below, you will notice that the node updates the quantity of the product that we created in the previous node.
4. WooCommerce2 node (get: product)#
This node will get the information about the product that we created using the WooCommerce node.
- Select the credentials that you entered in the previous node.
- Select 'Update' from the Operation dropdown list.
- Click on the gears icon next to the Product ID field and click on Add Expression.
- Select the following in the Variable Selector section: Nodes > WooCommerce > Output Data > JSON > id. You can also add the following expression:
{{$node["WooCommerce"].json["id"]}}
. - Click on Execute Node to run the node.
In the screenshot below, you will notice that the node returns the information about the product that we created using the WooCommerce node.