WooCommerce¶
Getting Started with WooCommerce¶
The WooCommerce modules allow you to monitor, create, update, delete and search orders, coupons, products, or customers in your WooCommerce account.
Prerequisites
-
A WooCommerce account
-
WooCommerce WordPress plugin installed
In order to use WooCommerce with Ibexa Connect, it is necessary to have a WooCommerce account. If you do not have one, you can create a WooCommerce account at woocommerce.com.
The module dialog fields that are displayed in bold (in the Ibexa Connect scenario, not in this documentation article) are mandatory!
Connecting WooCommerce to Ibexa Connect¶
To connect your WooCommerce account to Ibexa Connect you need to generate the API Key and Consumer Secret.
-
Log in to your WordPress.
-
Open WooCommerce > Settings > Advanced tab.
-
Go to Legacy API, check the Enable the Legacy REST API checkbox and click the Save changes button.
-
Continue to the REST API section.
-
Click the Add Key button.
-
Enter the description of your connection and select the Read/Write option from the permissions drop-down menu.
-
Click on the Generate API key button.
-
Copy the Consumer key and Consumer secret and save it to a safe place.
-
Go to Ibexa Connect and open the Create a connection dialog of the desired WooCommerce module. Enter the values to the respective fields.
Note
SSL must be enabled on your WordPress site.
Note
Use pretty permalinks. Change the permalinks settings under Settings > Permalinks.
- Click the Continue button to begin setting up the WooCommerce module.
Triggers¶
(Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/)
New event¶
Triggers when a coupon, customer, order, or product is created, updated, or deleted.
Webhook name | Enter a name for the webhook. E.g. Order Created Webhook. |
Topic | Select the action that triggers the module. |
Watch Coupons¶
Triggers when a new coupon is created.
Limit | Set the maximum number of coupons Ibexa Connect will return during one cycle. |
Watch Customers¶
Triggers when a new customer is created.
Role | Select the specific role of the user you want to retrieve. |
I want to watch | Select whether to retrieve only new users or new and updated users. |
Limit | Set the maximum number of users Ibexa Connect will return during one cycle. |
Watch Orders¶
Triggers when a new order is created.
Limit | Set the maximum number of orders Ibexa Connect will return during one cycle. |
Watch Products¶
Triggers when a new product is created.
Limit | Set the maximum number of products Ibexa Connect will return during one cycle. |
Action¶
Create a Coupon¶
Creates a new coupon.
Code | Enter a coupon code. |
Amount | Enter the amount of discount. Should always be numeric, even if setting a percentage. |
Discount type | Select a type of applied discount. |
Description | Enter a description for the coupon. |
Date expires | Enter the date when the coupon expires. List of supported date formats. |
Individual use | If enabled, the coupon can only be used individually. Other applied coupons will be removed from the cart. |
Product IDs | Enter product IDs the coupon can be used on. |
Excluded product IDs | Enter product IDs the coupon cannot be used on. |
Usage limit | Define how many times the coupon can be used (in total). |
Usage limit per user | Define how many times the coupon can be used (per customer). |
Limit usage to X items | Set a maximum number of items in the cart the coupon can be applied to. |
Free shipping | If this option is enabled and if the free shipping method requires a coupon, this coupon will enable free shipping. |
Product categories | Select (or map) product categories (IDs) the coupon applies to. |
Excluded product categories | Select (or map) product categories (IDs) the coupon does not apply to. |
Exclude sale items | If this option is enabled the coupon will not be applied to items that have sale prices. |
Minimum amount | Enter the minimum order amount that needs to be in the cart before the coupon applies. |
Maximum amount | Enter the maximum order amount allowed when using the coupon. |
Email restrictions | Enter email addresses that can use this coupon. |
Meta data | Enter the key-value metadata for the coupon. |
Create a Customer¶
Creates a new customer.
Username | Set the customer login name. |
Password | Set the customer password |
First name | Enter the customer's first name. |
Last name | Enter the customer's last name. |
Billing address | Enter the billing address properties. |
Shipping address | Enter the shipping address properties. |
Meta data | Enter the key-value metadata for the coupon. |
Create an Order¶
Creates a new order.
Parent Order ID | Enter the parent order ID. |
Status | Set the order status. |
Currency | Select the currency for the order. |
Customer ID | Enter the ID of the customer who created the order. 0 = guest. |
Customer Note | The note that is left by a customer during checkout. |
Billing address | Enter the billing address properties. For the Country field, please use ISO 3166-1 country code. |
Shipping address | Enter the shipping address properties. For the Country field, please use ISO 3166-1 country code. |
Payment Method | Select one of the payment methods. |
Transaction ID | Enter the unique transaction ID. |
Line items | Add desired line items. For more details refer to the WooCommerce API documentation. |
Shipping Lines | Enter shipping line properties. For more details refer to the WooCommerce API documentation. |
Fee Lines | Add fee lines if needed. For more details refer to the WooCommerce API documentation. |
Coupon Lines | Enter coupon codes and discount totals. |
Set paid | If the option Yes is selected, the order is set as paid. It will set the status to processing and reduce stock items. The default value is set to No. |
Meta data | Enter the key-value metadata for the order. |
Create an Order Note¶
Adds a note to the order.
Order ID | Enter (map) the ID of the order you want to add a note to. |
Note | Enter the content of the note. |
Note will be shown to customers | If this option is enabled, the note will be for customers (with notification). If disabled, the note will be set as private – only for your reference. |
Create a Product¶
For more details about WooCommerce products refer to Adding and Managing Products on the WooCommerce documentation site.
Adds a new product.
Name |
Enter a product name. |
Slug |
Set the product slug for the URL. |
Type |
Select a product type. Options: simple, grouped, external and variable. Default is simple. |
Status |
Set the product status by selecting from the drop-down menu. |
Featured |
Select the Yes option to set the product as featured. |
Catalog visibility |
Select where the created product will be visible. |
Description |
Enter the product description. |
Short description |
Enter the short description of the product. |
SKU |
Enter the stock-keeping unit. |
Regular price |
Enter the regular price of the product. |
Sale price |
Enter the sale price of the product. |
Date on sale from |
The start date of the sale price, in the site's timezone. The list of supported date formats. |
Date on sale to |
The end date of the sale price, in the site's timezone. The list of supported date formats. |
Virtual |
Select the Yes option if the product is virtual. |
Downloadable |
Select the Yes option if the product is downloadable. |
Downloads |
Add files to be downloaded. File name Name of the file that is shown to a customer. File URL Enter the URL or absolute path to the file which customers will get access to. URLs should be already encoded. |
Download limit |
Enter the number of times downloadable files can be downloaded after purchase. |
Download expiry |
Enter the number of days until access to downloadable files expires. |
External URL |
Product external URL. Only for external products. |
Button text |
Button text for the external product. Only for external products. |
Tax status |
Select whether the taxable status of the product is |
Tax class |
Select to tax class of the product. |
Stock management at product level |
Select whether you want to manage the stock or not. |
Stock quantity |
Enter the stock quantity (Stock management at product level option must be enabled). |
In stock |
Select Yes to list the product as |
Backorders |
If managing stock, this controls if backorders are allowed. |
Sold individually |
Select the Yes option to allow one item to be bought in a single order. |
Weight |
Enter the product weight. |
Dimensions |
Enter the product length, width, and height. |
Shipping class |
Select the shipping class of the product. |
Reviews allowed |
Select Yes to allow product reviews. |
Up-sell IDs |
Enter the IDs of the recommended (up-sells) products. |
Cross-sell IDs |
Enter the IDs of the products you want to promote in the cart. |
Product parent IDs |
Enter the product parent ID. |
Purchase note |
Optional note to send the customer after purchase. |
Categories |
Select product categories. |
Tags |
Add tag(s) to the product. |
Images |
Add images of the product. |
Menu order |
Enter the custom ordering position. |
Attributes |
Use this to add product attributes (e.g. color, size, etc.). |
Metadata |
Enter the key-value metadata for the product |
Create Products (batch)¶
Allows you to create multiple products.
Products |
Add one or more products. Find fields description in the Create a product section above. |
Create a Product Variation¶
Creates a variation of the specified product.
Product ID | Enter (map) the ID of the product that you want to create a variation for. |
Please find the field descriptions in the Create a product section above.
Delete a coupon¶
Deletes a specified coupon.
Coupon ID | Enter (map) the ID of the coupon you want to delete. |
Delete a Customer¶
Deletes a specified customer.
Customer ID | Enter (map) the ID of the customer you want to delete. |
Delete an Order¶
Deletes a specified order.
Order ID | Enter (map) the ID of the order you want to delete. |
Delete an Order Note¶
Deletes a specified order.
Order ID | Enter (map) the ID of the order that contains a note you want to delete. |
Note ID | Enter (map) the ID of the note you want to delete. |
Delete a Product¶
Deletes a specified product.
Product ID | Enter (map) the ID of the product you want to delete. |
Delete Products (batch)¶
Deletes multiple products.
Product IDs | Add (map) IDs of the products you want to delete. |
Delete a Product Variation¶
Deletes a variation of a specified product.
Product ID | Enter (map) the ID of the product that contains a variation you want to delete. |
Variation ID | Enter (map) the ID of the variation you want to delete. |
Get a Coupon¶
Retrieves coupon details.
Coupon ID | Enter (map) the ID of the coupon you want to retrieve information about. |
Get a Customer¶
Retrieves customer details.
Customer ID | Enter (map) the ID of the customer you want to retrieve information about. |
Get an Order¶
Retrieves specified order details.
Customer ID | Enter (map) the ID of the order you want to retrieve information about. |
Get an Order Note¶
Retrieves specified order note details.
Order ID | Enter (map) the ID of the order that contains a note you want to retrieve information about. |
Note ID | Enter (map) the ID of the note you want to retrieve information about. |
Get a Product¶
Retrieves specified product details.
Product ID | Enter (map) the ID of the product you want to retrieve information about. |
Get a Product Variation¶
Retrieves details of a specified product variation.
Order ID | Enter (map) the ID of the product that contains a variation you want to retrieve information about. |
Variation ID | Enter (map) the ID of the variation you want to retrieve information about. |
Update a Coupon¶
Updates an existing coupon.
Coupon ID | Enter (map) the ID of the coupon you want to modify. |
Please find the description of the module fields in the Create a Coupon section.
Update a Customer¶
Updates customer details.
Customer ID | Enter (map) the ID of the customer whose details you want to modify. |
Please find the description of the module fields in the Create a Customer section.
Update an Order¶
Changes the order details.
Order ID | Enter (map) the ID of the order which details you want to modify. |
Please find the description of the module fields in the Create an Order section.
Update an Order Status¶
Allows you to change the status of a specified order.
Order ID
Enter (map) the ID of the order which status you want to change.
Status
Select a new status of the order.
If the error 404 "Failed to load data" is displayed, try using the Update an Order module to change the order status. The Update an Order Status module is intended for users with custom order status and requires Order Status Manager plugin.
Update a Product¶
Allows you to modify product details.
Product ID | Enter (map) the ID of the product you want to update. |
Please find the description of the module fields in the Create a Product section.
Update Products (batch)
Allows you to modify details of multiple products.
Products |
Add the products you want to modify. Please find the description of the module fields in the Create a Product section. |
Update a Product Variation¶
Allows you to modify details of a product variation.
Product ID | Enter (map) the ID of the product that has a variation you want to update. |
Variation ID | Enter (map) the ID of the variation you want to update. |
Searches¶
Search for a Customer¶
Performs a search among customers.
Search | Enter the search term. |
Filter results by email. | |
Role | Filter search results by a specific user role. |
Number of results | Set the maximum number of returned users. |
List Order Notes¶
Retrieves notes for the specified order.
Order ID | Enter the ID of the order you want to retrieve notes from. |
List Product Variations¶
Retrieves variations of the specified product.
Product ID | Enter the ID of the product that contains the variations you want to retrieve. |
Search for a Coupon¶
Performs a search for a coupon.
Search | Enter the search term. |
Filter results by the coupon code. | |
Number of results | Set the maximum number of returned coupons. |
Search for an Order¶
Performs a search for an order.
Search | Enter the search term. |
Customer ID | Enter (map) the ID of the customer you want to filter results by. |
Product ID | Enter (map) the ID of the product you want to filter results by. |
Status | Select the status of the order you want to filter results by. |
Number of results | Set the maximum number of returned orders. |
Search for a Product¶
Performs a search for a product based on defined filter settings.
Search | Enter the search term. |
Slug | Enter the product slug you want to filter results by. |
Category | Select the category of the product you want to filter results by. |
Tag | Select the tag of the product you want to filter results by. |
Status | Select the status of the product you want to filter results by. |
SKU | Enter the stock-keeping unit you want to filter results by. |
In stock | Select whether you want to search for products that are in stock or not. |
On sale | Select whether you want to search for products that are on sale or not. |
Featured product | Select whether you want to search for products that are featured or not. |
Min price | Enter the minimum price of the searched product. |
Max price | Enter the maximum price of the searched product. |
Attribute | Select the attribute and Attribute term of the product. |
Number of results | Set the maximum number of returned products. |