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.

MethodPUT
Token TypeApp Token
Endpointv1/bookings/:uuid/cancel_by_resource
v1/bookings/:uuid/cancel_by_customer
HeadersAccept: application/json 
Authorization: Bearer <base64_encoded_token> 

Cancel By Customer Request Body:

This endpoint requires following parameters to be sent via post body:

EndpointParam NameRequiredDescription
cancel_by_customercustomer_idtrueCustomer who is cancelling
cancellation_messagetrueReason 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:

EndpointParam NameRequiredDescription
cancel_by_resourceresource_idtrueResource uuid who is cancelling
cancellation_messagetrueReason 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