OTAs, booking engines and similar systems can use API V2 to retrieve property, price and availability information from Beds24 and send the resulting bookings back to Beds24. Your developer builds the integration between your system and Beds24.
Quick Guide
- Create a test property with prices in Beds24.
- Generate an invite code on the API page and exchange it for a refresh token with
GET /authentication/setup. - Read your properties once with
GET /propertiesto map them on your side. - Cache price and availability with
GET /inventory/rooms/calendar, and check live withGET /inventory/rooms/availabilityorGET /inventory/rooms/offers. - Send bookings with
POST /bookings.
Before you start
- Get a basic understanding of how Beds24 works: go through the Introduction and create a test property with prices and any data you intend to use.
- Use API V2. Beds24 has two API versions, V1 and V2, and recommends V2 for any new projects. See the API V2 documentation.
- Try the examples in the interactive Swagger documentation.
Usage limits
Beds24 APIs have strict usage limits, and you need to design your interface to stay within them. This may mean caching data that isn't expected to change often on your side, rather than making a call each time you need it, and only making calls when necessary.
Warning: The Beds24 API isn't intended or suitable for applications that make significant numbers of real-time calls, for example in response to public user actions. Cache data you need in real time for your public pages on your side.
Authenticate with API V2
API V2 uses refresh tokens, which generate access tokens. Include the token as a header in your requests in this format: token: {token}
- Go to the API page in the control panel and click Generate invite code.
- Select the scopes you need, then click Generate invite code again.
- Copy the invite code.
- Exchange it for a refresh token with the GET /authentication/setup endpoint. You can try this yourself on the Swagger page for GET /authentication/setup.
Expected result: The response contains a short-term access token to authenticate other API calls, expiresIn (how many seconds the token lasts) and a refreshToken to generate more tokens in the future. For the full request and response, see Get a refresh token in API V2.
Retrieve property data from Beds24
Get properties from Beds24 with the GET /properties endpoint. This should be a one-off operation to construct or map the property on your side.
Try GETing properties with this request:
curl -X 'GET' \ 'https://beds24.com/api/v2/properties' \ -H 'accept: application/json' \ -H 'token: 123...'
Expected result: The JSON response shows information about your properties.
Tip: In Swagger, click Schema under POST /properties to see all the fields you can set with this endpoint.
By default, not all property data is returned. To include additional information in the response, add parameters. For example, to include all of a property's room data, add ?includeAllRooms=true to the request URL:
curl -X 'GET' \ 'https://beds24.com/api/v2/properties?includeAllRooms=true' \ -H 'accept: application/json' \ -H 'token: 123...'
Price and availability
| Endpoint | Returns | When to use it |
|---|---|---|
| GET /inventory/rooms/calendar | Price and availability per day | Retrieve room availability and pricing in bulk, for example one year at a time, and cache it on your side. Calling it about once per 6 hours is generally enough to keep the data in sync. |
| GET /inventory/rooms/availability | The availability status of dates | After a guest has selected dates and started a booking, check the dates are still available. |
| GET /inventory/rooms/offers | Offers based on the criteria you specify | Check availability for a specific condition when check-in and check-out dates and occupancy are known, for example in real time just before you accept a booking, to confirm all details and the price are still current. |
Send bookings to Beds24
Send bookings to Beds24 with POST /bookings.
Expected result: Beds24 closes availability for those dates at all other booking sources.