Itinerary Schema

The itinerary is one of the four primary Versa event types. It shares the same underlying schema as a receipt, booking, or invoice, but excludes all financial data (totals, taxes, payments, etc.) and is focused only on travel information. E-commerce itemizations are not supported.

A JSON Schema document and corresponding TypeScript Types are available on GitHub or via the @versa/schema package.

Wrapper

Itineraries use the same top-level wrapper as the Versa schema, but without the payments field.

FieldTypeDescription
schema_versionstringVersion of the schema; useful for validating the object.
headerobjectHeader.
itemizationobjectItemization object.
footerobjectThe footer includes supplemental text.

The header mirrors the schema header, but with all financial info (totals, etc.) removed.

FieldTypeDescription
third_partynullable objectThird party involved in the transaction, where applicable.
customernullable objectCustomer involved in the transaction, where applicable.

Itemization

The Itemization section describes the record of services that compose the itinerary. Based on the type of purchase, the object conforms to one of five templates: Car Rental, Flight, Lodging, Service, or Transit Route. Exactly one itemization template must be non-null.

"itemization": {
  "car_rental": null,
  "flight": { ... },
  "lodging": null,
  "service": null,
  "transit_route": null
}
Car Rental Object

Car Rental

View a complete car rental itinerary example.

"car_rental": {
  "rental_at": 1713196492,
  "return_at": 1713415500,
  "confirmation_number": null,
  "record_locator": null,
  "vendor_code": null,
  "rental_location": { ... },
  "return_location": { ... },
  "vehicle": {
    "description": "Polestar 2",
    "image": null
  },
  "drivers": [{ ... }],
  "odometer_reading_in": 100,
  "odometer_reading_out": 210,
  "items": [ ... ],
  "metadata": [],
}
FieldTypeDescription
rental_atintegerRental time. Measured in seconds since the Unix epoch.
return_atintegerReturn time. Measured in seconds since the Unix epoch.
confirmation_numbernullable stringRental confirmation number.
record_locatornullable stringPNR or booking record locator.
vendor_codenullable stringTwo-letter GDS vendor code, e.g. ZI for Avis, ZB for Budget.
rental_locationobjectA place describing the rental location.
return_locationobjectA place describing the return location.
vehicleobjectA vehicle object.
driversnullable arrayArray of person objects.
odometer_reading_innullable integer
odometer_reading_outnullable integer
itemsarrayAn array of generic item objects.
metadataarrayArray of metadata objects, for any additional info.

Vehicle

FieldTypeDescription
descriptionstringType of car.
imagenullable stringImage of car.
Flight Object

Flight

View a complete flight itinerary example.

FieldTypeDescription
ticketsarrayAn array of ticket objects.
itinerary_locatornullable string

Tickets

FieldTypeDescription
segmentsarrayArray of segments.
numbernullable string
record_locatornullable string
passengernullable objectA person object.
metadataarrayArray of metadata objects, for any additional info.

Segments

FieldTypeDescription
departure_airport_codestringThe three-letter IATA airport code that the flight departed from.
arrival_airport_codestringThe three-letter IATA airport code of the flight’s destination.
departure_atnullable integerDeparture time. Measured in seconds since the Unix epoch.
arrival_atnullable integerArrival time. Measured in seconds since the Unix epoch.
departure_tznullable stringA list of possible time zone values is maintained at the IANA Time Zone Database.
arrival_tznullable stringA list of possible time zone values is maintained at the IANA Time Zone Database.
flight_numbernullable stringThe two-letter IATA airline designator followed by a one to four digit number (e.g. 'DL123').
class_of_servicenullable string
seatnullable string
aircraft_typenullable stringThe ICAO code of the aircraft.
metadataarrayArray of metadata objects, for any additional info.
Lodging Object

Lodging

View a complete lodging itinerary example.

"lodging": {
  "check_in": 1713196492,
  "check_out": 1713473361,
  "confirmation_number": null,
  "chain_code": null,
  "property_id": null,
  "record_locator": null,
  "guests": [ ... ],
  "room": "806",
  "location": { ... },
  "items": [ ... ],
  "metadata": [],
}
FieldTypeDescription
check_inintCheck-in date-time. Measured in seconds since the Unix epoch.
check_outintCheck-out date-time. Measured in seconds since the Unix epoch.
confirmation_numbernullable stringHotel confirmation number.
chain_codenullable stringTwo-character chain code, e.g. MC for Marriott, HY for Hyatt.
property_idnullable stringProperty identifier. Examples: gds.sabre:19835, gds.amadeus:BWNYCMQ, chain.marriott:NYCMQ, giata:17324.
record_locatornullable stringPNR or booking record locator.
guestsnullable arrayArray of person objects.
roomnullable stringRoom number.
locationnullable objectA place object describing the hotel / lodging.
itemsarrayAn array of generic item objects. This includes the room rate, as well as incidentals / full folio.
metadataarrayArray of metadata objects, for any additional info.
Service Object

Service

For airport parking, SaaS subscriptions, phone bills, etc. View a complete service itinerary example.

"service": {
  "service_items": [{
    "service_location": {
      "name": "Cars R Park'd",
      "address": {
        "street_address": "2741 Camp Creek Parkway",
        "city": "College Park",
        "region": "GA",
        "postal_code": "30337",
        "country": "US",
        "tz": "America/New_York"
      }
    },
    "description": "Uncovered parking (1 month)",
    "current_period_start_at": 1679609767,
    "current_period_end_at": 1682288167,
    "metadata": []
  }]
}
FieldTypeDescription
service_itemsarrayAn array of service item objects.

Service Item

FieldTypeDescription
service_locationnullable objectA place object describing the location where the service was provided (e.g., parking lot, service center).
descriptionstringDescription of the service.
current_period_start_atnullable integerStart of the current period of the service. Measured in seconds since the Unix epoch.
current_period_end_atnullable integerEnd of the current period. Measured in seconds since the Unix epoch.
metadataarrayArray of key/value metadata pairs, e.g. SKU.
Transit Route Object

Transit Route

A route, typically used by rideshare / taxi services, or rail / bus / ferry / etc. View complete taxi itinerary or rail itinerary examples.

"transit_route": {
  "transit_route_items": [{
    "departure_address": {
      "street_address": "273 Sesame St",
      "city": "Brooklyn",
      "region": "NY",
      "country": "US",
      "postal_code": "11205",
      "lat": 40.68266,
      "lon": -73.94237,
      "tz": "America/New_York"
    },
    "arrival_address": {
      "street_address": "141 Broadway",
      "city": "Brooklyn",
      "region": "NY",
      "country": "US",
      "postal_code": "11205",
      "lat": 40.69954,
      "lon": -73.97064,
      "tz": "America/New_York"
    },
    "departure_at": 1713196492,
    "arrival_at": 1713197752,
    "passenger": null,
    "polyline": "syhwFxzhbMrFtdAmpAhOlGzmAi%5CdEaGEDgEoAEMfK",
    "metadata": [],
  }],
}
FieldTypeDescription
transit_route_itemsarrayArray of transit route item objects.

Transit Route Item

FieldTypeDescription
departure_locationobjectThe origin place object.
arrival_locationobjectThe destination place object.
departure_atnullable integerDeparture time. Measured in seconds since the Unix epoch.
arrival_atnullable integerArrival time. Measured in seconds since the Unix epoch.
modenullable enumOne of car, taxi, rail, bus, ferry, other.
passengernullable stringFor ticketed local transit, the passenger name.
polylinenullable stringAn encoded polyline of the route.
metadataarrayArray of key/value metadata pairs.
FieldTypeDescription
supplemental_textnullable stringTerms and conditions or other info. Supports Markdown.

Primitives

Foundational objects used throughout the schema.

Item Primitive

Item

A generic line item.

{
  "description": "Blue Cheese Crumbles",
  "quantity": 10,
  "unit": null,
  "product_image_asset_id": null,
  "group": null,
  "unspsc": null,
  "url": null,
  "date": null,
  "metadata": [{ "key": "SKU", "value": "524959" }]
}
FieldTypeDescription
descriptionstringDescription of the good / service.
quantitynullable numberQuantity of items.
unitnullable stringField describing the unit type, typically for weight or volume -based values, e.g. 'kg' or 'gallons'. Leave null for 'each'.
product_image_asset_idnullable stringAsset id of uploaded product image.
groupnullable stringGrouping of line items.
unspscnullable stringThe 8-digit UNSPSC code for this item.
urlnullable stringURL to product page.
datenullable stringDate corresponding to the given line item, in ISO 8601 format (YYYY-MM-DD).
metadataarrayArray of key/value metadata pairs, e.g. SKU.