# Developer docs

How to connect StayParity to your own systems. Signed webhooks for every new undercut, and the book-direct badge for a hotel's website.

StayParity has two things you can build on: webhooks that tell your server when an OTA undercuts a hotel, and a badge that shows guests on the hotel's own website that booking direct pays.

## Webhooks

When a check finds an OTA selling a room for less than the hotel's direct price, StayParity posts the undercut to your URL as signed JSON. Use it to open a ticket, message a revenue manager or feed your own reporting.

Deliveries follow Standard Webhooks, so an off-the-shelf library verifies them in a few lines. Read [Webhooks](/developers/webhooks) for the event, signatures, retries and testing.

## Website badge

One `<script>` tag on the hotel's booking page shows guests the direct price next to what the OTAs charge, when the hotel is cheapest or level. When an OTA is cheaper, it shows only the hotel's own price. Read [Website badge](/developers/badge) for the snippet, its options and what it shows.

## Keys

Each has its own key, and they work differently:

| Key         | Looks like | Where                                       | Secret?                                 |
| ----------- | ---------- | ------------------------------------------- | --------------------------------------- |
| Signing key | `whsec_…`  | **Settings → Webhooks**, one per account    | Yes. Keep it on your server.            |
| Embed key   | `wk_…`     | **Settings → Website badge**, one per hotel | No. It sits in the hotel's public HTML. |

The signing key proves a webhook came from StayParity. It is shown once, and only account admins can create or replace it.

The embed key only lets a page show that hotel's badge, which shows what any guest could see anyway. Anyone can copy it from the page source. If that matters, replace the snippet in the portal and the old key stops working. A guest's browser may keep showing a card it loaded in the last five minutes.

There is no public API for reading or changing account data yet. Webhooks post to your server, and the badge fetches the public comparison it displays. Neither needs an API token.

## For tools and agents

* The webhook contract as [OpenAPI 3.1](/developers/openapi.json), with the event under `webhooks`.
* These docs as plain text for language models: [llms.txt](/llms.txt) lists the pages, [llms-full.txt](/llms-full.txt) has them all in one file.
* Every page as Markdown: add `.md` to its address, as in [/developers/webhooks.md](/developers/webhooks.md). The overview is at [/developers/index.md](/developers/index.md).
