Messenger Platform

 
 
 

Airline Itinerary Template

Send a confirmation message that contains the itinerary and receipt.

  • The color of airplane image on web version of template is black.

Example Request

curl -X POST -H "Content-Type: application/json" -d '{
  "recipient": {
    "id": "<USER_ID>"
  },
  "message": {
    "attachment": {
      "type": "template",
      "payload": {
        "template_type": "airline_itinerary",
        "intro_message": "Here is your flight itinerary.",
        "locale": "en_US",
        "pnr_number": "ABCDEF",
        "passenger_info": [
          {
            "name": "Farbound Smith Jr",
            "ticket_number": "0741234567890",
            "passenger_id": "p001"
          },
          {
            "name": "Nick Jones",
            "ticket_number": "0741234567891",
            "passenger_id": "p002"
          }
        ],
        "flight_info": [
          {
            "connection_id": "c001",
            "segment_id": "s001",
            "flight_number": "KL9123",
            "aircraft_type": "Boeing 737",
            "departure_airport": {
              "airport_code": "SFO",
              "city": "San Francisco",
              "terminal": "T4",
              "gate": "G8"
            },
            "arrival_airport": {
              "airport_code": "SLC",
              "city": "Salt Lake City",
              "terminal": "T4",
              "gate": "G8"
            },
            "flight_schedule": {
              "departure_time": "2016-01-02T19:45",
              "arrival_time": "2016-01-02T21:20"
            },
            "travel_class": "business"
          },
          {
            "connection_id": "c002",
            "segment_id": "s002",
            "flight_number": "KL321",
            "aircraft_type": "Boeing 747-200",
            "travel_class": "business",
            "departure_airport": {
              "airport_code": "SLC",
              "city": "Salt Lake City",
              "terminal": "T1",
              "gate": "G33"
            },
            "arrival_airport": {
              "airport_code": "AMS",
              "city": "Amsterdam",
              "terminal": "T1",
              "gate": "G33"
            },
            "flight_schedule": {
              "departure_time": "2016-01-02T22:45",
              "arrival_time": "2016-01-03T17:20"
            }
          }
        ],
        "passenger_segment_info": [
          {
            "segment_id": "s001",
            "passenger_id": "p001",
            "seat": "12A",
            "seat_type": "Business"
          },
          {
            "segment_id": "s001",
            "passenger_id": "p002",
            "seat": "12B",
            "seat_type": "Business"
          },
          {
            "segment_id": "s002",
            "passenger_id": "p001",
            "seat": "73A",
            "seat_type": "World Business",
            "product_info": [
              {
                "title": "Lounge",
                "value": "Complimentary lounge access"
              },
              {
                "title": "Baggage",
                "value": "1 extra bag 50lbs"
              }
            ]
          },
          {
            "segment_id": "s002",
            "passenger_id": "p002",
            "seat": "73B",
            "seat_type": "World Business",
            "product_info": [
              {
                "title": "Lounge",
                "value": "Complimentary lounge access"
              },
              {
                "title": "Baggage",
                "value": "1 extra bag 50lbs"
              }
            ]
          }
        ],
        "price_info": [
          {
            "title": "Fuel surcharge",
            "amount": "1597",
            "currency": "USD"
          }
        ],
        "base_price": "12206",
        "tax": "200",
        "total_price": "14003",
        "currency": "USD"
      }
    }
  }
}' 'https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_ACCESS_TOKEN>'

Example Response

{
  "recipient_id": "1254477777772919",
  "message_id": "mid.$cAAJsujCd2ORj_1qmrFdzhVa-4cvO"
}  

Fields

attachment object

Property Name Description Required

type

Value must be template

Y

payload

payload of itinerary template

Y

payload object

Property Name Description Type Required

template_type

Value must be airline_itinerary

String

Y

intro_message

Introduction message

String

Y

locale

Two-letter language region code

String

Y

theme_color

Background color of the attachment

String

N

pnr_number

Passenger name record number (Booking Number)

String

Y

passenger_info

Information about a passenger

Array of passenger_info

Y

flight_info

Information about a flight

Array of flight_info

Y

passenger_segment_info

Information unique to passenger/segment pair

Array of passenger_segment_info

Y

price_info

Itemization of the total price

Array of price_info

N

base_price

Base price amount

Number

N

tax

Tax amount

Number

N

total_price

Total price for the booking

Number

Y

currency

Pricing currency

String

Y

  • theme_color must be a RGB hexadecimal string (default #009ddc)
  • price_info is limited to 4
  • locale must be a two-letter ISO 639-1 language code and a ISO 3166-1 alpha-2 region code separated by an underscore character. Used to translate field labels (e.g. en_US). See this document for more information about Facebook's locale support.
  • currency must be a three digit ISO-4217-3 code. See this document for more information about Facebook's currency support.

passenger_info object

Property Name Description Type Required

passenger_id

Passenger ID

String

Y, must be unique within the itinerary

ticket_number

Ticket number

String

N

name

Full name of passenger, including title

String

Y

flight_info object

Property Name Description Type Required

connection_id

Used to group segments of a connection together

String

Y, must be unique within the itinerary

segment_id

segment_id of passenger_segment_info object

String

Y

flight_number

Flight number

String

Y

aircraft_type

Aircraft type (e.g. Boing 787)

String

N

departure_airport

Departure airport

airport object

Y

arrival_airport

Arrival airport

airport object

Y

flight_schedule

Schedule for the flight

flight_schedule object

Y

travel_class

Travel class (appears as Cabin)

String

Y

passenger_segment_info object

Property Name Description Type Required

segment_id

Used to identify a flight segment

String

Y, must be unique within the itinerary

passenger_id

passenger_id of passenger_info object

String

Y

seat

Seat number for the passenger

String

Y

seat_type

Seat type for the passenger (e.g. Economy comfort)

String

Y

product_info

List of products the passenger purchased

String

N

  • product_info is limited to 4

airport object

Property Name Description Type Required

airport_code

Airport code (e.g. SFO)

String

Y

city

City name

String

Y

terminal

Terminal number

String

N

gate

Gate number

String

N

flight_schedule object

Property Name Description Type Required

boarding_time

Boarding time in departure airport timezone

String

N

departure_time

Departure time in departure airport timezone

String

Y

arrival_time

Arrival time in arrival airport timezone

String

Y

  • boarding_time, departure_time and arrival_time must be in the ISO 8601-based format YYYY-MM-DDThh:mm (e.g. 2015-09-26T10:30)

price_info object

Property Name Description Type Required

title

Price info title

String

Y

amount

Price amount

Number

Y

currency

Pricing currency

String

N

  • currency must be a three digit ISO-4217-3 code. See this document for more information about Facebook's currency support.

product_info object

Property Name Description Type Required

title

Product title

String

Y

value

Product description

String

Y