Trip Builder

Overview

Combine air, hotel, and car segments into a single, easy-to navigate and dynamic master itinerary. Also add meetings, events and location check-ins and you’ve got a clear, comprehensive picture of the entire trip - no matter where the individual components were booked.

Normally, this aggregation process happens automatically as users register their loyalty accounts with Traxo.

In certain use cases, developers may consider submitting raw travel segment data for processing on behalf of a member.

Usage

GDS Example

When traveler itineraries are available via an existing partner GDS connection, the partner may use these API operations to send data to Traxo. This allows a complete itinerary to be maintained within Traxo.

Sources

The source of each raw segment (i.e. JetBlue, Marriott, Hertz) must be provided with each submitted segment object.

Sources are used for de-duplication and prioritization of travel data within the user's itinerary.

The sources API endpoints (i.e. GET /v2/sources) provide the currently available sources.

The "id" parameter within each source object should be used as the "source" value when submitting raw segments.

Required Fields

In general, the fields listed as required on the API explorer for a given segment type are required to submit a raw segment for processing.

Exception: trip_id. The trip_id is not required and will result in a validation error if provided.

Exception: source. The source field is required as discussed in the "Sources" section.

Example Request

Submit one or more segments for processing.

All segments must pass validation for the batch of segments to be accepted and processed.

POST /v2/segments

Headers:

  Authorization: Bearer {ACCESS-TOKEN}
  Content-type: application/json

Body (JSON-encoded):

{
    "segments": [
        {
            "airline": "Delta Air Lines",
            "arrival_datetime": "2015-07-21T16:00",
            "confirmation_no": "123DDAA",
            "currency": "USD",
            "departure_datetime": "2015-07-21T08:00",
            "destination": "PHX",
            "flight_num": "1234",
            "number_of_pax": 1,
            "origin": "DFW",
            "phone": "1234567890",
            "price": "100.50",
            "seat_assignment": "11A",
            "source": "Delta",
            "status": "Active",
            "type": "Air"
        },
        {
            "airline": "Delta Air Lines",
            "arrival_datetime": "2015-07-22T21:00",
            "confirmation_no": "123DDAA",
            "departure_datetime": "2015-07-22T18:00",
            "destination": "DFW",
            "flight_num": "5678",
            "number_of_pax": 1,
            "origin": "PHX",
            "phone": "1234567890",
            "seat_assignment": "12A",
            "source": "Delta",
            "status": "Active",
            "type": "Air"
        }
    ]
}

Example Response

The API will respond with the HTTP 202 Accepted status code upon successful submission along with a summary object for each segment processed.

This indicates that the data is being processed asynchronously and will be available at a later time.

The submitted data will typically result in changes to a user account that are distributed via a previously Webhooks URL or can be observed by calling the relavent API methods.

[
    {
        "type": "Air",
        "status": "Active",
        "_id": 1234
    },
    {
        "type": "Air",
        "status": "Active",
        "_id": 1235
    }
]

Error Handling

The most typical errors encountered with these operations are missing required parameters or field-level validation errors.

Note: All segments must pass field-level validation for the request to be accepted. If any segment fails, the entire request will fail.

Using the example request above, if the source field was invalid, the following error response would be provided.

[
    {
        "type": "Air",
        "status": "Active",
        "errors": [
            {
            "error": "invalid_source",
            "error_description": "Invalid source"
            }
        ]
    },
    {
        "type": "Air",
        "status": "Active",
        "errors": [
            {
            "error": "invalid_source",
            "error_description": "Invalid source"
            }
        ]
    }
]