Create a booking
Bookings
Create a booking
Create a new booking diary entry for scheduling an inbound or outbound dock appointment.
POST
Create a booking
Request Structure
Required Fields
| Field | Type | Description |
|---|---|---|
account_id | integer | Stock account ID (owner of the goods) |
location_id | integer | Dock location ID (must have available_in_booking_diary enabled) |
consignment_reference | string | Consignment reference number |
direction | string | One of: inbound, outbound |
hazardous | boolean | Whether the goods are hazardous |
start_time | datetime | Booking start time (ISO 8601) |
end_time | datetime | Booking end time (must be after start_time) |
Optional Fields
| Field | Type | Description |
|---|---|---|
account_reference | string | Account’s own reference |
booking_reference | string | Booking reference number |
container_number | string | Container number (for container intake) |
haulier | string | Haulier/carrier name |
intake_type | string | One of: container, part_load, full_load |
notes | string | Free text notes |
status | string | One of: pending, arrived, departed, fail_to_arrive, cancelled (default: pending) |
storage_unit_quantity | integer | Expected number of storage units (e.g., pallets) |
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:- Query eligible locations - Find locations where
available_in_booking_diaryis true (via GraphQL) - Query existing bookings - Retrieve bookings for the target date range and location (via GraphQL)
- Calculate gaps - Identify time gaps that fall within the location’s opening hours for the target day of week
- Create booking - POST /bookings with the chosen slot
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
application/json
Response
Booking created successfully

