# Product catalog

> For AI agents: the index of these docs is at https://referalli.com/docs/llms.txt (every page it lists has a Markdown version like this one).

A catalog of your store's products that partners search for links, synced from Shopify, WooCommerce, BigCommerce or a product feed, or pushed through the API. Catalog categories feed rate-card commissions.

The catalog lists the products partners can promote. Each item has an `externalId`: the provider's product id, the same value order lines carry as `productId` and links carry as `productRef`. Items belong to one program or, with no `programId`, to every program in the org.

## Fill it

Pick any of these; they can be combined.

**From your store.** `POST /v1/catalog/sync` imports the active products with your own API credentials (nothing of Referalli's is involved). The billing connection's stored credentials are used when it has them; otherwise send `credentials`, which are used once and not stored.

| Provider | Credentials | Reads |
| --- | --- | --- |
| `shopify` | `shopDomain`, `accessToken` | Admin REST `products.json`, link is `https://{shop}/products/{handle}`, category is the product type |
| `woocommerce` | `siteUrl`, `consumerKey`, `consumerSecret` | `/wp-json/wc/v3/products`, link is the product permalink, category is the first category |
| `bigcommerce` | `storeHash`, `apiToken` (optional `storeUrl`) | `/v3/catalog/products`, link is the product's custom URL (BigCommerce returns category ids, not names, so categories stay empty) |

```bash
curl -X POST https://referalli.com/v1/catalog/sync \
  -H "Authorization: Bearer $REFERALLI_KEY" -H "Content-Type: application/json" \
  -d '{"provider":"shopify","connectionId":"bcn_..."}'
```

A product that is no longer in the store becomes `active: false` and stops showing to partners; it is never deleted.

**From a feed.** `POST /v1/catalog/feeds` registers an https URL in one of three formats: Google Shopping XML (RSS or Atom with `g:` fields), CSV with a header row (`id`, `title`, `link`, `image_link`, `price`, `category`, `availability`; `sku`, `currency` optional), or a JSON array of products. Feeds sync every day; `POST /v1/catalog/feeds/{id}/sync` syncs now and a failing feed keeps its `lastError`. Rows without an id, title or https link are skipped. A product that leaves a feed becomes inactive when it is the only feed for its program scope.

**From the API.** `PUT /v1/catalog/items` upserts up to 500 items at a time (source `api`).

Prices are integer minor units with a currency. `GET /v1/catalog/items` lists the catalog with `q`, `category` and `programId` filters and cursor paging; `DELETE /v1/catalog/items/{id}` removes one.

## Categories and commissions

When a commission rule has a [rate card](/docs/commission-rules), each order line is paid by its category. The line's own category wins, then the rate card's `productCategories`, then the catalog category of the item whose `externalId` (or `sku`) matches the line's product. So a store that syncs its catalog gets per-category rates without listing every product in the rule.

---

## For AI agents

- This page for a human reader: https://referalli.com/docs/product-catalog
- The whole space as one Markdown file: https://referalli.com/docs/llms-full.txt
- Live search + fetch over MCP: https://referalli.com/docs/_api/public/orgs/07f432f4-34b9-46a7-aaad-c0e395d2e4f9/spaces/2bf4f614-3630-4fbf-85f9-5ecafa6b7d97/mcp
  - Install (Claude CLI): `claude mcp add referalli --transport http https://referalli.com/docs/_api/public/orgs/07f432f4-34b9-46a7-aaad-c0e395d2e4f9/spaces/2bf4f614-3630-4fbf-85f9-5ecafa6b7d97/mcp`

This Markdown is the same content the page renders — safe to quote and to ground answers in.
