# Changelog

> Every change to the Partners API, newest first.

Source: https://developers.loyx.se/changelog/

We add fields and endpoints without a new version. We never remove or rename fields, or change the meaning of a value, inside `v1`. Anything breaking gets a new version and at least 12 months' notice.

## Unreleased

- First public documentation of the Partners API `v1`: authentication, member lookup, member card, sales, products and stores.
- Sales: `external.external_transaction_id` is the duplicate key. A retry with the same content returns `200` with the original transaction and `Idempotent-Replayed: true`; the same id with different content returns `409 external_transaction_id_conflict`.
- Sales honour an optional `Idempotency-Key`: the same key with the same body replays the original (`200`); the same key with a different sale is `409 idempotency_key_reused`.
- New: `GET /v1/memberships/{membership_id}/rewards` lists the member's usable rewards, optionally for one store.
- Member lookup now returns `unit` and `cycle_length`. On a cashback program, `unit` carries `currency`, `minor_units` and `locale`.
- Products: `external_product_id` on products; `POST /v1/products` upserts by it; new `POST /v1/products/bulk` (up to 100, `207` with a result per item, optional `Idempotency-Key`, also on `POST /v1/products`); unknown products on a sale line are created from the line.
- Scopes on API keys: `members:read`, `sales:write`, `products:read`, `products:write`, `stores:read`, `stores:write`, `rewards:read`.
- Preview pages added for planned features. They are not live.
