Bookable Taxi Integration Guide
  • 18 Apr 2024
  • 6 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Bookable Taxi Integration Guide

  • Dark
    Light
  • PDF

Article Summary

Integration Guide For Bookable Taxi

For existing Despatch APIs we will attempt to map the payload into our bookable interface. However the minimum information & functionality would be required from the API.

Minimum End User Details

  • UserId - A unique id representing the end user
  • PhoneNumber - A telephone number, usually mobile number
  • Name - the name of the end user.
  • Active Journey's
    * JourneyId
    * Status
    * Pickup Date/Time
    * Pickup Location
    * Drop Off Location(s)

Minimum API Functionality

  • Get User Details
  • Book a journey
  • Cancel a journey
  • Get Status of a journey

Recommended API

For Despatch designing a new API to enable Bookable, we recommend the following specification.

Despatch software may return some or all of this data. We incremently build out the end user experience based on the completeness of the response.

For example, if the location is present, and the channel is WhatsApp, when a user requests a status of their journey, or the status or journey changes, we will send a WhatsApp location message.

If Vehicle and Driver payloads are available then we will pass this information onto customer. If a driver has arrived and a driver phone number is present, we give the option to the end user to let the driver know they are "Coming Now"

Features such as Coming Now and details such as Driver name, badgeNumber, Vehicle description, registration can all be toggled on or off in the plugin settings per customer requirements.

No phone numbers are exposed to end user or driver at any time.

Authentication

We leave this up to the 3rd party to determine what is best for their use case.

POST /config

Request Body

This will be invoked on initation of each customer request

{
   "data" : { 
        "features" : [ "voice", "whatsapp" ]
        "options": [
            "jobID",
            "vehicle",
            "vehicleReg",
            "eta",
            "driverName",
            "comingNow",
            "callDriver",
            "cancel"
	  ],
      "skipDropOff": false,
    ...
   }
}
PropertyDescriptionRequired?
dataTaxi data object which is set on the plugin which will be passed to the 3rd party endpointfalse

Response Body

{
  "status" : "enabled",
  "eta" :  {
       "value" : 10,
       "unit" : "minutes"
  },
   "data" : {  ... }
}
PropertyDescriptionRequired?
statuscurrent system statustrue
etaETA estimated time of arrivalfalse
dataTaxi data object, fields returned in this payload will overwrite the static configuration allowing 3rd party to turn on/off features, languages etcfalse

POST /user

Request Body

{
  "phoneNumber" : "447777777777",
  "data" : {
     "companyName": "My Taxi Company",
     "activeBookings" : "true"
     ...
  }
}
PropertyDescriptionRequired?
phoneNumberThe end users phone number in E164 format. For example 447777777777true
dataTaxi data which is set on the plugin which will be passed to the 3rd party endpointfalse

Response Body

{
    "userId" : "user1234",
    "phoneNumber" : "44777777777",
    "name" :  "John Smith",
    "status" : "ENABLED",
    "data" :  {
        "features" : [ "whatsapp" ],
        "options": [
            "jobID",
            "vehicle",
            "vehicleReg",
            "eta",
            "driverName"
	    ],
        "skipDropOff": true,
    },
    "activeBookings" : [
        {
            "journeyId" : "2468",
            "status" : "ACCEPTED",
            "eta" :  {
                "value" : 10,
                "unit" : "minutes"
            },
            "price" :  {
                "value" : 9.99,
                "currency" : "GBP",
                "type" : "ESTIMATE"
            },
            "date" : "2023-10-07T19:35:33.801+00:00",
            "pickup": {
                "address" : "1 Kings Rd, Brighton and Hove, Brighton BN1 2FA",
                "location" : {
                     "longitude" : 50.82137100634119,
                     "latitude" :  -0.14762783092575613
                }
            },
            "dropoffs": [
                {
                    "address" : "52-55 Trafalgar St, Brighton and Hove, Brighton BN1 4EB",
                    "location" : {
                         "longitude" :50.82859562173957,
                         "latitude" :  -0.14083647771680116
                    }
                }
            ],
            "passenger" : {
                 "phoneNumber" : "44777777777",
                 "name" :  "John Smith",
            },
            "vehicle" : {
                "description" : "White Toyota",
                "registration" : "WV60 FLL"
            },
            "driver" : {
                "name" :  "Joe Schmoe",
                "phoneNumber" : "447888888888",
                "badgeNumber" : "1234"
            },
            "location" : {
                "longitude" : 50.8188111828403, 
                "latitude" : -0.13869175552866123
            }
        }
    ]
}
PropertyDescriptionRequired
userIdend user idtrue
phoneNumberend user phone numbertrue
nameend user nametrue
statusstatus of end user : ENABLED, DISABLED, BLACKLISTEDfalse
featuresarray of user features overridesfalse
activeBookingsarray of Journeyfalse

POST /book

Request Body

{
   "userId" : "user1234",
   "name" : "John Smith",
   "phoneNumber" :  "44777777777",
   "pickup" : {
     "address" : "1 Kings Rd, Brighton and Hove, Brighton BN1 2FA",
     "location" : {
        "longitude" : 50.82137100634119,
        "latitude" :  -0.14762783092575613
     }
  },
   "dropoffs": [
        {
            "address" : "52-55 Trafalgar St, Brighton and Hove, Brighton BN1 4EB",
            "location" : {
                 "longitude" :50.82859562173957,
                 "latitude" :  -0.14083647771680116
            }
        }
   ],
   "pickupTime" : "2023-10-08T20:00:00.000+00:00",
   "vehicleCategory" : "Saloon",
   "data" : { ... }
}
PropertyDescriptionRequired
journeyIdif present then edit booking, null value will create bookingfalse
userIduser id (if known)false
namename of passengertrue
phoneNumberend users phone number in E164 formattrue
pickupAddress the pickup addresstrue
dropoffsArray of Address the destination addressestrue (at least 1)
pickupTimeISO 8601 formatted date stringtrue
vehicleCategorytype of vehiclefalse
dataarbitory data which can be set on the plugin which will be passed to the 3rd party endpointfalse

Response Body

{
    "journeyId": "2468",
    "status" : "ACCEPTED"
    ...
}
PropertyDescriptionRequired
journeyIdthe journey idtrue
statusthe current statustrue

POST /cancel

Request Body

{
    "userId" : "user1234"
    "journeyId" : "2468",
}
PropertyDescriptionRequired
userIdthe user idtrue
namethe journey idtrue

Response Body

{
    "journeyId": "2468",
    "status" : "CANCELLED",
    ...
}
PropertyDescriptionRequired
journeyIdthe journey idtrue
statusthe current statustrue

POST /status

Request Body

{
    "userId" : "user1234"
    "journeyId" : "2468",
}
PropertyDescriptionRequired
userIdthe user idtrue
namethe journey idtrue

Response Body

{
            "journeyId" : "2468",
            "status" : "EN_ROUTE",
            "eta" :  {
                "value" : 10,
                "unit" : "minutes"
            },
            "price" :  {
                "value" : 9.99,
                "currency" : "GBP",
                "type" : "ESTIMATE"
            },
            "pickup": {
                "address" : "1 Kings Rd, Brighton and Hove, Brighton BN1 2FA",
                "location" : {
                     "longitude" : 50.82137100634119,
                     "latitude" :  -0.14762783092575613
                }
            },
            "dropoffs": [
                {
                    "address" : "52-55 Trafalgar St, Brighton and Hove, Brighton BN1 4EB",
                    "location" : {
                         "longitude" :50.82859562173957,
                         "latitude" :  -0.14083647771680116
                    }
                }
            ],
            "passenger" : {
                 "phoneNumber" : "44777777777",
                 "name" :  "John Smith",
            },
            "vehicle" : {
                "description" : "White Toyota",
                "registration" : "WV60 FLL"
            },
            "driver" : {
                "name" :  "Joe Schmoe",
                "phoneNumber" : "447888888888",
                "badgeNumber" : "1234"
            },
            "location" : {
                "longitude" : 50.8188111828403, 
                "latitude" : -0.13869175552866123
            }
        }
PropertyDescriptionRequired
journeyIdthe journey idtrue
statusthe current statustrue
See Journey Object

Objects

Journey Object

PropertyDescriptionRequired
journeyIdjourney idtrue
dateISO 8601 formatted date stringtrue
statuscurrent status of journey. see Valid Statusestrue
etaETA estimated time of arrivalfalse
pricePrice the journey pricefalse
pickupAddress the pickup addresstrue
dropoffsArray of Address the destination addressestrue
passengerPassenger may be a different value to the end userfalse
vehicleVehicle the vehicle detailsfalse
driverDriver the driver detailsfalse
locationPoint current location of vehiclefalse

ETA Object

PropertyDescriptionRequired
valueamount of timetrue
unitunit of measure, for example "minutes"true

Price Object

PropertyDescriptionRequired
valueprice amounttrue
currencyprice currencytrue
typeenum - ESTIMATED, FIXED, MINIMUM, MAXIMUMfalse

Address Object

PropertyDescriptionRequired
addressfull address including postcodetrue
locationPoint coordinatestrue

Passenger Object

PropertyDescriptionRequired
phoneNumberpassenger phone numbertrue
namepassengerr nametrue

Vehicle Object

PropertyDescriptionRequired
descriptiondescription of vehicletrue
registrationnumber plate of vehicletrue

Driver Object

PropertyDescriptionRequired
namename of drivertrue
phoneNumberphoneNumber of drivertrue
badgeNumberregistered badge number of drivertrue

Point Object

PropertyDescriptionRequired
longitudextrue
latitudeytrue

Valid Journey Statuses

StatusDescription
HELDJourney has been held by despatch
WAITINGJourney is waiting to be allocated to driver
ACCEPTEDJourney has been accepted by driver
EN_ROUTEVehicle is en route
ARRIVEDVehicle has arrived
POBPassenger is on board vehicle
COMPLETEJourney has completed