# Commerce

Manage the products and orders of a WooCommerce store on a self-hosted WordPress site through the Commerce API.

A self-hosted site running WooCommerce is also a Commerce store, managed through the [Commerce API](/guides/commerce) at `/v1/commerce`.

## Manage the store

The Commerce API manages its:

- products, variants, images and stock
- categories (as collections) and coupons (as discounts)
- product custom fields and pages
- orders (read-only)

It can also sync the store into a Meta catalog for catalog ads.

Pass this account's id as `accountId`. Objects report `platform: "woocommerce"`.

The connected user must be allowed to manage WooCommerce.

**WordPress.com sites** cannot serve WooCommerce through Zernio. Their pages remain available through the Commerce pages endpoints.

`GET /v1/commerce/store` returns the `capabilities` the site serves.

Sales channels, menus, redirects, metaobjects, markets and marketing activities are Shopify only; see [WooCommerce differences](#woocommerce-differences).

```bash
curl "https://zernio.com/api/v1/commerce/products?accountId=66c0a1b2c3d4e5f6a7b8c9d0&status=active" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```

## Operations the store serves

Each operation below works on WooCommerce and on Shopify:

- **Products:** [list](/commerce/list-commerce-products), [get](/commerce/get-commerce-product), [create](/commerce/create-commerce-product), [update](/commerce/update-commerce-product), [duplicate](/commerce/duplicate-commerce-product), [change state](/commerce/change-commerce-product-state), [add or remove tags in bulk](/commerce/change-commerce-product-tags), [update variant prices](/commerce/update-commerce-product-prices).
- **Variants and options:** [add variants](/commerce/create-commerce-product-variants), [delete variants](/commerce/delete-commerce-product-variants), [add options](/commerce/create-commerce-product-options), [delete options](/commerce/delete-commerce-product-options).
- **Images:** [add](/commerce/add-commerce-product-images), [remove](/commerce/remove-commerce-product-images), [reorder](/commerce/reorder-commerce-product-images).
- **Stock:** [list locations](/commerce/list-commerce-locations), [get a product's stock](/commerce/list-commerce-inventory), [set or adjust stock](/commerce/change-commerce-inventory).
- **Categories (collections):** [list](/commerce/list-commerce-collections), [get](/commerce/get-commerce-collection), [create](/commerce/create-commerce-collection), [update](/commerce/update-commerce-collection), [delete](/commerce/delete-commerce-collection), [add or remove products](/commerce/change-commerce-collection-products).
- **Coupons (discounts):** [list](/commerce/list-commerce-discounts), [get](/commerce/get-commerce-discount), [create](/commerce/create-commerce-discount), [update](/commerce/update-commerce-discount), [activate or deactivate](/commerce/set-commerce-discount-active), [delete](/commerce/delete-commerce-discount).
- **Custom fields (product metafields):** [list](/commerce/list-commerce-product-metafields), [set](/commerce/set-commerce-product-metafields), [delete](/commerce/delete-commerce-product-metafields).
- **Pages:** [list](/commerce/list-commerce-pages), [get](/commerce/get-commerce-page), [create](/commerce/create-commerce-page), [update](/commerce/update-commerce-page), [delete](/commerce/delete-commerce-page).
- **Orders:** [list](/commerce/list-commerce-orders), [get](/commerce/get-commerce-order).

## Read orders

[List orders](/commerce/list-commerce-orders) and [Get an order](/commerce/get-commerce-order) read the store's orders with line items, coupons, tax, shipping, fees, payment status and refunds. See [Sync orders](/guides/commerce#sync-orders) for paging and webhooks.

```bash
curl "https://zernio.com/api/v1/commerce/orders?accountId=66c0a1b2c3d4e5f6a7b8c9d0&updatedAfter=2026-10-20T08:00:00Z" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```

Orders need no extra permission: `orders.read` comes with any user who can manage WooCommerce. A page holds up to 100 orders.

Each order's `attribution` carries the last visit from WooCommerce Order Attribution (WooCommerce 8.5 or later), with landing page, referrer and UTM parameters. See [Order attribution](/guides/commerce#order-attribution).

Zernio registers order webhooks on the site when it is connected. They reach your [webhooks](/webhooks) as `commerce.order.created`, `commerce.order.updated` and `commerce.order.refunded`.

A site connected before order webhooks existed gets them the next time it is reconnected or a catalog sync is created.

## WooCommerce differences

WooCommerce is reached through the self-hosted site's REST API with the connected user's Application Password. What differs from Shopify:

| Area | On WooCommerce |
|------|----------------|
| Not served (`400 platform_not_supported`) | Reordering collection products, adding codes to a discount (no `discounts.codes`), sales channels, navigation menus, URL redirects, metaobjects, markets and price lists, marketing activities. |
| Products | `vendor`, `productType` and `seo` are not supported (`400`). `deactivate` sets the product to `draft` and `archive` to `private` (`inactive`). A WooCommerce `pending` product reads as `pending_review` and a trashed one as `deleted`. |
| Collections | Product categories. They have no SEO fields and no sort order (`400`). |
| Discounts | Coupons, so code discounts only (no automatic discounts). A coupon cannot start in the future or require a minimum quantity (`400`). Deactivating one sets its expiry to now. |
| Inventory | One location, with the id `default`. An `adjust` reads the count and writes the sum, since WooCommerce has no atomic increment: a sale landing in between can be overwritten. |
| Metafields | Product custom fields (meta data) only: stores do not list `collections.metafields`, and collection metafields answer `400 platform_not_supported`. A key without a dot is returned under the namespace `woocommerce`; `namespace.key` round-trips. |
| Pagination | The cursor wraps a page number and a page holds at most 100 rows. |
| Pages | WordPress pages, available whenever the user can edit pages, with or without WooCommerce. |

## How it behaves

- **No optional permissions:** `grantPermissionsUrl` is always `null`.
- **Store capabilities** appear when the site runs WooCommerce and the connected user can manage it.
- **Order attribution** records only the last session, so `firstVisit` and `occurredAt` are always `null`. It needs Order Attribution turned on, and covers orders placed after that.
- **`customAttributes`** on an order's `attribution` holds the public order meta.
- **Product changes:** Zernio registers product webhooks on the site when it is connected and again when a catalog sync is created, so syncs pick changes up within minutes.

## Related

- [Commerce guide](/guides/commerce): the cross-store recipe.
- [Shopify commerce](/platforms/shopify/commerce): the Shopify-only operations.