# Get Flight List

This API Endpoint makes a POST request to the **Travu API** in other to get a response of **AVAILABLE FLIGHT TRIPS** from all our aggregated flight operators based on the requested **DEPARTURE**, **DESTINATION, DATE** etc.

## ENDPOINT URL

**REQUEST TYPE**: POST

**API BASE URL**: <https://access.mytrip.ng/api/v1/search_flight> (Coming soon)

{% hint style="warning" %}
Remember to Pass your Authorization Token for this request to go through, read about Authorization [here](/auth.md).
{% endhint %}

To build the payload you'll need the flight itinerary - which should include the origin(s), destination(s) and departure date(s) - and information about the passengers. Here's how we search for flights:

Our Supported Departure and Destination Strings to be used can be derived from the [Get List of Airports](/master-2/trips/get-list-of-airports.md) Endpoint;&#x20;

{% hint style="info" %}
`Here is an Extra endpoint to help you with this,` [Get List of Airports](/master-2/trips/get-list-of-airports.md)
{% endhint %}

## BODY PAYLOAD

The Body Payload is as below;

Payload Example for a one way ticket.

```json
{
  "type": "Oneway",
  "class": "Y",
  "adult": 1,
  "children": 0,
  "infant": 0,
  "currency": "NGN",
  "itineraries": [
      {
      "Departure": "LOS",
      "Destination": "ABV",
      "DepartureDate": "04/26/2023"
      }
  ]
}
```

Payload Example for a Return ticket.

<pre class="language-json"><code class="lang-json"><strong>{
</strong>  "type": "Return",
  "class": "Y",
  "adult": 1,
  "children": 0,
  "infant": 0,
  "currency": "NGN",
  "itineraries": [
      {
      "Departure": "LOS",
      "Destination": "ABV",
      "DepartureDate": "04/26/2023"
      },
      {
      "Departure": "ABV",
      "Destination": "LOS",
      "DepartureDate": "04/28/2023"
      }
  ]
}
</code></pre>

Payload Example for a Multi destination ticket, this supports between 2 to 6 destinations.

```json
{
  "type": "Multidestination",
  "class": "Y",
  "adult": 1,
  "children": 0,
  "infant": 0,
  "currency": "NGN",
  "itineraries": [
      {
      "Departure": "LOS",
      "Destination": "ABV",
      "DepartureDate": "04/26/2023"
      },
      {
      "Departure": "ABV",
      "Destination": "MAN",
      "DepartureDate": "04/28/2023"
      },
      {
      "Departure": "MAN",
      "Destination": "LOS",
      "DepartureDate": "04/30/2023"
      }
  ]
}
```

## RESPONSE

The Response for this request should bring the **TRIP DETAILS** in the below format if;

The `"type"` parameter is `"Oneway"` which should come with one objects in the `"Itineraries"` of Array.

```json
{
    "GUO": {
        "error": false,
        "message": "successful",
        "info": "Data Available",
        "data": [
            {
                "provider": {
                    "name": "GUO Transport",
                    "short_name": "GUO"
                },
                "boarding_at": "28",
                "trip_id": 96861,
                "trip_no": 450096861,
                "trip_date": "2021-07-10",
                "depature_time": "2018-04-24 08:04:00",
                "origin_id": "",
                "destination_id": 63,
                "narration": "UMUAHIA - LAGOS - AJAH",
                "fare": 6500,
                "total_seats": 15,
                "available_seats": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15
                ],
                "blocked_seats": [
                    2,
                    3
                ],
                "special_seats": [],
                "special_seats_fare": "",
                "order_id": "eef50d24",
                "departure_terminal": "UMUAHIA",
                "destination_terminal": "LAGOS - AJAH",
                "vehicle": "Hiace - 1st Bus (15)"
            },
            {
                "provider": {
                    "name": "GUO Transport",
                    "short_name": "GUO"
                },
                "trip_id": 96861,
                "trip_no": 450096861,
                "trip_date": "2021-07-10",
                "depature_time": "2018-04-24 08:04:00",
                "origin_id": "",
                "destination_id": 63,
                "narration": "UMUAHIA - LAGOS - AJAH",
                "fare": 7000,
                "total_seats": 15,
                "available_seats": [
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7,
                    8,
                    9,
                    10,
                    11,
                    12,
                    13,
                    14,
                    15
                ],
                "blocked_seats": [
                    2,
                    3
                ],
                "special_seats": [],
                "special_seats_fare": "",
                "order_id": "0e2c886c",
                "departure_terminal": "UMUAHIA",
                "destination_terminal": "LAGOS - AJAH",
                "vehicle": "Hiace - 1st Bus (15)"
            }
        ]
    },
    "ABC": {
        "error": true,
        "message": "failed",
        "info": "Terminals does not exist between states",
        "data": []
    }
}
```

The `"type"` parameter is `"Return"` which should come with one objects in the `"Itineraries"` of Array.

```json
{
    "error": false,
    "message": "successful",
    "info": "Data Available",
    "data": [
        {\o
            "provider": {
                "name": "ABC Transport",
                "short_name": "ABC"
            },
            "trip_id": 26528,
            "trip_no": 4,
            "trip_date": "2022-01-09",
            "departure_time": "09/01/2022 06:00",
            "origin_id": 13,
            "destination_id": 25,
            "narration": "GWAGWALADA TO LAGOS JIBOWU",
            "fare": 14350,
            "total_seats": 14,
            "available_seats": [
                0,
                10,
                11,
                12,
                13,
                14
            ],
            "blocked_seats": [],
            "special_seats": [],
            "special_seats_fare": "",
            "order_id": 20,
            "departure_terminal": "GWAGWALADA",
            "destination_terminal": "LAGOS JIBOWU",
            "vehicle": "2+2, Sprinter Service, AC, Non-Video",
            "boarding_at": "10",
            "departure_address": "Ground Floor wing B Kaita Plaza, by Mtnoffice cls toJeparo Hotel",
            "destination_address": "22 IKORODU ROAD JIBOWU"
        },
        {
            "provider": {
                "name": "GUO Transport",
                "short_name": "GUO"
            },
            "trip_id": 482850,
            "trip_no": 30482850,
            "trip_date": "2022-01-09",
            "departure_time": "09/01/2022 20:01",
            "origin_id": "",
            "destination_id": 64,
            "narration": "UTAKO - LAGOS - COKER",
            "fare": 10500,
            "total_seats": 59,
            "available_seats": [
                10,
                11,
                12,
                13,
                14
            ],
            "blocked_seats": [],
            "special_seats": [],
            "special_seats_fare": "",
            "order_id": "de5426cf",
            "departure_terminal": "UTAKO",
            "destination_terminal": "LAGOS - COKER",
            "vehicle": "Luxury - 1st Bus (59)",
            "boarding_at": "",
            "departure_address": "Gouba Plaza, Plot171, Ekukinam Street, Utako District, Abuja.",
            "destination_address": "LAGOS - COKER Terminal"
        }
    ]
}
```

The `"type"` parameter is `"Multidestination"` which should come with one objects in the `"Itineraries"` of Array, comes with a minimum of two and a maximum of six objects in the `"Itineraries"` of Array.

Reference to [Authentication](/auth.md) for possible authentication errors that might occur during this request.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.travu.africa/master-2/trips.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
