Booking object

A Booking is represented by the Booking object, described in this section.

Example Booking

Use the following API to get an example Booking:

GET /api/beta/bookings/example

Response:

{
	"booking": {
		"id": "aghkZXZ-Tm9uZXIUCxIHVmVoaWNsZSIHZXhhbXBsZQw",
		"ctime": "2017-10-24 11:45:02.188 GMT",
		"mtime": "2017-10-24 11:58:01.022 GMT",
		"our_ref": "21",
		"vehicle_id": "aghkZXZ-Tm9uZXIUCxIHVmVoaWNsZSIHZXhhbXBsZQw",
		"vehicle_our_ref": "123",
		"when": "now",
		"status": "pending",
		"error": "something went wrong",
		"customer_name": "John Smith",
		"customer_phone_number": "+44 1623 661787",
		"totals": {
			"currency": "EUR",
			"surge": 0.0,
			"extras": 0.0,
			"gross": 10.0
			"code": "spring",
			"discount": 2.0,
			"net": 8.0,
			"tax": 2.3,
			"total": 10.3,
		},
		"from_user_id": "aghkZXZ-Tm9uZXIUCxIHVmVoaWNsZSIHZXhhbXBsZQw",
		"to_user_id": "aghkZXZ-Tm9uZXIUCxIHVmVoaWNsZSIHZXhhbXBsZQw",
		"from_position": {
			"lat": 1,
			"lng": 2
		},
		"from_label": "Longford TW6, UK",
		"to_position": {
			"lat": 3,
			"lng": 4
		},
		"to_label": "Trafalgar Square, London WC2N 5DN, UK",
		"webhooks": {
			"booking_status_changed": "https://my-server.com/opentransport/webhooks/booking/status-changed"
		}
	}
}
  • id - (string) Unique ID of the Booking
  • ctime- (time) create time (internal)
  • mtime- (time) modify time (internal)
  • when- (string) The value for when the booking will happen
  • our_ref - (string) Third-party reference of this booking
  • vehicle_id - (string) ID of the Vehicle being booked
  • vehicle_our_ref - (string) External reference of the vehicle being booked
  • status - (string) The current status of the Booking (see Booking status)
  • error - (string) An error message if something went wrong with the booking
  • customer_name - (string) The name of the customer
  • customer_phone_number - (string) The phone number of the customer
  • from_user_id - (string) The ID of the user who initiated the booking
  • to_user_id - (string) The ID of the user who owns the Vehicle
  • from_position - (geo object) The starting point of the journey
  • from_label - (string) The address of the starting point of the journey
  • to_position - (geo object) The ending point of the journey
  • to_label - (string) The address of the ending point of the journey
  • webhooks - (object) An object describing the Booking Webhooks
  • totals - (object) An object representing the billing fields of the booking, managed by the developer (all values computed by the developer)

See also