> For the complete documentation index, see [llms.txt](https://docs.phptravels.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.phptravels.com/modules/stays/hotelbeds.md).

# Hotelbeds

Hotelbeds API integration for PHPTRAVELS: add your Hotelbeds API key and secret, test the connection and sell bedbank hotel rooms with your own markup.

{% embed url="<https://www.youtube.com/watch?v=Gjd4JOw3QVQ>" %}

### Written steps for the video

Hotelbeds is a wholesale bedbank that supplies hotel rooms to travel agencies and online travel sites through its API. The PHPTRAVELS **Stays** module ships a Hotelbeds connector: once your keys are saved, Hotelbeds rooms appear in your hotel search next to your own contracted hotels, priced with your markup.

### What you need from Hotelbeds

* A Hotelbeds account with API access for your company. Hotelbeds approves access and sets the commercial terms; PHPTRAVELS does not provide inventory.
* Your Hotelbeds **API Key** and **Secret**. Hotelbeds normally issues test keys first and production keys after certification, so keep both pairs safe.

### Add the keys in PHPTRAVELS

1. Log in to the admin panel at `yourdomain.com/admin`.
2. Open **Settings > Modules** and select **Hotelbeds**.
3. On the **General** tab, enable the module and set **Dev mode** to development while you test.
4. On the **Credentials** tab, paste the **API Key** and **Secret** into their fields and click **Test**. Save when the test passes.
5. On the **Markup** tab, set separate B2C and B2B margins if you sell to agents.

### Test a booking

1. Search a city with plenty of Hotelbeds inventory, for example a major resort or capital.
2. Check that rooms show board type (room only, breakfast and so on) and cancellation deadlines.
3. Book a refundable room with test keys and confirm the voucher email and the Hotelbeds reference in the admin.
4. Cancel the booking and check the status.
5. Swap in your production keys and set **Dev mode** to production.

### Common errors

* **Test fails or returns 401/403** -- API Key and Secret are swapped, contain spaces, or belong to the other environment.
* **Quota or rate limit messages** -- test keys have a low request limit; wait or ask Hotelbeds to raise it.
* **No rooms for a city** -- try other dates or a larger destination; Hotelbeds may have no allotment there.
* **Price changed** -- the rate was re-checked before payment; search again.

Still stuck? [Submit a ticket](https://docs.phptravels.com/support/submit-ticket) with your Order ID.
