# WooCommerce

Connect your WooCommerce store so the assistant checks order status by phone, places orders with a payment link and answers from your catalog

> Full REST + WebSocket API reference: https://api.happ.tools/reference

WooCommerce connects with a key that your store issues to HAPP after you approve it on your own site. Once it's linked, the assistant finds a buyer's recent orders by phone number, places new orders with a payment link, and answers product questions from your catalog — including "do you have this?" with a photo.

## What the assistant can do [#what-the-assistant-can-do]

* **Order status by phone** — finds the buyer's orders by the phone used at checkout and tells them the order number, status, items, total and the tracking number when your store records one.
* **Place an order** — creates an order in WooCommerce with status **Pending payment**, the chosen products and options (size, colour), the buyer's name, phone and delivery address, and sends the buyer the payment link of that order.
* **Catalog answers** — knows your published products with prices, variations and stock status, and finds a product from a photo the buyer sends.

## Before you start [#before-you-start]

* **WooCommerce store** on WordPress, served over **HTTPS**.
* **WordPress administrator account** — you approve the access while logged in.
* **HAPP workspace** with at least one assistant configured to talk to customers.
* **WooCommerce enabled for your workspace** — the integration is switched on per company. Ask HAPP support to enable it.

No plugin needs to be installed.

## Connect [#connect]

1. Log in to your WordPress admin in the same browser.
2. In HAPP open **Integrations** and find WooCommerce under **Add a CRM**.
3. Click **Connect** and enter your store address — `your-store.com` or the link from wp-admin both work.
4. Your store opens the screen "HAPP would like to connect to your store" with **Read/Write** access. Click **Approve**.
5. You land back on **Integrations** with WooCommerce under **My integrations**.

The key HAPP receives can read products, customers and orders and create orders. You can see and revoke it in **WooCommerce > Settings > Advanced > REST API**.

## Settings [#settings]

Open the card's gear icon on the assistant's **Integrations** tab and switch on what the assistant may do.

* **Search** — order status by the buyer's phone.
* **Create** — orders awaiting payment with a payment link.
* **Catalog** — product search by text and by photo. The first sync takes a few minutes; after that the catalog refreshes every 6 hours. Only published products are synced, up to 5,000.

## Limits [#limits]

* Orders are created as **Pending payment**; WooCommerce moves them on when the buyer pays.
* The phone search accepts the usual formats (`050 111 22 33`, `+380501112233`, `0501112233`). If nothing matches, the assistant checks your last 100 orders.
* A tracking number shows only if your store keeps it with a plugin — WooCommerce Shipment Tracking or a carrier plugin that stores the waybill (TTN).

## Troubleshooting [#troubleshooting]

| Problem                                                  | Cause                                                                      | Fix                                                                  |
| -------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------- |
| "Enter the store address as https\://…"                  | The address is not HTTPS or not a public site                              | Use the `https://` address of your store.                            |
| "The store address redirects to …"                       | You entered an address that forwards elsewhere (for example without `www`) | Connect with the address from the message.                           |
| "Access was not granted on the store"                    | **Deny** was clicked on the approval screen                                | Click **Connect** again and choose **Approve**.                      |
| "The store did not send the key to Happ"                 | Your site could not reach HAPP (firewall or security plugin)               | Allow outgoing requests to `api.happ.tools` and try again.           |
| "The store refused access — reconnect WooCommerce" (401) | The key was revoked or deleted in WooCommerce                              | Open **Integrations** > **WooCommerce** and click **Connect** again. |
| A product is missing from the catalog                    | The product is a draft, private or out of the 5,000 limit                  | Publish it; it appears after the next sync.                          |

## Disconnect [#disconnect]

Disconnect the card in HAPP, or revoke the HAPP key in **WooCommerce > Settings > Advanced > REST API**. Orders already in your store stay untouched.

## Next [#next]

* [CRM](/docs/integrations/crm) — all CRM integrations
* [Tools](/docs/agents/tools) — what the assistant calls during conversations
* [Integrations](/docs/integrations) — the full catalog
