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

# Connect your app to WooCommerce

> Connect your app to WooCommerce, an ecommerce plugin for WordPress, to read and manage store products, orders, customers, coupons, and reports.

export const connector_0 = "WooCommerce"

[WooCommerce](https://woocommerce.com/) is an open-source ecommerce plugin for WordPress that lets you run an online store on infrastructure you control. The WooCommerce connector lets your Lovable app read and manage store data through the WooCommerce REST API. It's designed for storefront dashboards, internal operations tools, product management apps, and customer service workflows backed by your WooCommerce store.

With WooCommerce, your app can:

* List and manage products, variations, categories, and inventory
* Read and update orders, refunds, coupons, and customer records
* Build dashboards around revenue, fulfillment, products, and customers
* Create internal storefront admin tools powered by WooCommerce REST APIs
* Automate store workflows that use your WooCommerce data

The WooCommerce connector uses a REST API consumer key and secret from your WooCommerce store. It's a good fit when your store runs on WooCommerce and your Lovable app needs secure server-side access to store operations.

## Common use cases and example apps

| Example app                    | Example prompt                                                                                                           | Description                                                                                                                                                                               |
| :----------------------------- | :----------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Store operations dashboard** | *Use WooCommerce and build a dashboard that shows today's orders, revenue, low-stock products, and fulfillment status.*  | **Give operators one place to monitor store health.**<br />The app reads orders, products, and reports so the team can track daily performance and act on issues.                         |
| **Inventory management app**   | *Use WooCommerce and build an inventory app that lists products, filters by stock status, and updates stock quantities.* | **Keep product inventory current from a custom interface.**<br />The app fetches products and variations, highlights low-stock items, and updates inventory through WooCommerce.          |
| **Customer service console**   | *Use WooCommerce and build a support console where agents can search customers, view orders, and issue refunds.*         | **Help support teams answer store questions faster.**<br />The app searches customer and order records, shows purchase history, and uses permitted WooCommerce actions for order support. |
| **Coupon campaign manager**    | *Use WooCommerce and build a coupon manager for creating, listing, and tracking discount codes.*                         | **Manage promotions without opening WordPress admin.**<br />The app reads and updates coupons, shows active campaigns, and helps operators review usage.                                  |
| **Product catalog editor**     | *Use WooCommerce and build a product catalog editor for updating product descriptions, prices, categories, and images.*  | **Let teams manage catalog details from a tailored workflow.**<br />The app reads products and sends updates through WooCommerce based on the permissions on your API key.                |
| **Fulfillment tracker**        | *Use WooCommerce and build a fulfillment tracker that groups open orders by status and flags delayed shipments.*         | **Turn order data into a fulfillment queue.**<br />The app reads order status, groups work by priority, and gives staff a focused view of orders that need attention.                     |
| **Sales reporting app**        | *Use WooCommerce and build a sales report that compares products, customers, and coupon performance over time.*          | **Create store analytics from WooCommerce data.**<br />The app reads reports, orders, and coupons to show trends and exportable summaries.                                                |

## How to connect WooCommerce

Workspace **admins** and **owners** can connect WooCommerce.

You can create multiple WooCommerce connections using different REST API keys, which is useful for separating environments (for example, development and production), connecting multiple stores, or using keys with different permissions.

When the connection is created, WooCommerce becomes available across all projects in the workspace. Anyone building in a project can ask Lovable in chat to link their project to it.

### Prerequisites

Before connecting WooCommerce, make sure you have:

* A WooCommerce store with HTTPS enabled
* A WordPress admin account that can manage WooCommerce settings
* Non-plain WordPress permalinks enabled for REST API routes
* A WooCommerce REST API consumer key and consumer secret
* Lovable workspace **owner** or **admin** role

<Note>
  All API requests made through this connector run against your WooCommerce store. Hosting, plugin, and WooCommerce-related costs are handled outside Lovable.
</Note>

### Step 1: Get a WooCommerce REST API key

A WooCommerce REST API key lets your Lovable app authenticate with your store. The key permissions you choose in WooCommerce control what the connection can do.

To create a WooCommerce REST API key:

<Steps>
  <Step title="Open your WooCommerce settings">
    Sign in to your WordPress admin dashboard for the store you want to connect.
  </Step>

  <Step title="Open REST API keys">
    Go to **WooCommerce → Settings → Advanced → REST API**.
  </Step>

  <Step title="Add a key">
    Click **Add key**. Enter a description, for example `Lovable integration`, and choose the WordPress user the key belongs to.
  </Step>

  <Step title="Choose permissions">
    Choose the permissions your app needs:

    * **Read**: use this for dashboards, reports, search, and other read-only apps.
    * **Read/Write**: use this when your app needs to create or update products, orders, coupons, customers, refunds, or inventory.
  </Step>

  <Step title="Generate and copy the credentials">
    Click **Generate API key**, then copy the **Consumer key** and **Consumer secret**. WooCommerce only shows the consumer secret once.
  </Step>
</Steps>

<Warning>
  Your consumer key and consumer secret function like a password. Keep them secure and never share them publicly. You'll need them in the next step.
</Warning>

See WooCommerce documentation for detailed instructions: [WooCommerce REST API key setup](https://woocommerce.com/document/woocommerce-rest-api/).

### Step 2: Connect WooCommerce to Lovable

You can create multiple connections using different WooCommerce REST API keys.

<Steps>
  <Step title="Open WooCommerce in Connectors">
    Go to **Connectors → App connectors** and select **WooCommerce**.
  </Step>

  <Step title="Add a connection">
    Click **Add connection**.
  </Step>

  <Step title="Configure the connection">
    * **Display name**: name the connection, for example `WooCommerce Prod`.
    * **Store URL**: enter the HTTPS URL of your WooCommerce store, for example `https://store.example.com`.
    * **Consumer key**: paste the WooCommerce REST API consumer key. It starts with `ck_`.
    * **Consumer secret**: paste the WooCommerce REST API consumer secret. It starts with `cs_`.
  </Step>

  <Step title="Choose who can access this connection">
    Under **Who can access this connection**, decide who in your workspace can use the connection:

    * **Only you** (default): only the person creating the connection can use it and its associated data.
    * **Invite specific people**: only you and explicitly added workspace members can use the connection and its associated data.
    * **Invite entire workspace**: click **Invite entire workspace** to make the connection available to everyone in your Lovable workspace.

    See [Connection-level access](/integrations/introduction#connection-level-access) for more information.
  </Step>

  <Step title="Connect">
    Click **Connect**.
  </Step>
</Steps>

When connected, anyone building in a project can ask Lovable in chat to link their project to WooCommerce (based on configured connection-level access). Your Lovable apps can then read and manage WooCommerce data based on the REST API key permissions.

## Working with WooCommerce REST API permissions

WooCommerce controls access through the permissions on the REST API key you create. If your app only needs dashboards, reports, product lists, or customer lookup, use a **Read** key. If your app needs to create or update store data, use a **Read/Write** key.

The connector verifies credentials by listing products from your store. If verification fails with a route error, check that WooCommerce REST API routes work on your store and that WordPress permalinks are not set to **Plain**.

## Limitations

The WooCommerce connector cannot:

* Create WooCommerce REST API keys or change their permissions for you. Configure keys in WordPress admin first.
* Bypass the permissions on the connected REST API key.
* Configure WordPress permalinks, hosting, SSL, plugins, or WooCommerce settings.
* Call general WordPress APIs or WooCommerce endpoints outside the connected store's `/wp-json/wc/v3` REST API path.
* Refresh or rotate consumer keys automatically. To rotate credentials, generate a new key in WooCommerce and update the Lovable connection.
* Support per-end-user WooCommerce login. Each connection represents a single WooCommerce store account shared across all projects linked to it.

## How to unlink projects from a {connector_0} connection

Editors and above can remove specific projects from a connection without deleting the connection entirely. The connection will remain available for other projects.

To unlink projects:

<Steps>
  <Step title="Open Connectors">
    Open **Connectors**, then go to **App connectors**, and select **{connector_0}**.
  </Step>

  <Step title="Open the connection">
    Open the connection you want to manage.
  </Step>

  <Step title="Select projects">
    Under **Linked projects**, check the projects you want to unlink.
  </Step>

  <Step title="Confirm">
    Click **Unlink projects** and confirm.
  </Step>
</Steps>

When unlinked, those projects will no longer have access to {connector_0} through this connection. If a project needs {connector_0} again, you can link it to any available connection.

## How to delete a {connector_0} connection

Workspace admins and owners can delete {connector_0} connections. Other members can delete a connection if they created it, or if they have been explicitly granted access to it.

<Warning>
  Deleting a connection is permanent and cannot be undone. It will remove the credentials from all linked projects, and any apps using this connection will stop working until a new connection is added.
</Warning>

Before deleting, review the **Linked projects** section to see which projects are currently using the connection.

To delete a connection:

<Steps>
  <Step title="Open Connectors">
    Open **Connectors**, then go to **App connectors**, and select **{connector_0}**.
  </Step>

  <Step title="Open the connection">
    Open the connection you want to remove.
  </Step>

  <Step title="Review linked projects">
    Review the **Linked projects** section.
  </Step>

  <Step title="Delete">
    Under **Delete this connection**, click **Delete** and confirm.
  </Step>
</Steps>
