# WordPress

The RatesSpot Booking plugin shows your listings on a WordPress site, with Book buttons that open your RatesSpot booking page. Guests choose dates and pay there, so availability and payments are always right. Change a price or photo in RatesSpot and the site shows it within 10 minutes.

## What you need

- A RatesSpot business with a published booking page (dashboard → Booking page). A test business works too: its page shows a test banner.
- WordPress 6.0 or later, PHP 7.4 or later.

No API key: the plugin reads only what your published booking page already shows.

## Install

The plugin is waiting for review in the WordPress plugin directory. Until it's listed, install it from GitHub:

1. Download `ratesspot-booking.zip` from the [latest release](https://github.com/Nimisoere/ratesspot-dev/releases).
2. In WordPress: Plugins → Add New → Upload Plugin, choose the file, then Activate.
3. Settings → RatesSpot: paste your booking page's address (`https://book.ratesspot.com/your-business`) and save. It says how many listings it found.

## Add listings to a page

Paste a shortcode into any page or post. In the block editor, add a Shortcode block.

`[ratesspot_listings]` shows every listing as a card: photo, name, tagline, starting price ("From $129 a night") and a Book button to that listing on your booking page.

| Option | Example | |
| --- | --- | --- |
| `columns` | `columns="2"` | 1 to 4 (default 3); fewer on phones |
| `button` | `button="Reserve"` | The button's text |
| `listings` | `listings="studio,two-bed"` | Only these listings, by their web address in RatesSpot |

`[ratesspot_button]` adds a single Book button. `listing="studio"` sends guests straight to one listing; `label="Book your stay"` changes the text.

The cards use your theme's fonts, colours and buttons.

## If something's wrong

Visitors never see errors. Administrators see a short note where the shortcode is, for example when the booking page isn't published or the address is mistyped. Settings → RatesSpot shows whether the plugin can reach your booking page.

## What it sends

When a page with a shortcode is shown (at most every 10 minutes, as listings are cached), your site asks `https://api.ratesspot.com` for your booking page's public details and listings. Nothing about your visitors is sent. Photos load from `https://api.ratesspot.com`, and Book buttons link to `https://book.ratesspot.com`.

## Building something else

The plugin is a small example of the public API: `GET /v1/storefronts/{slug}` gives a published booking page's business and publishable key, and `GET /v1/resources` with that key gives its listings. For a full booking flow on your own site, see [Build a booking page](https://www.ratesspot.com/docs/booking-page.md).
