# Changelog

> Changes to the shop API, the AI-assistant connector and these docs, newest first.

## Next release: a discount with a rate per product

- **New:** `POST /v1/api/promotions/discount` and `PATCH /v1/api/promotions/discount/{id}` take
  `product_discounts: [{ sku, discount_type, value }]`, a rate per SKU off every unit of it (up to 500 SKUs),
  instead of `discount_type`, `value` and `applies_to`. One promotion holds the whole sale, so it switches
  on and off at once. It reads back the same way it is written.

## Next release: stock read-back and simpler variants

- **Fixed:** `GET /v1/api/products` answered `stock: { on_hand: null, available: null }` for every product. It now returns the counted and sellable numbers.
- **Variants:** a new variant (`parent_sku`) that gives no `category` or `brand` takes the main product's. Anything the row gives still wins.
- **Clearer errors:** a new product missing several required fields is told all of them at once, for example `A new product needs name, price and brand.`

## Permissions, key expiry and the AI-assistant connector

- **Connector** at `https://mcp.sellersidekick.ai/mcp` for Claude, ChatGPT, Gemini Enterprise and Gemini CLI. You sign in with SellerSideKick and choose the shop and permissions. See [Connect ChatGPT, Claude or Gemini](https://docs.sellersidekick.ai/connect-ai-assistant).
- **Permissions on API keys:** `catalog:read`, `catalog:write`, `stock:write`, `promotions:write`. Existing keys and new keys default to full access. A call outside a key's permissions answers `403 Y35`.
- **Key expiry:** never, 30, 90 or 365 days, with a reminder email 7 days before. An expired key answers `401 Y22`.
- **Connected AI assistants** are listed in **Settings → API keys**, each with a Disconnect button. **Recent API changes** there shows what keys and assistants changed, before and after.
- **Change log** in **Settings → API keys**: every change made through a key or an assistant, with the value before and after.
- These docs, `llms.txt` and a Markdown copy of every page.

## 2026-10-25: OpenAPI spec 1.1.0 and usage counters

- The OpenAPI spec is published at `https://api.sellersidekick.ai/v1/api/openapi.json`, written for AI agents: when to call each operation, what to check first, whether a retry is safe, with examples.
- **Usage counters** per key and per shop in **Settings → API keys**: calls, errors, rate-limited calls, dry runs and rows written, today and over the last 30 days.
