latestOpenAPI 3.0.12026-08-15202774.6 KB

cdae4166b346

Bookings

Create a booking

Creates a new booking for a Lugg delivery service.

You can create a booking in three ways:

  • Using a quote: Provide quote_id + arrival window details
  • Two-stop booking: Provide origin + destination + product + arrival window details
  • Multi-stop booking: Provide stops array + product + arrival window details

Arrival window is required. Provide either arrival_window_id (from the schedules endpoint) or arrival_window_from for a custom future ISO 8601 time. arrival_window_to is optional and defaults to one hour after arrival_window_from. arrival_window_ref defaults to origin; use destination for dropoff-window scheduling. Booking can fail if the requested window cannot be reserved.

customer is optional and organization-only.

In the sandbox, set test_specifications.mode to auto to automatically dispatch and complete the booking through the normal webhook and billing flow. The simulation starts immediately and does not wait for the requested arrival-window time.

All other parameters are optional.

post/bookings

Request body

OR

Example request

{
  "stops": [
    {
      "location": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "origin": "123e4567-e89b-12d3-a456-426614174000",
  "destination": "123e4567-e89b-12d3-a456-426614174000",
  "product": "pickup",
  "customer": {
    "name": "John Doe",
    "email": "john@example.com",
    "phone_number": "+14155551234"
  },
  "contacts": [
    {
      "name": "Store Team",
      "phone_number": "+14155550100",
      "email": "store@example.com",
      "stop_positions": [
        0
      ]
    }
  ]
}

Response

Created