Requests & Responses

Example payloads for requests to and responses from XCE

Offer Request

The below is an example quote request to send to the XCE widget during initialization.

{
  "schema": "demo-partner-travel:v1",
  "customer": {
    "currency": "EUR",
    "language": "en",
    "country": "NL"
  },
  "context": {
    "departure_country": "GB",
    "destination_country": "GB",
    "reservation_number": "aaca2167-3d55-4d12-a58d-cecf2657a7f4",
    "total_tickets_price": 265,
    "number_of_adults": 1,
    "number_of_children": 0,
    "number_of_infants": 0,
    "trip_start_date": "2025-11-08T09:25:00+11:00",
    "trip_end_date": "2025-11-17T15:45:00+11:00",
    "trips": [
      {
        "legs": [
          {
            "departure_datetime": "2025-11-08T09:25:00+11:00",
            "arrival_datetime": "2025-11-08T11:30:00+11:00",
            "trip_number": "ABC123",
            "departure_location": "Machester Piccadilly",
            "arrival_location": "London Kings Cross",
            "departure_country": "GB",
            "arrival_country": "GB",
            "departure_city": "Machester",
            "arrival_city": "London",
            "transport_mode": "train"
          }
        ]
      },
      {
        "legs": [
          {
            "departure_datetime": "2025-11-08T09:25:00+11:00",
            "arrival_datetime": "2025-11-08T11:30:00+11:00",
            "trip_number": "DEF456",
            "departure_location": "London Kings Cross",
            "arrival_location": "Piccadilly",
            "departure_country": "GB",
            "arrival_country": "GB",
            "departure_city": "London",
            "arrival_city": "Machester",
            "transport_mode": "train"
          }
        ]
      }
    ]
  }
}

Offer Response

The below is an example response provided by XCE during the onSet function once an offer was successfully generated for a customer. This data is required to be stored for later consumption in the confirm offer request.

Last updated