The Booking model

The Booking object

AttributeTypeDescription
idstringThe unique identifier for the booking.
modifiedstringThe time this booking was last modified.
startstringThe start time of the booking (e.g. earliest departure).
endstringThe end time of the booking (e.g. latest arrival).
typestringThe service type of the booking.
  • flight
  • hotel
  • train
  • car
  • other
statusstringThe status of the booking.
  • confirmed
  • cancelled
trip_idstringThe id of the trip this booking belongs to.
referencesarray[object]References to this booking used by external entities. Check table below for more information.
locationobjectThe service location. Populated when type is hotel or car. Check Booking Location Object below.
drop_off_locationobjectOnly for Car Bookings, null otherwise. The drop off location for the car. Check Booking Location Object below.
legsarray[object]The transport legs. Populated when type is flight or train. Check table below for more information.

Booking reference object

The JSON examples below contain all potential references that may be present, dependent on Booking type.

AttributeTypeDescription
typestringHow to interpret the reference value.
  • PNR
  • voucher_code
  • confirmation_number
  • ticket_collection_reference
valuestringReference value.

Booking location object

AttributeTypeDescription
latitudestringLatitude in degrees.
longitudestringLongitude in degrees.
iata_codestringIATA airport code if applicable, null otherwise.
namestringName of the location
addressstringAddress information

Booking leg objects

AttributeTypeDescription
segmentsarray[object]Array of segments. Check table below for more information.

Booking segment object

A journey in a single vehicle

AttributeTypeDescription
originobjectA waypoint. Check table below for more information.
destinationobjectA waypoint. Check table below for more information.
external_idstringThe journey identifier, such as a flight number.

Booking waypoint (origin or destination) object

AttributeTypeDescription
locationobjectCheck table describing Booking location above for more information.
timestringDeparture or arrival time in the local time with offset.
{
  "id":"71",
  "start":"2021-03-06T00:00:00+00:00",
  "end":"2021-03-09T00:00:00+00:00",
  "type":"hotel",
  "status":"ticketed",
  "modified":"2021-02-22T11:11:20.714987+00:00",
  "trip_id":"51",
  "references":[
    {
      "type":"confirmation_number",
      "value":"4636"
    }
  ],
  "location":{
    "name": "hotel name",
    "address": "hotel address",
    "latitude":"59.5468062",
    "longitude":"113.9913155",
    "iata_code":null
  },
  "drop_off_location":null,
  "legs":null
}
{
  "id":"73",
  "start":"2021-03-06T00:00:00+00:00",
  "end":"2021-03-09T00:00:00+00:00",
  "type":"car",
  "status":"ticketed",
  "modified":"2021-02-22T11:11:20.714987+00:00",
  "trip_id":"51",
  "references":[
    {
      "type":"voucher_code",
      "value":"voucher_12"
    },
    {
      "type":"confirmation_number",
      "value":"cn_17"
    }
  ],
  "location":{
    "latitude":-56.0,
    "longitude":-62.0,
    "iata_code":null,
    "name": "station name",
    "address": "station address"
  },
  "drop_off_location":{
    "latitude":-66.0,
    "longitude":-72.0,
    "iata_code":null,
    "name": "drop off station name",
    "address": "drop off station address"
  },
  "legs":null
}
{
  "id":"70",
  "start":"2021-03-06T00:00:00+00:00",
  "end":"2021-03-09T00:00:00+00:00",
  "type":"flight",
  "status":"ticketed",
  "modified":"2021-02-22T11:11:20.714987+00:00",
  "trip_id":"51",
  "references":[
    {
      "type":"PNR",
      "value":"HNTCEBSMPO"
    }
  ],
  "location":null,
  "drop_off_location":null,
  "legs":[
    {
      "segments":[
        {
          "origin":{
            "location":{
              "latitude":"85.5975436",
              "longitude":"18.7959996",
              "iata_code":"UYM",
              "name": "Airport name",
              "address": null
            },
            "time":"2021-03-06T00:00:00+01:00"
          },
          "destination":{
            "location":{
              "latitude":"-54.3854772",
              "longitude":"81.6402173",
              "iata_code":"EKD",
              "name": "Airport name",
              "address": null
            },
            "time":"2021-03-07T12:00:00+01:00"
          },
          "external_id":"XX1234"
        },
        {
          "origin":{
            "location":{
              "latitude":"67.1291014",
              "longitude":"21.1347543",
              "iata_code":"IWP",
              "name": "Airport name",
              "address": null
            },
            "time":"2021-03-08T00:00:00+01:00"
          },
          "destination":{
            "location":{
              "latitude":"8.6677113",
              "longitude":"-13.9691879",
              "iata_code":"TMQ",
              "name": "Airport name",
              "address": null
            },
            "time":"2021-03-09T12:00:00+01:00"
          },
          "external_id":"XX1234"
        }
      ]
    },
    {
      "segments":[
        {
          "origin":{
            "location":{
              "latitude":"23.5841460",
              "longitude":"-141.9148137",
              "iata_code":"UJH",
              "name": "Airport name",
              "address": null
            },
            "time":"2021-03-10T12:00:00+01:00"
          },
          "destination":{
            "location":{
              "latitude":"-6.0933315",
              "longitude":"-7.6775088",
              "iata_code":"ZVO",
              "name": "Airport name",
              "address": null
            },
            "time":"2021-03-11T00:00:00+01:00"
          },
          "external_id":"XX1234"
        },
        {
          "origin":{
            "location":{
              "latitude":"78.4132615",
              "longitude":"-156.7342795",
              "iata_code":"OJR",
              "name": "Airport name",
              "address": null
            },
            "time":"2021-03-12T12:00:00+01:00"
          },
          "destination":{
            "location":{
              "latitude":"-44.6617225",
              "longitude":"163.2773819",
              "iata_code":"YNX",
              "name": "Airport name",
              "address": null
            },
            "time":"2021-03-13T00:00:00+01:00"
          },
          "external_id":"XX1234"
        }
      ]
    }
  ]
}
{
  "id":"72",
  "start":"2021-03-06T00:00:00+00:00",
  "end":"2021-03-09T00:00:00+00:00",
  "type":"train",
  "status":"ticketed",
  "modified":"2021-02-22T11:11:20.714987+00:00",
  "trip_id":"51",
  "references":[
    {
      "type":"ticket_collection_reference",
      "value":"PMXFIQ"
    }
  ],
  "location":null,
  "drop_off_location":null,
  "legs":[
    {
      "segments":[
        {
          "origin":{
            "location":{
              "latitude":"-73.000000000",
              "longitude":"-26.000000000",
              "iata_code":null,
              "name": "Train station name",
              "address": "Train station address"
            },
            "time":"2021-03-06T00:00:00+00:00"
          },
          "destination":{
            "location":{
              "latitude":"-30.000000000",
              "longitude":"83.000000000",
              "iata_code":null,
              "name": "Train station name",
              "address": "Train station address"
            },
            "time":"2021-03-09T00:00:00+00:00"
          },
          "external_id":"XX1234"
        }
      ]
    }
  ]
}

Our spectacular Customer Care team may book a service that is not automated in the Perk platform, such as an airport transfer. In these cases, the Booking type will be other. Note that unlike Trip, when a Booking is cancelled, start and end will retain their values.

{
  "id":"118",
  "start":"2021-03-06T00:00:00+00:00",
  "end":"2021-03-07T00:00:00+00:00",
  "type":"other",
  "status":"cancelled",
  "modified":"2021-03-06T11:12:12.071963+00:00",
  "trip_id":"63",
  "references":[
    
  ],
  "location":null,
  "drop_off_location":null,
  "legs":null
}