# Connect WooCommerce

> Connect a WooCommerce store to COD Order Calls with a REST API key - store URL, consumer key and secret, the status to set after confirmation, automatic webhooks, and what is written back to each order.

Source: https://edesy.in/docs/order-calls/connect-your-store/connect-woocommerce

Connect WooCommerce with a REST API key; there is no plugin to install. In WordPress, add a WooCommerce REST API key with Read/Write permission, paste the consumer key and secret into Order Calls at [orders.edesy.in](https://orders.edesy.in) with your store URL, press **Test connection**, then **Register webhooks automatically**. Confirmations update the order's status and metadata, and every call adds an order note.

## Step 1: Create a REST API key

1. In WordPress admin, open **WooCommerce → Settings → Advanced → REST API**.
2. Press **Add key**, choose a user with access to orders, and set **Permissions** to **Read/Write**.
3. Copy the **Consumer key** (`ck_...`) and **Consumer secret** (`cs_...`). WooCommerce shows the secret once.

## Step 2: Add the store in Order Calls

In **Stores**, pick **WooCommerce** and fill in:

| Field | Required | What to enter |
|---|---|---|
| Store URL | Yes | Your site address with `https`, without `/wp-admin`, for example `https://shop.example.com` |
| Store name (spoken in the call) | No | The name customers hear |
| Consumer key | Yes | `ck_...` |
| Consumer secret | Yes | `cs_...` |
| Order status after confirmation | No | Leave empty to keep the status and only add a note. Use `processing` if you hold COD orders `on-hold` until confirmed |
| Webhook secret | Yes | Generated for you; used when we register the webhooks |

## Step 3: Test and register webhooks

1. Press **Test connection**. It confirms we can reach the WooCommerce REST API (`/wp-json/wc/v3`).
2. Press **Register webhooks automatically**. We create two webhooks on your store: **Order created** and **Order updated**, both pointing to your store's webhook URL in Order Calls.

Prefer to add them yourself? In **WooCommerce → Settings → Advanced → Webhooks**, add "Order created" and "Order updated" with the webhook URL and webhook secret shown in Order Calls.

If your site is behind Cloudflare or a security plugin, allow requests from our servers to `/wp-json/wc/v3`, or tests and updates will fail.

## Which orders get a call

`Order created` can start a call; your [call rule](https://edesy.in/docs/order-calls/call-rules/conditions) decides which orders match (by default, cash-on-delivery orders). An `Order updated` event whose status is `cancelled` stops any pending call for that order. The phone number is read from the billing address, then the shipping address.

## What is written back to the order

| Result | What happens on WooCommerce |
|---|---|
| Customer presses 1 | Status moves to your "status after confirmation" (if set); meta `_edesy_cod_confirmation` = `confirmed` |
| Customer presses 2 | Status set to `cancelled`; meta `_edesy_cod_confirmation` = `cancelled` |
| Calls on the order | Noted on the order as private notes (not sent to the customer) |
| No answer or unreachable | Recorded in `_edesy_cod_confirmation` using the call rule's labels (default outcome actions) |

WooCommerce has no order tags, so the result is stored as order meta and notes. The default labels read "COD confirmed by call", "COD confirmation: customer unreachable" and "COD confirmation: no answer on the call"; you can change them in the call rule. See [Outcome Actions](https://edesy.in/docs/order-calls/call-rules/outcome-actions).

## Next steps

- [Set up a call rule](https://edesy.in/docs/order-calls/call-rules/conditions)
- [Timing and retries](https://edesy.in/docs/order-calls/call-rules/timing-and-retries)
- [Pricing](https://edesy.in/docs/order-calls/getting-started/pricing): Rs 3 per confirmed order, 25 orders free
- Product page: [WooCommerce COD confirmation calls](https://edesy.in/cod-order-confirmation/woocommerce)
