# Connect WooCommerce to Avox

> Connect your WooCommerce store to Avox with a read-only key to see orders and products inside Avox, turn on instant order updates, and know what Avox does when your store is slow or says no.

Source: https://docs.theavoxai.com/connections/apps/woocommerce

Connect your WooCommerce store and your team can see its latest orders and its products inside Avox,
next to the chats. With one extra step in WooCommerce, Avox also hears about new and changed orders
the moment they happen. This page covers everything from connecting to disconnecting, including what
Avox does when your store is slow, down or says no.

## What Avox can and cannot do with WooCommerce

Avox can:

- show your store's latest orders, newest first, with status, total, items and refunds;
- list your published products with price, stock and SKU, and search them by name;
- receive order updates from your store when you add Avox's address as a webhook.

Avox cannot:

- change anything in your store. The key you give Avox is read only, so you edit orders and products in
  WooCommerce ([AVX-3725](https://docs.theavoxai.com/error-codes/avx-3725));
- reach a store that is not on the public internet over `https://`;
- use WooCommerce inside an automation or a Flow step. Today the data appears on its own pages in Avox.

## What you need before you start

- A WordPress site with WooCommerce, at an `https://` address that anyone on the internet can reach. A
  local or private test site cannot connect, and Avox only accepts the standard port.
- A WordPress login that can create a WooCommerce key.
- A plan with room for another connected app, and the **Manage connected apps** permission in
  **Settings > Switchboard** (Admins have it; an Admin can give it to a Manager).

## Connect WooCommerce

**1. Create a read-only key in WooCommerce**

In WordPress open **WooCommerce**, then **Settings**, **Advanced**, **REST API**, and click **Add key**.
Pick a user, set **Permissions** to **Read** (that is enough), and generate it. Copy the **Consumer
key** (starts with `ck_`) and the **Consumer secret** (starts with `cs_`) before you leave the page.

**2. Open WooCommerce in Apps**

In Avox open **Apps** in the sidebar (under **Connect & Monitor**), then **WooCommerce**, click
**Connect**, read **What Avox can do** and click **Continue**.

**3. Paste your details**

Fill in **Store address** (like `https://shop.example.com`), **Consumer key** and **Consumer secret**.
**Webhook secret** is optional and can be added later. Click **Connect**.

**4. Avox checks the key**

Avox asks your store for one product to try the key before saving anything. The check gives up after 10
seconds. If it works you see **WooCommerce is connected**. The keys are stored encrypted and never
shown again.

A wrong address gives [AVX-3702](https://docs.theavoxai.com/error-codes/avx-3702), a key that doesn't start with `ck_` or `cs_`, or
that your store refuses, gives [AVX-3686](https://docs.theavoxai.com/error-codes/avx-3686). **Coming soon** does not apply here:
WooCommerce connects with your own keys, so it is ready as soon as you are.

### Turn on instant updates

Without this, Avox still shows your orders whenever you open the page. With it, new and changed orders
arrive by themselves.

1. On WooCommerce's **Overview** in Avox, under **Instant updates**, copy **Avox's address for WooCommerce**.
   It belongs to your Switchboard only, so keep it private.
2. In WordPress open **WooCommerce**, **Settings**, **Advanced**, **Webhooks** and add a webhook with the
   topic **Order updated** (add **Order created** too if you like), that address as the delivery URL
   and a secret of your own.
3. Back in Avox, click **Add** next to **Webhook secret** and paste the same secret.

Until the secret is saved, Avox shows [AVX-3709](https://docs.theavoxai.com/error-codes/avx-3709) and refuses the updates, because
it cannot check they came from your store. WooCommerce's first test message when you save the webhook is
answered normally.

## What you see in Avox afterwards

WooCommerce has its own menu under **Apps**: **Overview**, **Orders**, **Products** and **Activity**.

- **Overview**: status, store address, who connected it, when it last worked, the last problem with its
  code, **Test connection**, **Reconnect**, **Disconnect**, **Instant updates** and what uses WooCommerce.
- **Orders**: the newest 20, with **Load more**. Statuses: Pending (pending, on hold), Paid
  (processing), Fulfilled (completed), Refunded, Cancelled and Failed. Open an order for its items,
  payment method, refunds and the customer's name, email and phone, then **Open in WooCommerce**. Lists
  hide most personal details; an order's own page shows them to people who can see apps. Orders can't be
  searched here.
- **Products**: published products by name, searchable, with price and stock; open one for its SKU,
  regular and sale price.
- **Activity**: **Usage** (7, 30 or 90 days) and the **Log**, with **Calls** and **Webhooks** tabs.

Connection statuses are **Connected**, **Needs reconnecting** (your store refuses the key: click
**Reconnect** with a new one), **Having trouble** (several calls in a row failed) and **Disconnected**.

## Using WooCommerce in Avox

Example (hypothetical): a customer messages about an order. Your team opens **WooCommerce > Orders**,
opens the order and sees it is Paid and still processing, then tells the customer in the chat. Once your
webhook is on, an order marked completed in WooCommerce shows as Fulfilled in Avox without anyone
refreshing.

## Limits

- 120 calls a minute per Switchboard to WooCommerce ([AVX-3695](https://docs.theavoxai.com/error-codes/avx-3695) after that).
- Each call gives up after 10 seconds. Answers up to 2 MB are read.
- Lists load 20 at a time. Lists you just saw are reused for 30 seconds; **Refresh** reads again.
- Prices use your store's currency, which Avox reads from your store's settings. If it can't be read,
  the price may be left out.
- If your host blocks the usual sign-in header, Avox tries WooCommerce's other way of sending the key,
  over `https://`, by itself.

## When your store fails or says no

Your store runs on your own hosting, so slowness and security tools are the usual causes.

1. **Avox tries again when that is safe.** Every call to WooCommerce only reads, so on a network
   problem, or when your store answers busy or unavailable (HTTP 429, 502, 503 or 504), Avox tries up to
   two more times, after about 0.4 and then 1.2 seconds, and waits up to 5 seconds if your store says how
   long.
2. **The status changes only when it should.** If your store refuses the key (deleted, revoked or
   wrong), the status becomes **Needs reconnecting** at once ([AVX-3692](https://docs.theavoxai.com/error-codes/avx-3692); the log
   shows [AVX-3686](https://docs.theavoxai.com/error-codes/avx-3686)). If 5
   calls in a row fail on your store's side (not answering, busy or refusing the request:
   [AVX-3694](https://docs.theavoxai.com/error-codes/avx-3694), [AVX-3695](https://docs.theavoxai.com/error-codes/avx-3695), [AVX-3713](https://docs.theavoxai.com/error-codes/avx-3713)),
   it becomes **Having trouble**. One good call after that puts it back to **Connected** by itself. A wrong
   detail, like an address Avox may not call ([AVX-3702](https://docs.theavoxai.com/error-codes/avx-3702)) or an order that doesn't
   exist, does not count against its health.
3. **The call is logged**, with time, action, result, tries and the code. Secrets are removed and
   personal details masked.
4. **Your automations and Flows are not affected.** None of them use WooCommerce. If your Switchboard is
   paused, Avox does not call your store ([AVX-3711](https://docs.theavoxai.com/error-codes/avx-3711)).
5. **The pages show what Avox saved.** Orders your webhook has told Avox about are kept, so when your
   store cannot be read **Orders** shows them with [AVX-3717](https://docs.theavoxai.com/error-codes/avx-3717) and the reason's code.
   **Products** has nothing saved and shows only the notice. If your store refuses with a message, you
   see [AVX-3713](https://docs.theavoxai.com/error-codes/avx-3713) and the log has its words.

Updates that fail the check are counted under **Instant updates**; this never changes the status. Fix
the secret and the count starts over.

## Disconnect WooCommerce

Click **Disconnect** on the **Overview**. Avox lists what uses WooCommerce, deletes the keys it saved and
keeps the log for your retention period. Avox can't tell WooCommerce itself, so to be sure the key
can't be used again, revoke it under **WooCommerce > Settings > Advanced > REST API** and delete Avox's
webhook under **Webhooks**.

## Common questions

**Avox says the store address isn't valid**

The address must start with `https://`, be reachable from the internet, use the standard port, and
have no password in it ([AVX-3702](https://docs.theavoxai.com/error-codes/avx-3702)). A site on a private network can't be reached.

**Do I need a webhook?**

No. Orders and products always load when you open the pages. The webhook only makes new and changed
orders arrive without waiting.

**It shows Needs reconnecting**

Your store no longer accepts the key. Create a new read key and click **Reconnect**, then paste it. Leave
**Webhook secret** empty to keep the one saved.

**Why does an order I just placed not show?**

Avox reuses lists for 30 seconds. Click **Refresh**, or turn on instant updates.

## Related
