> For the complete documentation index, see [llms.txt](https://docs.shuttlefare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shuttlefare.com/endpoints/reservations.md).

# Book

## Book Reservation

<mark style="color:green;">`POST`</mark> `https://api.shuttlefare.com/api/reservations`

To book a reservation you select rate and service provider.

#### Request Body

| Name                | Type   | Description                                      |
| ------------------- | ------ | ------------------------------------------------ |
| flight\_number      | string | The flight number                                |
| airline             | string | The airline IATA code of the flight              |
| gratuity            | number |                                                  |
| pickup\_type        | string | T or F ( T is to Airport. F is from the airport) |
| zip\_code           | string | zip code of the address                          |
| address             | string | Location address                                 |
| airport             | string | airport code. Example: JFK                       |
| num\_of\_passengers | number | number of passengers                             |
| email               | string | email of the person booking                      |
| phone               | string | phone number of the person booking               |
| last\_name          | string | Last name of the person booking                  |
| first\_name         | string | First name of the person booking                 |
| pickup\_time        | string | pickup time. Example: "09:00"                    |
| pickup\_date        | string | pickup date must be in format : yyyy-mm-dd       |
| rate\_id            | string | Rate id that you get from GET rates endpoint     |

{% tabs %}
{% tab title="200 Reservation successfully booked." %}

```
{
    "canceled": false,
    "cancellation_reason": "",
    "_id": "608ec0fb781fa89ba984eaaa",
    "reservation_id": "32930",
    "createdAt": "2021-05-02T15:10:51.664Z",
    "updatedAt": "2021-05-08T23:55:52.343Z",
    "TripTotalAmount": "80.74",
    "address": "85207, 310 North 86th Street, Mesa, AZ, USA, Mesa, AZ 85207",
    "airport": "PHX",
    "api": "pc",
    "email": "test@tester.com",
    "first_name": "Aimad",
    "gratuity": 10,
    "last_name": "String",
    "num_of_passengers": 2,
    "phone": "05737371",
    "pickup_date": "2021-05-24",
    "pickup_time": "08:35",
    "pickup_type": "LA",
    "rate_id": "pc-3961948-8",
    "zip_code": "85207"
}
```

{% endtab %}
{% endtabs %}

## Get All Reservations&#x20;

<mark style="color:blue;">`GET`</mark> `https://api.shuttlefare.com/api/reservations`

You can get a list of all reservations&#x20;

{% tabs %}
{% tab title="200 " %}

```
[
    {
        "canceled": false,
        "cancellation_reason": "",
        "_id": "608ec0fb781fa89ba984eaaa",
        "reservation_id": "32930",
        "createdAt": "2021-05-02T15:10:51.664Z",
        "updatedAt": "2021-05-08T23:55:52.343Z",
        "TripTotalAmount": "80.74",
        "address": "85207, 310 North 86th Street, Mesa, AZ, USA, Mesa, AZ 85207",
        "airport": "PHX",
        "api": "pc",
        "email": "test@tester.com",
        "first_name": "Aimad",
        "gratuity": 10,
        "last_name": "String",
        "num_of_passengers": 2,
        "phone": "05737371",
        "pickup_date": "2021-05-24",
        "pickup_time": "08:35",
        "pickup_type": "LA",
        "rate_id": "pc-3961948-8",
        "zip_code": "85207"
    },
    {
        "canceled": false,
        "cancellation_reason": "",
        "_id": "608ec1ae781fa89ba984eb18",
        "reservation_id": "29991",
        "address": "85207, 310 North 86th Street, Mesa, AZ, USA, Mesa, AZ 85207",
        "api": "ridenfly",
        "createdAt": "2021-05-02T15:13:50.240Z",
        "email": "test@tester.com",
        "first_name": "Aimad",
        "gratuity": 10,
        "last_name": "String",
        "num_of_passengers": 2,
        "phone": "05737371",
        "pickup_date": "2021-05-24",
        "pickup_time": "08:35",
        "rate_id": "ridenfly-7070",
        "updatedAt": "2021-05-02T15:13:50.240Z",
        "zip_code": "85207"
    },
    {
        "canceled": false,
        "cancellation_reason": "",
        "_id": "608ec293781fa89ba984eb4d",
        "reservation_id": "29992",
        "address": "85207, 310 North 86th Street, Mesa, AZ, USA, Mesa, AZ 85207",
        "api": "ridenfly",
        "createdAt": "2021-05-02T15:17:39.470Z",
        "email": "test@tester.com",
        "first_name": "Aimad",
        "gratuity": 10,
        "last_name": "String",
        "num_of_passengers": 2,
        "phone": "05737371",
        "pickup_date": "2021-05-24",
        "pickup_time": "08:35",
        "rate_id": "ridenfly-7070",
        "updatedAt": "2021-05-02T15:17:39.470Z",
        "zip_code": "85207"
    },
    {
        "canceled": false,
        "cancellation_reason": "",
        "_id": "608fe129781fa89ba984ee15",
        "reservation_id": "30010",
        "address": "85207, 310 North 86th Street, Mesa, AZ, USA, Mesa, AZ 85207",
        "api": "ridenfly",
        "createdAt": "2021-05-03T11:40:25.155Z",
        "email": "test@tester.com",
        "first_name": "Aimad",
        "gratuity": 10,
        "last_name": "String",
        "num_of_passengers": 2,
        "phone": "05737371",
        "pickup_date": "2021-05-24",
        "pickup_time": "08:35",
        "rate_id": "ridenfly-7070",
        "updatedAt": "2021-05-03T11:40:25.155Z",
        "zip_code": "85207"
    },
    {
        "canceled": false,
        "cancellation_reason": "",
        "_id": "60971ae8f367f84fc49a718e",
        "reservation_id": "30172",
        "address": "85207, 310 North 86th Street, Mesa, AZ, USA, Mesa, AZ 85207",
        "airport": "PHX",
        "api": "ridenfly",
        "createdAt": "2021-05-08T23:12:40.078Z",
        "email": "test@tester.com",
        "first_name": "Aimad",
        "gratuity": 10,
        "last_name": "String",
        "num_of_passengers": 2,
        "phone": "05737371",
        "pickup_date": "2021-05-24",
        "pickup_time": "08:35",
        "pickup_type": "LA",
        "rate_id": "ridenfly-7070",
        "updatedAt": "2021-05-08T23:12:40.078Z",
        "zip_code": "85207"
    },
    {
        "canceled": false,
        "cancellation_reason": "",
        "_id": "60971b54f367f84fc49a71af",
        "reservation_id": "30173",
        "TripTotalAmount": "77.58",
        "address": "85207, 310 North 86th Street, Mesa, AZ, USA, Mesa, AZ 85207",
        "airport": "PHX",
        "api": "ridenfly",
        "createdAt": "2021-05-08T23:14:28.747Z",
        "email": "test@tester.com",
        "first_name": "Aimad",
        "gratuity": 10,
        "last_name": "String",
        "num_of_passengers": 2,
        "phone": "05737371",
        "pickup_date": "2021-05-24",
        "pickup_time": "08:35",
        "pickup_type": "LA",
        "rate_id": "ridenfly-7070",
        "updatedAt": "2021-05-08T23:14:28.747Z",
        "zip_code": "85207"
    }
]
```

{% endtab %}
{% endtabs %}
