# Changelog

Source: https://developers.weerom.com/docs/changelog

> What changed in the WeerOm API, newest first.

## v1, webhooks

WeerOm posts a signed JSON message to the shop's addresses when a booking or a payment changes. Nothing in the API changed.

- Four events: `booking.created`, `booking.updated`, `booking.cancelled` and `payment.completed`.
- The shop adds up to 5 addresses in its admin, under Settings, Features, Connections, and picks the events for each.
- Each address has its own secret, `whsec_` and 64 hex characters. Every message carries `WeerOm-Signature: t=...,v1=...`, an HMAC-SHA256 of the time and the body.
- `data.object` is the booking or the payment as `GET /bookings/{id}` or `GET /payments/{id}` answers it.
- 7 attempts over about 33 hours. An address that fails for 3 days is switched off.
- A test message from the admin.

See [Webhooks](https://developers.weerom.com/docs/webhooks).

## v1, bookings and three kinds of key

The API takes bookings and changes them. Every field and code of the first release keeps its meaning.

- `GET /availability`: the free times for a service, for 1 to 14 days, for one staff member or everyone who does the service.
- `POST /bookings`: books a free time through the shop's booking engine. The shop's rules apply, and the customer gets the shop's confirmation mail.
- `POST /bookings/{id}/cancel` and `POST /bookings/{id}/reschedule`.
- `PATCH /customers/{id}`: changes a customer's name or blocks them.
- `as` in the body of a write: `customer` keeps the shop's rules, `staff` acts as the shop.
- Three kinds of key: read, write and public. A public key starts with `wo_pub_` and may sit in a web page. Only an administrator of the shop makes keys.
- `Idempotency-Key` on every `POST` and `PATCH`, kept for 24 hours, with `Idempotent-Replayed: true` on a replayed answer.
- New error codes: `key_not_allowed`, `slot_taken`, `too_late`, `wrong_state`, `not_allowed`, `limit_reached`, `bookings_paused`, `idempotency_mismatch` and `request_in_progress`.
- A key holds the shop's number: `wo_live_1_3f9a...`.
- Examples on every object in [openapi.json](https://developers.weerom.com/openapi.json), so the reference shows a whole answer.

## v1, first release

The first version of the API. It read a shop's data and changed nothing.

- `GET /shop`: the shop the key belongs to.
- `GET /services` and `GET /services/{id}`, with the name in five languages.
- `GET /staff` and `GET /staff/{id}`.
- `GET /customers` and `GET /customers/{id}`. Filters: `email`, `phone`, `updated_after`.
- `GET /bookings` and `GET /bookings/{id}`. Filters: `status`, `staff_id`, `customer_id`, `starts_after`, `starts_before`, `updated_after`.
- `GET /payments` and `GET /payments/{id}`. Filters: `paid_after`, `paid_before`, `method`.
- Keys made by the shop under Settings, Features, Connections, on the Premium plan. Up to 10 for each shop.
- Cursor pagination, up to 100 objects a page.
- 120 requests a minute for each key, with `RateLimit-*` headers.
- One error shape, and `X-Request-Id` on every answer.
- An OpenAPI 3.1 file at [/openapi.json](https://developers.weerom.com/openapi.json).

Within v1, fields are added but never renamed or removed, and an error code never changes its meaning.

## What is coming

These are planned. None of them works today.

- Adding and removing webhook addresses through the API.
- Webhook events for customers.
- Test keys with their own data.
- Expanding a related object inside another, such as the whole customer inside a booking.
- Changing a booking's service.
- Noting a payment.
