Cancel existing booking
Cancel existing bookings to free up time slots. This endpoint helps manage no-shows, customer cancellations, and schedule adjustments efficiently.
There are two endpoints for cancelling a booking:
- cancel_by_customer: This endpoint cancels a booking on behalf of the customer.
- cancel_by_resource: This endpoint cancels a booking from the resource’s side.
Authentication
This endpoint needs app token for authentication.
Method | PUT |
---|---|
Token Type | App Token |
Endpoint | v1/bookings/:uuid/cancel_by_resource |
v1/bookings/:uuid/cancel_by_customer | |
Headers | Accept: application/json |
Authorization: Bearer <base64_encoded_token> |
Cancel By Customer Request Body:
This endpoint requires following parameters to be sent via post body:
Endpoint | Param Name | Required | Description |
---|---|---|---|
cancel_by_customer | customer_id | true | Customer who is cancelling |
cancellation_message | true | Reason for cancellation for customer |
Example Cancel By Customer:
The following code shows how to send request when customer cancellation required:
- PHP
- NodeJS
require 'vendor/autoload.php';
use Slotify\Slotify;
$slotify = new Slotify('your_api_key');
$response = $slotify->cancelBookingByCustomer("fake-booking-uuid-1234", [
"customer_id" => "fake-customer-uuid-5678",
"cancellation_message" => "I am out of town"
]);
if ($response->isSuccess()) {
echo "Booking cancelled by customer successfully!";
} else {
echo "Failed to cancel booking by customer: " . $response->getError();
}
const Slotify = require('slotify-sdk');
const slotify = new Slotify({ apiKey: 'your_api_key' });
slotify.cancelBookingByCustomer("fake-booking-uuid-1234", {
customer_id: "fake-customer-uuid-5678",
cancellation_message: "I am out of town"
})
.then(response => {
console.log("Booking cancelled by customer successfully:", response);
})
.catch(error => {
console.error("Failed to cancel booking by customer:", error);
});
Cancel By Resource Request Body:
This endpoint requires following parameters to be sent via post body:
Endpoint | Param Name | Required | Description |
---|---|---|---|
cancel_by_resource | resource_id | true | Resource uuid who is cancelling |
cancellation_message | true | Reason for cancellation for resource |
Example Cancel By Resource:
The following code shows how to send request when resource cancellation required:
- PHP
- NodeJS
require 'vendor/autoload.php';
use Slotify\Slotify;
$slotify = new Slotify('your_api_key');
$response = $slotify->cancelBookingByResource("fake-booking-uuid-1234", [
"resource_id" => "fake-resource-uuid-5678",
"cancellation_message" => "I am out of town"
]);
if ($response->isSuccess()) {
echo "Booking cancelled by resource successfully!";
} else {
echo "Failed to cancel booking by resource: " . $response->getError();
}
const Slotify = require('slotify-sdk');
const slotify = new Slotify({ apiKey: 'your_api_key' });
slotify.cancelBookingByResource("fake-booking-uuid-1234", {
resource_id: "fake-resource-uuid-5678",
cancellation_message: "I am out of town"
})
.then(response => {
console.log("Booking cancelled by resource successfully:", response);
})
.catch(error => {
console.error("Failed to cancel booking by resource:", error);
});
Example Response:
The following response will be provided by Slotify server when this endpoint is called:
- 204 No Content