> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/woocommerce.md).

# WooCommerce

Connect WooCommerce to create products and coupons and manage orders.

## Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector   | Authentication   |
| ----------- | ---------------- |
| WooCommerce | API key or token |

### WooCommerce

Connect a WooCommerce store with a read\_write REST API key.

#### Set up in WooCommerce

1. Prepare the WooCommerce account or service that the workflow will access. Grant access to the required resources and operations.
2. **Consumer Key:** Create a read\_write REST API key in WooCommerce settings.

#### Set up in StackAI

1. Open **Settings → Connections**, add a connection, and select **WooCommerce**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field   | Required | What to enter                                                                                                                                               |
| --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Store URL       | Yes      | Your store's public HTTPS URL. A pasted '/wp-json/wc/v3' suffix is accepted and removed automatically. The integration requires a read\_write REST API key. |
| Consumer Key    | Yes      | Create a read\_write REST API key in WooCommerce settings.                                                                                                  |
| Consumer Secret | Yes      | The secret paired with your WooCommerce consumer key.                                                                                                       |

### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

## Use an action

1. Add the required **WooCommerce** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

## Actions

### Create coupon

Create a WooCommerce discount coupon for a retention or promotion campaign.

#### Inputs

| Field                | Type            | Required | Description                                                                                                                            |
| -------------------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Coupon code          | string          | Yes      | Code customers enter at checkout.                                                                                                      |
| Discount amount      | number          | Yes      | Percentage or fixed amount discounted, based on the selected type.                                                                     |
| Discount type        | select (string) | No       | How WooCommerce applies the discount. Available values: Percentage, Fixed cart discount, Fixed product discount. Default: fixed\_cart. |
| Internal description | textarea        | No       | Merchant-facing reason or campaign context for this coupon.                                                                            |
| Expiry date          | date            | No       | Last date customers may use the coupon.                                                                                                |
| Individual use only  | boolean         | No       | Prevent combining this coupon with other coupons. Default: false.                                                                      |
| Show advanced fields | boolean         | No       | Show optional coupon restrictions and usage limits. Default: false.                                                                    |
| Total usage limit    | integer         | No       | Maximum number of times this coupon may be redeemed.                                                                                   |
| Allow free shipping  | boolean         | No       | Let the coupon grant free shipping when the store supports it. Default: false.                                                         |
| Exclude sale items   | boolean         | No       | Prevent the coupon from discounting products already on sale. Default: false.                                                          |
| Minimum spend        | number          | No       | Minimum cart subtotal required to use the coupon.                                                                                      |
| Maximum spend        | number          | No       | Maximum cart subtotal allowed for the coupon.                                                                                          |
| Product IDs          | string          | No       | Limit the coupon to specific products.                                                                                                 |

#### Outputs

| Field          | Type   | Description                                |
| -------------- | ------ | ------------------------------------------ |
| Created coupon | object | WooCommerce coupon created by this action. |

### Create product

Create a WooCommerce catalog product from product copy and pricing details.

#### Inputs

| Field                | Type            | Required | Description                                                                                                               |
| -------------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
| Product name         | string          | Yes      | Name customers will see for the product.                                                                                  |
| Product type         | select (string) | No       | WooCommerce catalog type for the product. Available values: Simple, Grouped, External, Variable. Default: simple.         |
| Publication status   | select (string) | No       | Whether the product is saved for review or published. Available values: Draft, Pending, Private, Publish. Default: draft. |
| Regular price        | number          | No       | Normal selling price in the store currency.                                                                               |
| Show advanced fields | boolean         | No       | Show optional sale pricing, categories, and product images. Default: false.                                               |
| Sale price           | number          | No       | Discounted selling price, when the product is on sale.                                                                    |
| Description          | textarea        | No       | Full product description shown on the product page.                                                                       |
| Short description    | textarea        | No       | Brief summary shown near the product price.                                                                               |
| SKU                  | string          | No       | Unique merchant stock code for this product.                                                                              |
| Category IDs         | string          | No       | Product categories to assign.                                                                                             |
| Image URLs           | string          | No       | Public images WooCommerce should add to the product gallery.                                                              |

#### Outputs

| Field           | Type   | Description                                 |
| --------------- | ------ | ------------------------------------------- |
| Created product | object | WooCommerce product created by this action. |

### List orders

Find WooCommerce orders for sales monitoring and fulfillment workflows.

#### Inputs

| Field           | Type            | Required | Description                                                                                                                                           |
| --------------- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| Order status    | string          | No       | Only return orders in this status. Available values: Any status, Pending payment, Processing, On hold, Completed, Cancelled, Refunded, Failed, Trash. |
| Created after   | datetime        | No       | Only return orders created at or after this time.                                                                                                     |
| Created before  | datetime        | No       | Only return orders created before this time.                                                                                                          |
| Customer ID     | integer         | No       | Only return orders for this WooCommerce customer.                                                                                                     |
| Product ID      | integer         | No       | Only return orders containing this product.                                                                                                           |
| Search          | string          | No       | Search matching order details.                                                                                                                        |
| Sort direction  | select (string) | No       | Return oldest or newest matching orders first. Available values: Newest first, Oldest first. Default: desc.                                           |
| Sort by         | select (string) | No       | Order field used to sort the results. Available values: Date, ID, Title, Slug, Last modified. Default: date.                                          |
| Offset          | integer         | No       | Continue after orders returned by a previous call. Default: 0.                                                                                        |
| Maximum results | integer         | No       | Maximum number of orders to return. Default: 100.                                                                                                     |

#### Outputs

| Field        | Type          | Description                                    |
| ------------ | ------------- | ---------------------------------------------- |
| Orders       | object\_array | Matching WooCommerce orders.                   |
| Next offset  | integer       | Offset for the next batch of orders.           |
| Total orders | integer       | Total matching orders reported by WooCommerce. |
| Total pages  | integer       | Total matching pages reported by WooCommerce.  |

### Update order status

Move a WooCommerce order to the next fulfillment or payment state.

#### Inputs

| Field      | Type            | Required | Description                                                                                                                             |
| ---------- | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Order ID   | integer         | Yes      | WooCommerce order to update.                                                                                                            |
| New status | select (string) | Yes      | Status the order should move to. Available values: Pending payment, Processing, On hold, Completed, Cancelled, Refunded, Failed, Trash. |

#### Outputs

| Field         | Type   | Description                                 |
| ------------- | ------ | ------------------------------------------- |
| Updated order | object | WooCommerce order after its status changes. |

### Update product inventory

Set the managed stock quantity and availability for a WooCommerce product.

#### Inputs

| Field          | Type            | Required | Description                                                                                                                       |
| -------------- | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| Product ID     | integer         | Yes      | WooCommerce parent product whose inventory should change.                                                                         |
| Stock quantity | integer         | Yes      | Exact number of units currently in stock.                                                                                         |
| Stock status   | select (string) | No       | Availability label WooCommerce should show. Available values: In stock, Out of stock, On backorder.                               |
| Backorders     | select (string) | No       | Whether customers may order when stock runs out. Available values: Do not allow, Allow, with customer notice, Allow. Default: no. |

#### Outputs

| Field           | Type   | Description                                      |
| --------------- | ------ | ------------------------------------------------ |
| Updated product | object | WooCommerce product after its inventory changes. |

## Triggers

A trigger starts a workflow when its configured event occurs. Configure the event and filters before enabling the trigger.

### On Order Created

Trigger a workflow when WooCommerce creates an order.

#### Event inputs

| Field | Type   | Required | Description                             |
| ----- | ------ | -------- | --------------------------------------- |
| Order | object | Yes      | The WooCommerce order that was created. |

#### Outputs

| Field | Type   | Description                             |
| ----- | ------ | --------------------------------------- |
| Order | object | The WooCommerce order that was created. |

## Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/woocommerce.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
