To create a booking, make the following API request:
POST /api/beta/vehicles/{vehicle_id}/bookings
{
"customer_name": "John Smith",
"customer_phone_number": "+44 1623 661787",
"from_position": {
"lat": 50.0,
"lng": 1.0,
},
"to_position": {
"lat": 52.0,
"lng": 2.0,
}
}
{vehicle_id}
- (string) The ID of the Vehicle being booked (discovered when Finding vehicles)customer_name
- (string) The name of the customer making the bookingcustomer_phone_number
- (string) Phone number on which the customer maybe reachedfrom_position
- (geo object) Pick-up positionto_position
- (geo object) Destination positionOnce created, you’ll get a 201 Created
response with the following body:
{
"booking_id": "abc123",
"status": "pending"
}
booking_id
- (string) Unique ID for the bookingstatus
- (string) The status of the bookingWhen a booking is created, the vehicle-booking-create webhook is triggered.
Once you have created a booking, you can check its status by getting the Booking.