Currently, bookings can only be directly created via the Channel API. The App API can't directly create bookings since that requires collection of credit card data. Instead, create a quote and send the guest the payment form link to complete the reservation process and the credit card data will be collected via the standard reservation process.
There are two ways to do this. You can embed the booking widget on your site and let it manage the quote creation and guest redirect process, or you can use the API to create a guest and quote, retrieve the quote payment form link, and then redirect the guest to that URL yourself to complete the reservation process.
Use the booking widget
This is the simple way to implement bookings on a custom site, as no development is necessary. Create a booking widget and embed it on your site.
You can find more details in our Widgets Configuration support article.
Create a quote via API and get a payment form link for booking
This is a three (or four) step process. This is the same process as followed with a manually created direct booking, but automated via the API.
First, create a guest and get the guest id. Or if the guest has booked before, you can use an existing guest id. Next, create a quote for that guest, which will return a payment form URL. Finally, redirect the guest to that URL to complete the booking process. And optionally, you can define a post booking redirect URL so the guest will be sent back to your site after booking.
Create a guest
To create a guest, POST to the guests endpoint: https://api.ownerreservations.com/help/v2/Api/POST-v2-guests. No fields are required, so populate as much information as you have. The guest will be able to provide any missing contact information or adjust later on during the reservation process.
This will return the fields for the created guest including the
Create a quote
To create a quote, POST to the quotes endpoint: https://secure.ownerreservations.com/help/api/post-api-quotes-ownerrez.application.client.controllers.api-post_addcharges_sendemail_skiprulevalidation (required fields are GuestId, PropertyId, Arrival, Departure, Adults, Children, Pets).
This will return the fields for the created quote including the
PaymentForm. This is the URL to complete booking for the quote.
Redirect the guest to complete the booking
Direct the guest to the payment form link, either by a browser redirect, link, button, sending them an email, etc. A booking will be created when the guest completes the reservation process. Any system messages, triggers, etc. will be sent just the same as for a direct booking.
Post booking redirect
If you want, you can configure a post booking redirect so that the guest is sent back to your site after the booking is completed. There are two ways to configure this:
- To configure the same URL for all bookings, go to the Rules section of each property and configure the Redirect After Booking URL setting.
- To configure a different URL for each booking, pass the
RedirectAfterBookingUrlfield when creating a quote. This will set a specific redirect after booking URL for that particular quote.