Update a booking
curl --request PATCH \
--url https://clarus-api.com/api/bookings/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "bookings",
"attributes": {
"account_id": 1,
"account_reference": "<string>",
"booking_reference": "<string>",
"consignment_reference": "<string>",
"container_number": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"haulier": "<string>",
"hazardous": true,
"location_id": 100,
"notes": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"storage_unit_quantity": 123
}
}
}
'import requests
url = "https://clarus-api.com/api/bookings/{id}"
payload = { "data": {
"type": "bookings",
"attributes": {
"account_id": 1,
"account_reference": "<string>",
"booking_reference": "<string>",
"consignment_reference": "<string>",
"container_number": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"haulier": "<string>",
"hazardous": True,
"location_id": 100,
"notes": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"storage_unit_quantity": 123
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'bookings',
attributes: {
account_id: 1,
account_reference: '<string>',
booking_reference: '<string>',
consignment_reference: '<string>',
container_number: '<string>',
end_time: '2023-11-07T05:31:56Z',
haulier: '<string>',
hazardous: true,
location_id: 100,
notes: '<string>',
start_time: '2023-11-07T05:31:56Z',
storage_unit_quantity: 123
}
}
})
};
fetch('https://clarus-api.com/api/bookings/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "bookings",
"attributes": {
"account_id": 1,
"consignment_reference": "CONS-2024-001",
"direction": "inbound",
"end_time": "2024-09-15T09:00:00Z",
"hazardous": false,
"location_id": 10,
"start_time": "2024-09-15T08:00:00Z",
"status": "pending",
"haulier": "DHL Express",
"intake_type": "full_load",
"storage_unit_quantity": 20,
"notes": "Fragile goods - handle with care"
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Bookings
Update a booking
Update an existing booking’s attributes such as times, status, or details.
PATCH
/
api
/
bookings
/
{id}
Update a booking
curl --request PATCH \
--url https://clarus-api.com/api/bookings/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "bookings",
"attributes": {
"account_id": 1,
"account_reference": "<string>",
"booking_reference": "<string>",
"consignment_reference": "<string>",
"container_number": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"haulier": "<string>",
"hazardous": true,
"location_id": 100,
"notes": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"storage_unit_quantity": 123
}
}
}
'import requests
url = "https://clarus-api.com/api/bookings/{id}"
payload = { "data": {
"type": "bookings",
"attributes": {
"account_id": 1,
"account_reference": "<string>",
"booking_reference": "<string>",
"consignment_reference": "<string>",
"container_number": "<string>",
"end_time": "2023-11-07T05:31:56Z",
"haulier": "<string>",
"hazardous": True,
"location_id": 100,
"notes": "<string>",
"start_time": "2023-11-07T05:31:56Z",
"storage_unit_quantity": 123
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'bookings',
attributes: {
account_id: 1,
account_reference: '<string>',
booking_reference: '<string>',
consignment_reference: '<string>',
container_number: '<string>',
end_time: '2023-11-07T05:31:56Z',
haulier: '<string>',
hazardous: true,
location_id: 100,
notes: '<string>',
start_time: '2023-11-07T05:31:56Z',
storage_unit_quantity: 123
}
}
})
};
fetch('https://clarus-api.com/api/bookings/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "bookings",
"attributes": {
"account_id": 1,
"consignment_reference": "CONS-2024-001",
"direction": "inbound",
"end_time": "2024-09-15T09:00:00Z",
"hazardous": false,
"location_id": 10,
"start_time": "2024-09-15T08:00:00Z",
"status": "pending",
"haulier": "DHL Express",
"intake_type": "full_load",
"storage_unit_quantity": 20,
"notes": "Fragile goods - handle with care"
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "bookings",
"attributes": {
"status": "arrived",
"notes": "Driver arrived at gate 3"
}
}
}
Key Fields
All fields are optional on update. See the create endpoint for the full field reference.Status Transitions
| From | Allowed To |
|---|---|
pending | arrived, departed, fail_to_arrive, cancelled |
arrived | departed, cancelled |
departed | (terminal) |
fail_to_arrive | (terminal) |
cancelled | (terminal) |
pending from any other status (error code 298).
Slot Re-validation
Changingstart_time, end_time, or location_id triggers slot availability re-validation (opening times compliance and overlap detection). The same validation rules as the create endpoint apply.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.
Path Parameters
The unique identifier of the booking to update
Body
application/json
Show child attributes
Show child attributes
Response
Booking updated successfully
Show child attributes
Show child attributes
⌘I

