> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tranthor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WooCommerce

> Connect your WooCommerce store to bring customers, orders and products into Tranthor.

Connecting a WooCommerce store brings its customers, orders and products into Tranthor and keeps them up to date. There is nothing to install: you approve Tranthor once in your WordPress admin.

## Before you start

* Your store is served over **HTTPS**.
* WooCommerce is **3.5 or later**. With **5.8 or later**, Tranthor can also fetch updates it missed while your store was unreachable.
* **Pretty permalinks** are on (WordPress **Settings**, **Permalinks**), so the WordPress REST API answers at `/wp-json/`.
* You are an **organization owner or admin** in Tranthor, and can approve apps in your WordPress admin.

## Connect a store

1. In Tranthor, go to **Settings**, **Integrations**. Under **Store data**, select **Connect** on the WooCommerce card.
2. Enter your **Store address**, for example `https://shop.example.com`, and select **Check store**.
3. Tranthor checks the store. When every check passes, select **Connect WooCommerce**.
4. Your WordPress admin opens. Approve Tranthor, and you come straight back.

Tranthor asks for read and write access. WooCommerce creates the keys itself and hands them to Tranthor, so there is no key to copy. Tranthor stores them encrypted.

To connect more than one store, add each one from the same card after the first. A store can be connected to one Tranthor workspace only.

### If a check fails

| Check | What to do |
| - | - |
| **Served over HTTPS** | Enter the store's `https://` address. WooCommerce only hands API keys to a secure connection. |
| **WordPress REST API reachable** | Turn on pretty permalinks in **Settings**, **Permalinks**. If the store redirects to another address, enter that address instead. |
| **WooCommerce installed** | Activate WooCommerce, or update it to 3.5 or later. |
| **Read and write access can be approved** | A security plugin, firewall or CDN is blocking WooCommerce's approval screen (`/wc-auth/v1/authorize`). Allow it. |
| **REST API accepts DELETE** | Your host or a security plugin blocks `DELETE` requests to the REST API. Tranthor needs them to replace its webhooks. |

A store that cannot pass these checks cannot be connected yet.

## Import your history

After you approve, Tranthor imports the store's history: customers, then products, then orders with their refunds. The most recent 90 days come first, then everything older.

* Imported events never start journeys, so nobody gets a welcome or an order message for something that happened last year.
* Journeys that people enter through a segment are paused while the import runs, and the page lists them. People already in them resume when the import finishes. A large store can take hours.
* If the store has more registered customers than your plan has contacts left, Tranthor asks first. You can **Upgrade plan**, **Import the most recent customers** that fit, or **Import all**.

The card shows progress, and the totals when it is done.

## What Tranthor receives

After the import, the store sends changes to Tranthor as they happen: new and changed orders, products and customers.

### Events

| Event | When |
| - | - |
| `Order Placed` | A customer places an order. |
| `Ordered Product` | Once for each line item of a placed order. |
| `Order Updated` | An order changes. |
| `Order Paid` | WooCommerce records the order as paid. A cash on delivery order counts as paid once it is completed. |
| `Order Fulfilled` | The order is fulfilled. |
| `Order Cancelled` | The order is cancelled. |
| `Order Refunded` | The order is refunded. |
| `TRANSACTION` | Once for each paid order, and once, negative, for each refund. This is what revenue is counted from. |

Order events carry the order's id and number, status, currency, total, discount, shipping and tax totals, coupons, line items and payment method. `Ordered Product` also carries the product's id, name, SKU, categories, quantity and price.

### Customer properties

`email`, `phone` (the billing phone), `firstName`, `lastName` and `address` (billing and shipping).

### Not included

Carts, checkouts and product views do not come from this connection. Send those from your storefront with the [Web SDK](https://docs.tranthor.com/integrations/sdks/web.md) or the [CLI Wizard](https://docs.tranthor.com/integrations/sdks/wizard.md).

## How customers are matched

Tranthor matches a WooCommerce customer to a person it already knows by email. A guest order with an email is matched the same way. A customer with no match becomes a new person.

If you keep your own customer id in WooCommerce, enter the customer meta key that holds it under **Customers**, **Brand ID customer field**, for example `crm_id`. Tranthor then uses that id as the person's id. It applies to new customers, and keys that start with `_` are not supported.

## Marketing consent

Under **Customers**, **Marketing email consent** decides whether new shoppers are subscribed to marketing email:

* **Not subscribed until they opt in** (the default). Nobody from the store is subscribed until they opt in some other way.
* **Read consent from a customer field.** Enter the customer meta key your store saves consent in, for example `newsletter`, and the values that mean subscribed (by default `yes`, `true`, `1`, `subscribed`).

A store value that says no unsubscribes the person from marketing email. A store value that says yes never re-subscribes someone Tranthor already knew as unsubscribed. Order and account emails are not affected.

## Status and health

The WooCommerce card shows each store with its status (**Connected**, **Finishing setup**, **Needs attention** or **Disconnected**), when it last synced and its health.

| Health | Meaning | What to do |
| - | - | - |
| **Receiving updates** | Everything is working. | Nothing. |
| **Keys revoked** | WooCommerce no longer accepts Tranthor's keys. | Select **Reconnect** and approve again. |
| **Store unreachable** | Tranthor could not reach the store for two hourly checks in a row. | Check that the site is online. |
| **Updates stopped** | The store's webhooks for Tranthor are disabled and could not be recreated. | Nothing at first. Tranthor keeps trying, and fetches anything missed once they are back. |

Tranthor checks every hour and recreates a webhook that is missing or disabled. Once a day it compares the orders your store changed with the ones it received, and fetches any it missed. Problems also show in **Needs you**.

## Disconnect a store

Select **Disconnect** on the store. Your data stays in Tranthor. Any running import stops, and new orders and customers stop arriving until you reconnect.

Afterwards, revoke Tranthor's key in your WordPress admin under **WooCommerce**, **Settings**, **Advanced**, **REST API**.

If you reconnect within 7 days, Tranthor fetches what changed while the store was disconnected. After longer, it imports the history again.

### Delete a store's data

After disconnecting, **Delete store data** removes every event from that store, and the people who came only from that store, with their messages. People who also came from somewhere else keep their profile and their other data. You type the store's address to confirm. It cannot be undone.

## Current limits

* Carts, checkouts and product views are not synced.
* Deleting a customer account in WooCommerce does not delete the person in Tranthor. Delete them in Tranthor, from the [customer's profile](https://docs.tranthor.com/resources/customers.md#delete-a-customer).
* WooCommerce's coupons are not synced.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.