WooCommerce v2
Provides integration with WooCommerce, the e-commerce plugin for WordPress, through the WooCommerce REST API wc/v3 of your self-hosted store.
Use this Node to read and change store data from a Workflow, for example to export new orders, keep product prices and stock in step with another system, add notes to orders, or create customers and coupons. The Node covers products, product variations, product categories, product tags, orders, order notes, customers and coupons, and reads refunds.
Revision History
0.0.0.4 - Initial release.
Connection
The Connection stores the store's address and the REST API key that every request uses.
| Property | Type | Description |
|---|---|---|
BaseUrl |
String | The store's site root, for example https://shop.example.com/, or https://example.com/shop/ when WordPress runs in a subfolder. The Node adds wp-json/wc/v3/ itself, so do not include it. Use https. |
ConsumerKey |
Masked | The REST API consumer key, starting with ck_. |
ConsumerSecret |
Masked | The REST API consumer secret, starting with cs_. |
Setup Notes
- In WordPress, open
WooCommerce→Settings→Advanced→REST APIand create a key for a user with WooCommerce access, normally an Administrator or Shop manager. - Give the key
Readpermission to useGet,ListandSearch, orRead/Writeto also useCreate,UpdateandDelete. - Create a Connection for
WooCommerce. Enter the store address inBaseUrl, and the key and secret inConsumerKeyandConsumerSecret. - Test and save the Connection. The test confirms the address, the key and read access, but not write access. It fails with
WooCommerce connection test timed out.when the store does not answer within 30 seconds.
Keep the following in mind when you set up the Connection:
- The key acts as the WordPress user it was issued to, so the Node can only read and change what that user may access.
- WordPress permalinks must not be set to
Plain. When the test fails withBaseUrl does not serve the WooCommerce REST API., check thatBaseUrlis the store's site root, that WooCommerce is active and that permalinks use any setting other thanPlain. - The Node does not follow redirects. If the store redirects
BaseUrlto another address, requests fail with a message that names the redirect status. Enter the address the store actually serves. - WooCommerce keys do not expire. A revoked key fails with HTTP
401; create a new key and enter it in the Connection.
This Node runs on the Cloud Cluster and on local Clusters. Use a local Cluster when your store is not reachable from the internet. Plain http is accepted only for a store on the same machine as the local Cluster Host.
Methods
Select a template for each Step. Templates supply OperationId and the Options or Items fields of the selected record type, using WooCommerce's field names. Templates do not depend on the Connection, so you can switch a Step to a Connection for another store without reselecting its template.
| Method | Templates |
|---|---|
Get |
Product, product variation, product category, product tag, order, order note, order refund, customer and coupon. |
List |
Products, product variations, product categories, product tags, orders, order notes, refunds of an order, refunds, customers and coupons. |
Search |
Products, product variations, product categories, product tags, orders, refunds, customers and coupons. |
Create |
Product, product variation, product category, product tag, order, order note, customer and coupon. |
Update |
Product, product variation, product category, product tag, order, customer and coupon. |
Delete |
Product, product variation, product category, product tag, order, order note, customer and coupon. |
Get
Gets one record by its ID.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | WooCommerce Connection to use. |
OperationId |
String | Operation selected by the template. |
Options |
Object | The record id, plus product_id for a product variation or order_id for an order note or order refund. |
| Return | Type | Description |
|---|---|---|
Response |
Object | The WooCommerce record, without a Flowgear object. |
A record that does not exist fails the Step with WooCommerce's message.
List
Lists records, oldest first. Filters are optional; a List Step with no filters returns the whole collection.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | WooCommerce Connection to use. |
OperationId |
String | Operation selected by the template. |
Options |
Object | Optional filters for the selected template, such as sku, status, category, after or email. Product variation, order note and refunds of an order templates also require the parent product_id or order_id. |
| Return | Type | Description |
|---|---|---|
Response |
Array | One row per WooCommerce record, across every page, without a Flowgear object. An empty result returns zero rows. |
Search
Searches records, oldest first. At least one filter is required.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | WooCommerce Connection to use. |
OperationId |
String | Operation selected by the template. |
Options |
Object | search, the text to search for, and the other filters of the selected template. The template fills in a sample search value that you can replace or clear. The product variations template also requires product_id. |
| Return | Type | Description |
|---|---|---|
Response |
Array | One row per matching WooCommerce record, across every page, without a Flowgear object. No matches return zero rows. |
A Search Step with no filter fails with Search needs at least one filter., followed by the filters you can supply. Use List to read every record. To search the refunds of one order, use the refunds template with parent.
Create
Creates one record for each item.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | WooCommerce Connection to use. |
OperationId |
String | Operation selected by the template. |
Items |
Array | One record per item, with WooCommerce fields such as name, regular_price or billing. A product variation item also needs product_id, and an order note item needs order_id. |
| Return | Type | Description |
|---|---|---|
Response |
Array | One row per item: the created WooCommerce record plus a Flowgear object with IsSuccess, Message, and Request. |
Fields that WooCommerce requires to create a record, such as name for a product category, are marked Required. in the template.
Update
Updates the record that each item names. Fields left out of an item stay unchanged.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | WooCommerce Connection to use. |
OperationId |
String | Operation selected by the template. |
Items |
Array | One record per item, with its id, plus product_id for a product variation, and the fields to change. |
| Return | Type | Description |
|---|---|---|
Response |
Array | One row per item: the updated WooCommerce record plus a Flowgear object with IsSuccess, Message, and Request. A failed row keeps the record id. |
Delete
Permanently deletes the record that each item names.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | WooCommerce Connection to use. |
OperationId |
String | Operation selected by the template. |
Items |
Array | One item per record, with its id, plus product_id for a product variation or order_id for an order note. Other fields are ignored. |
| Return | Type | Description |
|---|---|---|
Response |
Array | One row per item: the record as it was before deletion plus a Flowgear object with IsSuccess, Message, and Request. |
Deleted records skip the WordPress trash and cannot be restored.
Usage Notes
- Each item carries its own IDs, so one Step can write to several products, variations or orders. IDs must be positive whole numbers. An invalid ID on the first item fails the Step, for example with
Items.id must be a positive integer ID.; on a later item it returns a failed row, and the other items still run. - A field mapped as
nullis ignored, so an unmapped template field never clears a value. To clear a text field, send an empty string. - Lists of text or whole numbers, such as
upsell_idsor theincludefilter, use comma-separated values, for example10,11orprocessing,on-hold. Quote a value that contains a comma, and inItemsan empty string is an empty list. Returned records show these lists in the same comma-separated form. Object lists, such ascategoriesorline_items, stay structured. - Use dates such as
2026-01-01T00:00:00for theafter,before,modified_afterandmodified_beforefilters. A start date without an end date filters from that date onwards. - An empty filter is ignored.
min_priceandmax_pricemust be decimal numbers such as10.00. Values WooCommerce rejects, such as an invalid date or status, return WooCommerce's error. - Customer templates return users with the
customerrole unless you setrole. Setroletoallto return every user. - The Node handles paging and sort order, so
page,per_page,orderbyandorderare not accepted inOptions. - For
Create,UpdateandDelete, make sure a later Step readsResponseso that every item is written. - Fields added by plugins are returned in
Responseand can be sent inItems, although templates show WooCommerce's own fields only. - Check
Flowgear.IsSuccesson every write row. When a later item fails, its row hasFlowgear.IsSuccessset tofalseandFlowgear.Messageset to WooCommerce's message and code, for exampleInvalid or duplicated SKU. (product_invalid_sku), and later items still run. - When the first item fails, the Step fails, but other items sent with it may already be saved. Check the store before you run the Workflow again.
- A rejected key or missing permission for a whole request, and network failures, fail the Step.
- Writes are not retried after a timeout or server error, because WooCommerce may have applied them. The affected rows say that the outcome is unknown, so check the record in WooCommerce before you send it again.
- When the store or its host throttles requests, the Node waits and retries. When the store asks for a wait longer than two minutes, the Step fails with
WooCommerce asked to wait more than two minutes before retrying. Run the Workflow again later.
Examples
Search products by SKU
Select the Search template Products, clear the sample search value and set sku in Options:
{
"sku": "FG-WIDGET-A"
}
Each row in Response is one matching product.
Add notes to several orders
Select the Create template Order note and supply one item per note, each naming its own order:
[
{
"order_id": 1021,
"note": "Packed and ready to ship."
},
{
"order_id": 1022,
"note": "Waiting for stock."
}
]
Check each row's Flowgear.IsSuccess.
Known Issues
- Stores with WordPress permalinks set to
Plainare not supported. - The key is sent with HTTP Basic authentication. OAuth 1.0a signing and passing the key in the query string are not supported, so a server or proxy that removes the
Authorizationheader must be configured to keep it. - Refunds are read only, because creating a refund returns money through the payment gateway. Product attributes, brands, shipping, taxes, settings, webhooks and reports are not available.
- WooCommerce validates grouped writes less strictly than single requests. For example, an unknown product
typecan be saved, and an order whoseline_itemsname a missingproduct_idis saved with that line at0.00. Check such values before you write them.