Skip to main content
POST
Create a booking

Request Structure

Required Fields

Optional Fields

Slot Availability Validation

The system validates that the requested time slot is available before creating the booking.

Opening Times Compliance

The location (or its parent warehouse) may have opening times configured. Opening hours vary by day of week, so the system checks the specific day’s hours for both start and end times. Error Response (code 295):

No Overlapping Bookings

The system uses time range overlap detection to ensure no other booking exists at the same location during the requested period. Error Response (code 296):

Finding Available Slots Workflow

To find an available time slot before creating a booking:
  1. Query eligible locations - Find locations where available_in_booking_diary is true (via GraphQL)
  2. Query existing bookings - Retrieve bookings for the target date range and location (via GraphQL)
  3. Calculate gaps - Identify time gaps that fall within the location’s opening hours for the target day of week
  4. Create booking - POST /bookings with the chosen slot

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
data
object
required

Response

Booking created successfully

data
object