Skip to main content
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
    }
  }
}
'
{
  "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"
    }
  }
}

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

FromAllowed To
pendingarrived, departed, fail_to_arrive, cancelled
arriveddeparted, cancelled
departed(terminal)
fail_to_arrive(terminal)
cancelled(terminal)
Note: You cannot transition back to pending from any other status (error code 298).

Slot Re-validation

Changing start_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

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.

Path Parameters

id
integer
required

The unique identifier of the booking to update

Body

application/json
data
object
required

Response

Booking updated successfully

data
object