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. |
Note: In the calendar,
numAvailis the raw availability override stored for the date, not the sellable availability.GET /inventory/rooms/availabilityuses the same override-based logic, so a false there does not mean the room cannot be sold. UseGET /inventory/rooms/offersfor sellable availability.Note: A valid price must exist for a date, or the inventory endpoints return nothing for it and the date is treated as closed.
Write availability and close dates
Write per-date values with POST /inventory/rooms/calendar. This needs the write:inventory scope, and the request uses roomId.
Each entry in the calendar array can carry from, to, numAvail, override, price1 and minStay:
[{"roomId":1234567,"calendar":[{"from":"…","to":"…","minStay":3,"price1":450,"numAvail":1}]}]
- To close a date completely, set
overridetoblackout. - To reopen it, set
overridetononetogether withnumAvailin the same record. - To reduce availability, send
numAvail. AnumAvailwrite can only reduce availability, never raise it above the room quantity, and only takes effect when the date is not overridden. -
price1is Daily Price 1. It is sent to the Booking.com rate plan mapped to that Daily Price, or to the default rate plan mapped for the room in SETTINGS > CHANNEL MANAGER > BOOKING.COM > MAPPING if the rate code is empty. The Daily Price must be enabled for Booking.com, and the rate code must be an active Booking.com rate plan that appears under Get Codes.
Note: Availability and price changes written through the API are queued and normally sent to the channel within a few minutes. Price changes are lower priority than availability changes. No API call replicates the Update button on the Mapping page.
Note: A calendar blackout can't be set far into the future. For a long-term closure, use Settings > Booking Engine > Exceptional Booking Period with Booking type set to Blackout, and set First Night of Period and Last Night of Period.
Note: There is no historical availability data in the API, and past dates are not returned. API-made changes appear in the booking Log tab under the user account whose credentials were used, without an API label. Keep your own request log if you need to show what your integration requested and when.
Send same-day availability
Today's inventory is outside the standard calendar API write flow. After midnight UTC, the current local day is already a past date for the API, so it is not returned or changed by API calls. Mapping > Update with Inventory enabled is the supported way to push same-day availability to a channel.
Steps:
- Go to SETTINGS > CHANNEL MANAGER > AIRBNB > MAPPING.
- Tick Inventory for the room.
- Click Update.
Expected result: The current day's availability is restored at the channel.
For Booking.com, go to SETTINGS > CHANNEL MANAGER > BOOKING.COM > MAPPING and click Update for the room to immediately send the inventory and prices.
Extend the sellable horizon
Updates cover 365 days by default. To sell further ahead:
- Go to PRICES > DAILY PRICE RULES (and PRICES > FIXED PRICES) and click Edit.
- Set Max Days in Advance up to 999 on every price rule of the room. A room can hold up to 16 rules, and any rule with a lower value closes the room from that date.
- Make sure prices exist for the whole period.
- Set Export data to 2 years in (SETTINGS) CHANNEL MANAGER.
- Click Update on the channel's Mapping page.
Note: Not all channels accept 2 years of data. For Airbnb, rate plans only send prices up to 1 year.
Send bookings to Beds24
Send bookings to Beds24 with POST /bookings.
Expected result: Beds24 closes availability for those dates at all other booking sources.
Troubleshooting
The calendar update fails
Likely Cause: The request uses roomTypeId instead of roomId.
Resolution: Use roomId in the request.
A numAvail write has no effect
Likely Cause: A blackout or override is active on the date, or no valid price exists for it.
Resolution: Send override: "none" together with numAvail in the same calendar entry, and check that a valid price exists for the date.
A same-day inventory write returns success but the room stays closed
Likely Cause: The current day is outside the API date window after midnight UTC, or something else is holding the date closed, such as a blackout or override, no valid price for today, or a price-level Min days in advance setting.
Resolution: Hover over the 0 in the Inventory row of the calendar to see what is holding it closed, and fix that setting. Then go to SETTINGS > CHANNEL MANAGER > {channel} > MAPPING and click Update for the room, with Inventory ticked for Airbnb.
Important Notes
- The room's Quantity of this type under SETTINGS > PROPERTIES > ROOMS > SETUP is the ceiling for availability.
- Scopes are fixed when you create the invite code. To add a scope, generate a new invite code and exchange it for a new refresh token.