# WooCommerce

Let Lyna AI read and manage your WooCommerce store from the chat, with your store address and a pair of REST API keys.

Connect your store with its address and two keys, then ask for what you need in the chat. Nothing gets installed on your store.

## What it lets you do

Lyna AI can read:

- Products, variations and categories.
- Stock levels and stock status.
- Orders, refunds and coupons.
- Customers.

With a Read/Write key, it can also:

- Create and update products, variations and coupons, including prices and stock.
- Change the status of an order.
- Record a refund on an order.

| Item                         | Detail                                                                                                                                              |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| What it asks for             | Your store address, a consumer key and a consumer secret.                                                                                           |
| Who pays the provider        | Nobody: the REST API comes with WooCommerce.                                                                                                        |
| Do actions change real data? | Yes, with a Read/Write key. A Read key can only read.                                                                                               |
| Where it runs                | On Lyna's servers, which call your store over HTTPS.                                                                                                |
| Who uses it                  | Lyna AI while it builds, in Build mode. Your published app can use it too: [Use a connector in your app](/integrations/connectors/use-in-your-app). |

## What you need before you start

- A store on a public HTTPS address. A site that only runs on your computer or a private network cannot be reached.
- Permalinks set to anything other than **Plain**, in the WordPress admin under **Settings**, **Permalinks**.
- A WordPress user who can create keys: usually an administrator or a shop manager.
- Edit access to your Lyna project.

### Permissions in WooCommerce

Each pair of keys is tied to one WordPress user and carries one of three levels: **Read** retrieves data, **Write** creates and updates data, and **Read/Write** does both. Pick **Read** or **Read/Write**: Lyna's test reads one product, and a **Write** key cannot read.

| Task                                                | What you need                               |
| --------------------------------------------------- | ------------------------------------------- |
| List products, stock, orders, coupons and customers | **Read**                                    |
| Change a price, stock or a coupon                   | **Read/Write**                              |
| Change the status of an order                       | **Read/Write**                              |
| Record a refund                                     | **Read/Write**                              |
| Create a key or revoke one                          | The WordPress admin. Lyna AI cannot do this |

See [the WooCommerce REST API](https://woocommerce.com/document/woocommerce-rest-api/).

## Ways to connect

**On the connector's page.** A store address and two keys. Lyna stores them encrypted and never shows them again. Only the owner can change them.

**Who owns the account?** The person who saved the keys. Every call acts as the WordPress user tied to those keys, whoever typed the request.

**Who can use it?** Only you, in the projects you link it to, until you change it. On the connector's page, **Who can use it** also offers **Only this project** and **The whole workspace**. See [Who can use a connection](/integrations/connectors#who-can-use-a-connection).

## Set it up

### Get your keys

1. ### Open the key page

   In the WordPress admin, go to **WooCommerce**, **Settings**, **Advanced**, **REST API**, then choose **Add key**.
2. ### Describe the key

   Give it a name you will recognize, like "Lyna". Pick the WordPress user it acts as. Set **Permissions** to **Read** to only look at the store, or **Read/Write** to let Lyna AI make changes.
3. ### Generate it

   Choose **Generate API key**, then copy the consumer key and the consumer secret. The secret shows only once. If you lose it, revoke the key and make a new one.

### Connect it

1. ### Open the connector

   Open the **+** menu of the chat and choose **Connectors**. Find **WooCommerce** with the search field or under **Online stores**, then open its page.
2. ### Connect

   Choose **Connect**. The **New connection** page opens. Under **Configure connection**, fill in **Store URL**, **Consumer key** and **Consumer secret**. **Get value** opens the WooCommerce page that explains them. Choose **Connect** at the bottom of the page. Lyna saves the keys encrypted and never shows them again. **Sharing**, just above, sets who can use it.
3. ### Read the result

   Lyna tests the connection by listing one product from your store. **Connected** means the address and the keys work.

What each field expects:

| Field           | Format                                                                                                                                            | Secret? |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| Store URL       | The HTTPS address of your store, like `https://example.com`, as your browser shows it on the home page. Add the folder if WordPress lives in one. | No      |
| Consumer key    | Starts with `ck_`. Copy it from **WooCommerce**, **Settings**, **Advanced**, **REST API** when you generate the key.                              | Yes     |
| Consumer secret | Starts with `cs_`. Same page, shown once.                                                                                                         | Yes     |

> [!WARNING]
>
> **What never to share**
>
> The consumer key and the consumer secret open your store. Never share them, commit them or paste them in the chat: the connector's form is the only place for them. **Get value** on the form opens the WooCommerce page that explains them.

### Check it works

After you choose **Connect**, Lyna lists one product from your store and shows the result. Run it again at any time with **Test connection**. **Connected** proves that the address and the keys work. A pass does not prove every action will work: a **Read** key cannot change anything.

To check for real, ask for something you know exists:

- "List three products from my store."

## What to ask Lyna AI

Type these in the chat, in Build mode, and adjust the names to yours. Once it is connected, **Use WooCommerce** on its page starts a message for you.

| What you build or do           | What to type                                                                              | What happens                                                             |
| ------------------------------ | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| Check your stock               | "List my products that are out of stock."                                                 | Lyna AI reads your products and lists them.                              |
| Follow orders                  | "Show the orders still on hold from this week, with their totals."                        | It reads the orders and adds up the totals.                              |
| Run a sale                     | "Put the Blue Mug on sale at 12.50 until the end of the month, then show me the product." | After your approval, the price changes on your store.                    |
| Launch a coupon                | "Create a 10 percent coupon called SUMMER that ends on August 31."                        | After your approval, shoppers can use it.                                |
| Build a page from your catalog | "Build a best sellers page from my Mugs category."                                        | It reads your products and builds the page in your project.              |
| Move an order along            | "Mark order 1042 as completed."                                                           | After your approval, the status changes. Your customer may get an email. |
| Record a refund                | "Record a 10 euro refund on order 1042, with no money sent back."                         | After your approval, the refund is recorded on the order.                |

### Approvals and tool switches

Before a call, Lyna AI shows the tool and what it asks. You choose **Deny**, **Allow once**, **Always allow this tool** or **Always allow this connector**. A tool its server marks as read-only does not ask. A changed or new tool asks again, and **Ask again** on the connector's page takes a choice back.

Under **What Lyna AI can use**, each tool has a switch. Lyna AI stops using a tool you turn off, in your chats in this project.

### Stay safe

What a connector answers reaches the AI as data, never as instructions. Read each approval before you accept it.

- Start with a **Read** key. Make a **Read/Write** key when you want Lyna AI to change things.
- A key can do what its WordPress user can do, so tie it to a user with the role it needs and no more.
- Never put a key in code or in a chat message. Paste it in the connector form only.
- Changing an order's status can send your customer an email, as it does when you change it yourself.
- Revoke a key you have stopped using, in **WooCommerce**, **Settings**, **Advanced**, **REST API**.

> [!WARNING]
>
> **Actions are real**
>
> This connector works on your live store. Read each approval before you accept it, above all for prices, order statuses and refunds.

## Limits

A refund only records the refund unless you ask for more. Sending the money back through your payment gateway happens only when the request says so, and you see that in the approval.

Lyna AI cannot:

- Create, change or revoke API keys.
- Change your store's settings.
- Delete products, orders, customers, coupons or anything else.
- Edit customer details.
- Install or update extensions.

Connector tools run in Build mode. Plan and Ask do not run them.

## Troubleshooting

| What you see                                        | What it means and what to do                                                                                                                                                                                                                                                                    |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Needs a key**                                     | A value is missing. Choose **Connect** and paste it.                                                                                                                                                                                                                                            |
| **Not tested yet**                                  | No test has answered. Choose **Test connection**.                                                                                                                                                                                                                                               |
| **Connection failed**                               | The page says why next to it. If the server did not answer, choose **Test connection**.                                                                                                                                                                                                         |
| A call fails with a permission error                | **Connected** does not prove access to every piece of data. WooCommerce refused the call with the rights of the account you connected. Check Permissions in WooCommerce above, then try again.                                                                                                  |
| **New tools to review**                             | The server changed its list of tools, so Lyna stops using it until you decide. Read the list, then choose **Approve new tools**.                                                                                                                                                                |
| **Turned off**                                      | Lyna AI does not use it. Choose **Turn on**.                                                                                                                                                                                                                                                    |
| The person who connected it left the workspace      | The connection holds no key or sign-in. Choose **Connect** to use it again.                                                                                                                                                                                                                     |
| The store address must start with https\://         | Enter the full address, with `https://`. The store needs a security certificate, because keys are only sent over a secure connection.                                                                                                                                                           |
| The store address is not a public web address       | The address points to a private network or to your own computer. Enter the address your visitors use, on the standard web port.                                                                                                                                                                 |
| The store refused these keys                        | Check both keys for missing characters, and that the key was not revoked. A write also needs the **Read/Write** permission. A firewall or a security extension on the store can answer the same way, and some hosts drop the header that carries the keys: ask your host if the keys are right. |
| The store's REST API did not answer at this address | Set permalinks to anything other than **Plain**, check that WooCommerce is active, and add the folder to the address if WordPress lives in one.                                                                                                                                                 |
| The store address redirects to another site         | Enter the final address, the one the browser shows once the page has loaded.                                                                                                                                                                                                                    |
| The store could not be reached                      | Check the address and that the site is online.                                                                                                                                                                                                                                                  |
| The store did not answer in time                    | The site is busy or slow. Try again in a moment.                                                                                                                                                                                                                                                |
| The store answered with a server error              | Look at the store's logs, then try again.                                                                                                                                                                                                                                                       |

### Disconnect

**Turn off** stops Lyna AI from using the connector and keeps your values. **Remove from this project**, under **More options**, takes it out of this project only, and shows when another project uses it. **Delete connection**, in the same menu, removes it from every project, with what it stored, and says first how many projects lose it. Then revoke the key in WooCommerce: until you do, it keeps working on your store.

## Related

- [Connectors](/integrations/connectors): What connectors are and how the chat uses them.
- [Integrations](/integrations): Connect Lyna to the tools you use.
- [MCP servers](/features/ai/mcp-servers): Manage your servers and add your own.
- [Chat modes](/features/ai/chat-modes): Build, Plan and Ask.
