Taxi Supplier API

References

Send a driver event

The booking driver events endpoint allows driver events to be pushed to the booking.

POST /v1/bookings/:customerReference/:bookingReference/driver/events

Note

Apart from the DRIVER_LIVE_LOCATION event you should not send the same event type multiple times. If duplicate events are received, we will only acknowledge the first event for each type.

Note

DRIVER_LIVE_LOCATION is only required for live driver tracking. For live driver tracking to work these requests must also contain latitude and longitude.

Live driver tracking

In order to support supply partners sending the live driver location during a journey, we have introduced a new event type: DRIVER_LIVE_LOCATION on the existing driver events endpoint in Public API.

As a Booking.com Taxi supply partner, we will expect you to call the endpoint with the DRIVER_LIVE_LOCATION event, every 5 seconds. The event must contain the GPS coordinates for the driver’s current location.

We will then use these coordinates to provide real-time updates to our shared customer as the ride is being fulfilled. Driver tracking will only start once the first event has been received and will terminate when the ride has been marked as completed, using the DRIVER_ARRIVED_AT_DROPOFF event. Once this event has been sent you should stop sending DRIVER_LIVE_LOCATION updates.

Request

Field Type Description Required
event_type String One of the following:

DRIVER_DEPARTED_TO_PICKUP
DRIVER_ARRIVED_AT_PICKUP
DRIVER_SUBMITTED_CUSTOMER_NO_SHOW
DRIVER_DEPARTED_TO_DROPOFF
DRIVER_ARRIVED_AT_DROPOFF
DRIVER_LIVE_LOCATION
Yes
latitude Float The latitude where the event occurred. No
longitude Float The longitude where the event occurred. No
occurred_at String The datetime the event occurred in UTC (ISO 8601). Yes
driver_id String The ID representing the driver. No

Sample Request

{
    "event_type": "DRIVER_DEPARTED_TO_PICKUP",
    "latitude": 53.4883114,
    "longitude": -2.2522131,
    "occurred_at": "2020-08-28T12:05:01Z",
    "driver_id": "10000099"
}
{
  "event_type": "DRIVER_LIVE_LOCATION",
  "latitude": -53.48114132029327,
  "longitude": -2.240334330665471,
  "occurred_at": "2020-11-17T12:05:01Z"
}

Response

HTTP 200 - OK

{
  "message": "event sent successfully"
}

HTTP 400 - Bad Request

{
  "message": "Invalid Input Parameter",
  "description": "Invalid driver_id Provided driver_id is not matching with assigned driver_id"
}

HTTP 400 - Bad Request

{
"message": "Invalid Input Parameter",
"description": "Event time is after current time"
}

HTTP 400 - Bad Request

{
"message": "Invalid Input Parameter",
"description": "Event time is before driver assignation time"
}

HTTP 400 - Bad Request

{
"message": "Invalid Input Parameter",
"description": "Unable to validate <EventName> event after last event submitted <LastEventName>"
}

HTTP 400 - Bad Request

{
"message": "Invalid Input Parameter",
"description": "Event <EventName> not allowed after last event submitted <LastEventName>"
}

HTTP 400 - Bad Request

{
"message": "Invalid Input Parameter",
"description": "Event time is before last event time"
}

HTTP 400 - Bad Request

{
"message": "Invalid Input Parameter",
"description": "Event <EventName> not allowed as first event"
}

HTTP 401 - Unauthorised

{
  "message": "Invalid Authorization Token",
  "description": "Invalid authorization token in header"
}

HTTP 404 - Not found

{
  "message": "Not Found",
  "description": "Booking Not Found"
}