Meet the MotoPress Hotel Booking REST API!

Home > Blog > Product updates > Meet the MotoPress Hotel Booking REST API!

We have great news for developers who want to use the hotel booking system WordPress plugin in environments other than WordPress easily.

With the plugin version 4.1.0 or greater, you can employ the REST API resources we developed for Hotel Booking to exchange plugin’s data across different external applications and interfaces, thus taking the Hotel Booking plugin further and creating more diverse and flexible user experiences.

Hotel Booking REST API docs

Since it’s built on top of the WordPress REST API, you get the robustness and security of the latter and can safely use it for whatever scenario.

New to the plugin? Register a free trial for Hotel Booking.

What is a REST API, btw?

The WordPress REST API comes into play when you need to allow applications outside WordPress to interact with WordPress, the Hotel Booking plugin in our case.

Since it can be accessed using JavaScript, you’ll be able to build interactive websites and apps. In simple terms, an API is a code that bridges independent systems and interfaces.

If you are a developer, most likely you are familiar with how it works, at least in general, since you might have used APIs of different popular tools and platforms, such as payment processing gateways or Google services, when integrating them with your or your client WordPress website.

Read more MotoPress articles for WordPress developers:

ThemeForest Alternatives for selling your WP theme

Create a demo for your WordPress theme or plugin in clicks

Real-World examples of using the MotoPress WordPress Demo Builder plugin

What benefits does a REST API deliver?

It’s built to make it much easier to:

  • Create dedicated mobile apps
  • Integrate Hotel Booking with external services and platforms
  • Use it as a headless CMS
  • and many more.

What can you do with the Hotel Booking REST API?

So what exactly can you do by employing the Hotel Booking REST API? Just anything we’ve mentioned above.

Translating a REST API into the context of the Hotel Booking plugin, you can do the following things associated with the routine tasks and general tools of Hotel Booking:

That means the Hotel Booking plugin is completely ready to be integrated with external services because we give you extensive options to operate the plugin’s data.

MotoPress Hotel Booking REST API Docs

We’ve taken care of the docs so that you’ll be provided with a great starting point once you need to use the MotoPress Hotel Booking REST API for real tasks.

For your comfort, the docs are easy-to-use, interactive, and well-structured around all HTTP methods, for instance, GET to get the data or POST to create it.

Using our docs, you’ll be able to access the list of all possible endpoints and their parameters.

Check the docs here: Hotel Booking REST API Docs

See how to get started: How to generate API keys and test the API

Since we also provide you with the ability to create a demo site, you’ll have the comfort of a smooth test-drive of the Hotel Booking REST API features and possibilities (more on this below).

Use case example

Let’s use a REST API for Hotel Booking to solve daily routines associated with using the plugin, for example, such as:

  • Getting available accommodations for chosen dates
  • Booking accommodations for chosen dates
  • Confirming bookings
  • Deleting bookings

We’ll use the demo for this purpose.

1. To test these functions, let’s first create a demo as described in the docs (in “How to start”).

This will give you access to the Hotel Booking demo dashboard, where you can create a test API with the needed authorization credentials, a consumer key and consumer secret.

api keys dashboard

2. Use your demo ID to authorize:

demo id hotel booking rest api

Then enter your generated keys:

authorization

3. Before sending any request, you need to authorize so make sure to get the keys.

    • Let’s check it for getting available accommodations for chosen dates

Go to this link and authorize, fill in check_in_date and check_out_date fields.

check availability hotel booking rest api small

Then click “Execute” to get a response and see data with IDs of available accommodations.

availability response

    • Let’s see how it works for the accommodation booking process for chosen dates.
Do just the same using the POST method for /bookings. This will create a booking with a chosen status:

post booking create booking

    • You can also confirm a booking by changing the status of a needed booking. You need to choose a booking ID.

confirm booking rest api motopress
In the response, you’ll see that the status has changed and your booking is confirmed:
response confirm a booking

    • It works easily for deleting a booking:

delete booking rest api

Once done, the booking is deleted from your admin dashboard:

delete booking response

That’s it! Of course, you can test even more methods yourself. Thanks to the MotoPress Rest API for Hotel Booking, you are about to create the next winning features for your clients who use Hotel Booking or integrate the powerhouse of the latter in your favorite and familiar frameworks and platforms.

The best part of the MotoPress Hotel Booking REST API is that you can test it right away even without a need to install or register in any third-party services, just with a Hotel Booking demo account (it’ll be safer to use it on a demo site rather than on your live site) and our interactive docs.

Let us know if you have any questions!

Check the docs here: Hotel Booking REST API Docs

See how to get started: How to generate API keys and test the API

Was this article helpful?

Yes (1) No

You have already left your review.

Leave a Reply

Your email address will not be published. Required fields are marked *