All URIs are relative to https://api.katanox.com/v2, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
bookingsGetInvoices() | GET /bookings/{booking_id}/invoices | Get folio data |
cancelBookingById() | DELETE /bookings/{booking_id} | Cancel a booking |
cancelReservation() | DELETE /bookings/{booking_id}/reservations/{reservation_id} | Cancel a reservation |
createBooking() | POST /bookings | Create a booking |
createReservation() | POST /bookings/{booking_id}/reservations | Create a reservation |
getBookingById() | GET /bookings/{booking_id} | Retrieve a booking |
getReservationById() | GET /bookings/{booking_id}/reservations/{reservation_id} | Retrieve a reservation by id |
updateReservation() | PUT /bookings/{booking_id}/reservations/{reservation_id} | Update a reservation |
bookingsGetInvoices($booking_id, $authorization): \Katanox\Model\InvoiceGetBookingInvoiceResponse
Get folio data
Returns invoice details of a booking.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Katanox\Api\BookingsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$booking_id = 'booking_id_example'; // string | The id of the booking
$authorization = 'authorization_example'; // string | Type 'Bearer' and then your API Token
try {
$result = $apiInstance->bookingsGetInvoices($booking_id, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BookingsApi->bookingsGetInvoices: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
booking_id | string | The id of the booking | |
authorization | string | Type 'Bearer' and then your API Token |
\Katanox\Model\InvoiceGetBookingInvoiceResponse
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
cancelBookingById($booking_id, $authorization)
Cancel a booking
By canceling a booking, you are canceling all the reservations in it.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Katanox\Api\BookingsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$booking_id = 'booking_id_example'; // string | The id of the booking to be cancelled
$authorization = 'authorization_example'; // string | Type 'Bearer' and then your API Token
try {
$apiInstance->cancelBookingById($booking_id, $authorization);
} catch (Exception $e) {
echo 'Exception when calling BookingsApi->cancelBookingById: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
booking_id | string | The id of the booking to be cancelled | |
authorization | string | Type 'Bearer' and then your API Token |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
cancelReservation($booking_id, $reservation_id, $authorization)
Cancel a reservation
Using this endpoint you can submit a reservation cancellation request. If the reservation can be cancelled, the endpoint will return 204 and an empty response body. If we cannot start the cancellation process, the endpoint will return an error message and error codes. Currently the following error codes can be returned: NON_CANCELLABLE
, NOT_FOUND
, INTERNAL_SERVER_ERROR
Each error code will have an error message to explain the error code. NON_CANCELLABLE
reservations are the ones that either have non cancellable status (e.g CANCELLED
, PENDING
) or their check in date has already passed and the reservation cannot be cancelled any more. It's important to fetch the status of the reservation after submitting this request to confirm that the status changes to CANCELLED
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Katanox\Api\BookingsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$booking_id = 'booking_id_example'; // string | The id of the booking
$reservation_id = 'reservation_id_example'; // string | The id of the reservation
$authorization = 'authorization_example'; // string | Type 'Bearer' and then your API Token
try {
$apiInstance->cancelReservation($booking_id, $reservation_id, $authorization);
} catch (Exception $e) {
echo 'Exception when calling BookingsApi->cancelReservation: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
booking_id | string | The id of the booking | |
reservation_id | string | The id of the reservation | |
authorization | string | Type 'Bearer' and then your API Token |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createBooking($x_ktnx_source, $authorization, $http_booking_creation_request): \Katanox\Model\HttpBookingResponse
- https://api.katanox.com/v2 Create a booking
Using this endpoint, you can create a booking consisting of one or more reservations. Note that these reservations need to belong to the same property, but can contain any combination of rates/units of that property. Furthermore, the check-in date of the new reservation needs to be within the travel dates of the rest of the reservations in the booking. The booking object allows you to manage multiple reservations in a unified way while keeping the flexibility to modify individual reservations. When this endpoint returns a successful response, it means that we accepted the booking and we are in the process of forwarding it to the hotels. Since some hotel systems are asynchronous, you need to retrieve the booking again using the id in the response and check if it was confirmed.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Katanox\Api\BookingsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$x_ktnx_source = 'x_ktnx_source_example'; // string | The source of the booking
$authorization = 'authorization_example'; // string | Type 'Bearer' and then your API Token
$http_booking_creation_request = new \Katanox\Model\HttpBookingCreationRequest(); // \Katanox\Model\HttpBookingCreationRequest | Booking body
$hostIndex = 0;
$variables = [
];
try {
$result = $apiInstance->createBooking($x_ktnx_source, $authorization, $http_booking_creation_request, $hostIndex, $variables);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BookingsApi->createBooking: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
x_ktnx_source | string | The source of the booking | |
authorization | string | Type 'Bearer' and then your API Token | |
http_booking_creation_request | \Katanox\Model\HttpBookingCreationRequest | Booking body | |
hostIndex | null | int | Host index. Defaults to null. If null, then the library will use $this->hostIndex instead |
variables | array | Associative array of variables to pass to the host. Defaults to empty array. | [optional] |
\Katanox\Model\HttpBookingResponse
No authorization required
- Content-Type:
application/json
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createReservation($booking_id, $authorization, $http_reservation_creation_request): \Katanox\Model\HttpReservationResponse
Create a reservation
When creating a new reservation, you must specify the booking id you want the new reservation to be part of. If there is no booking, use the Create a booking method instead.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Katanox\Api\BookingsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$booking_id = 'booking_id_example'; // string | The id of the booking
$authorization = 'authorization_example'; // string | Type 'Bearer' and then your API Token
$http_reservation_creation_request = new \Katanox\Model\HttpReservationCreationRequest(); // \Katanox\Model\HttpReservationCreationRequest | Reservation body
try {
$result = $apiInstance->createReservation($booking_id, $authorization, $http_reservation_creation_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BookingsApi->createReservation: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
booking_id | string | The id of the booking | |
authorization | string | Type 'Bearer' and then your API Token | |
http_reservation_creation_request | \Katanox\Model\HttpReservationCreationRequest | Reservation body |
\Katanox\Model\HttpReservationResponse
No authorization required
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getBookingById($booking_id, $authorization): \Katanox\Model\HttpBookingResponse
Retrieve a booking
Retrieve a specific booking with its current state. The specific booking id is supplied to you as part of the Post method response.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Katanox\Api\BookingsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$booking_id = 'booking_id_example'; // string | The ID of the booking
$authorization = 'authorization_example'; // string | Type 'Bearer' and then your API Token
try {
$result = $apiInstance->getBookingById($booking_id, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BookingsApi->getBookingById: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
booking_id | string | The ID of the booking | |
authorization | string | Type 'Bearer' and then your API Token |
\Katanox\Model\HttpBookingResponse
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getReservationById($booking_id, $reservation_id, $authorization): \Katanox\Model\HttpReservationResponse
Retrieve a reservation by id
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Katanox\Api\BookingsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$booking_id = 'booking_id_example'; // string | The ID of the booking
$reservation_id = 'reservation_id_example'; // string | The ID of the reservation
$authorization = 'authorization_example'; // string | Type 'Bearer' and then your API Token
try {
$result = $apiInstance->getReservationById($booking_id, $reservation_id, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BookingsApi->getReservationById: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
booking_id | string | The ID of the booking | |
reservation_id | string | The ID of the reservation | |
authorization | string | Type 'Bearer' and then your API Token |
\Katanox\Model\HttpReservationResponse
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateReservation($booking_id, $reservation_id, $authorization, $http_reservation_update_request): \Katanox\Model\HttpReservationResponse
Update a reservation
When updating a Reservation, send in the entire reservation with its desired state. Note that this is not a partial update - all fields, specified or not, will be persisted to the existing Reservation object. To add an additional guest, update or delete an existing guest, send a guest list with the necessary changes. The list in the update reservation request will update the associated guests in that reservation. You can find more information in the Reservation guide
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Katanox\Api\BookingsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$booking_id = 'booking_id_example'; // string | The id of the booking
$reservation_id = 'reservation_id_example'; // string | The id of the reservation
$authorization = 'authorization_example'; // string | Type 'Bearer' and then your API Token
$http_reservation_update_request = new \Katanox\Model\HttpReservationUpdateRequest(); // \Katanox\Model\HttpReservationUpdateRequest | The reservation body
try {
$result = $apiInstance->updateReservation($booking_id, $reservation_id, $authorization, $http_reservation_update_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling BookingsApi->updateReservation: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
booking_id | string | The id of the booking | |
reservation_id | string | The id of the reservation | |
authorization | string | Type 'Bearer' and then your API Token | |
http_reservation_update_request | \Katanox\Model\HttpReservationUpdateRequest | The reservation body |
\Katanox\Model\HttpReservationResponse
No authorization required
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]