All about Bookings

📘

Assumptions

In this working example we assume you have a proper username and password. We will refer from here as {username} and {password}.

Each time we have a parameter, for example the authentication token, we will write it with brackets. For example {example}.

All endpoints need a token to be authenticated.

🚧

Customer vs Lead Passenger

The customer is the travel agency making the booking, and the Lead Passenger is the one traveling. The customer's email will receive all notifications (creation, amendments, cancellations)

🚧

SMS Notification

The booking details are sent to the lead's mobile, along with service confirmation(s), 24 hours before each transfer.

🚧

Gold Protection

If the arrival transportation is cancelled, for whatever reason, you can call us at any time up until the scheduled departure time, and we will reschedule the affected transfer service at no extra cost (subject to availability) or provide a full refund. Without cancellation protection, the booking can only be rescheduled or canceled up to 48 hours before the transfer service.

List bookings

List all bookings filtered by date interval.

curl --location --request GET 'https://api.staging.suntransfers.biz/v1/bookings/{START_DATE}/{END_DATE}/{PAGE_INDEX}/{PAGE_LIMIT}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {TOKEN}'
{
    "references": [
        "SUNTR_XXXXX1",
        "SUNTR_XXXXX2",
        "SUNTR_XXXXX3"
    ]
}

Request explanation

ParameterTypeDescription
START_DATEdatetimeStart date time, for example 2020-01-01T00:00:00
END_DATEdatetimeEnd date time, for example 2020-12-31T23:59:59
PAGE_INDEXintegerPage index, for example 1 the minimum page index is 1.
PAGE_LIMITintegerPage limit, for example 20 the maximum page limit is 100.

Response explanation

There is a response with a list of booking references.

Get booking

Get all the information about a booking by reference.

curl --location --request GET 'https://api.staging.suntransfers.biz/v1/bookings/{REFERENCE}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {TOKEN}'
{
    "reference": "SUNTR_XXXXX1",
    "status": "active",
    "lead_passenger": {
        "title": "Mrs",
        "name": "Butter",
        "surname": "Fly",
        "mobile": "+353 8546",
        "email": "[email protected]",
        "mobile_country": "18"
    },
    "customer": {
        "title": "Mrs",
        "name": "Butter",
        "surname": "Fly",
        "mobile": "+353 8546",
        "email": "[email protected]",
        "currency": "EUR"
    },
    "gold_protection": true,
    "sms_notification": true,
    "passengers": {
        "total": 3,
        "children_info": {
            "kids": 0,
            "babies": 0
        }
    },
    "currency": "EUR",
    "language": "1",
    "prices": {
        "payments": [
            {
                "currency": "EUR",
                "value": 283.54,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            }
        ],
        "gold_protection": {
            "currency": "EUR",
            "value": 7.0,
            "prefix_symbol": "",
            "suffix_symbol": "€"
        },
        "sms_notification": {
            "currency": "EUR",
            "value": 3.0,
            "prefix_symbol": "",
            "suffix_symbol": "€"
        },
        "total": {
            "currency": "EUR",
            "value": 293.54,
            "prefix_symbol": "",
            "suffix_symbol": "€"
        }
    },
    "transfers": [
        {
            "outward": {
                "flight": {
                    "airline_code": "erty",
                    "flight_number": "ey",
                    "airport_code": "ert",
                    "flight_date_time": "2020-01-26 08:10:00",
                    "pickup_date_time": "2020-01-26 08:10:00"
                }
            },
            "destination": {
                "accommodation": {
                    "name": "2020-01-26T08:10:00+00:00",
                    "address": {
                        "name": "seg",
                        "address": "wert"
                    }
                }
            },
            "purchased_extra": [],
            "vehicle": {
                "id": 58,
                "code": "tx3",
                "type": "taxi",
                "title": "Private Taxi",
                "model": "",
                "description": "private",
                "max_passengers": 3,
                "max_luggage": 3,
                "is_shared": false
            },
            "route": {
                "id": 4099,
                "minutes": 165,
                "kilometers": 218
            }
        },
        {
            "outward": {
                "accommodation": {
                    "name": "2020-01-29T10:15:00+00:00",
                    "address": {
                        "name": "seg",
                        "address": "wert"
                    }
                }
            },
            "destination": {
                "flight": {
                    "airline_code": "ser",
                    "flight_number": "ertq",
                    "airport_code": "",
                    "flight_date_time": "2020-01-29 17:15:00",
                    "pickup_date_time": "2020-01-29 10:15:00"
                }
            },
            "purchased_extra": [],
            "vehicle": {
                "id": 58,
                "code": "tx3",
                "type": "taxi",
                "title": "Private Taxi",
                "model": "",
                "description": "private",
                "max_passengers": 3,
                "max_luggage": 3,
                "is_shared": false
            },
            "route": {
                "id": 4099,
                "minutes": 165,
                "kilometers": 218
            }
        }
    ]
}

Vehicle and Route object information you can see in All about Quotes

Request explanation

ParameterTypeDescription
REFERENCEstringIs one of the references that we get from List bookings endpoint.

Response explanation

Field Type Description

reference

string

Booking reference

status

string

Booking status, could be ACTIVE, CANCELLED, PENDING.
"ACTIVE": the booking is considered as ok.
"CANCELLED": the booking was cancelled.
"PENDING": if the agency is configured as "Point of Sale" (pay with credit card), the booking is waiting to be paid

lead_passenger

object

LeadPassenger object. Get the LeadPassenger information

customer

object

Customer object. Get the customer information

gold_protection

boolean

If booking has or not the Gold Protection service

sms_notification

boolean

If booking has or not the "Sms Notification" service

passengers

object

Passengers object. Get the passengers info

currency

string

Booking currency

language

string

Supplier language

prices

object

Prices object. Get the prices info

transfers

array object

Transfer object. Get the transfers info

essential_info

object

Get essential information.

priority_numbers

array object

Get the priority phone numbers

voucher

string

Link to Suntransfers voucher

external_ref

string

External reference, if is not provided in the create request, it should be empty

Prices object

FieldTypeDescription
paymentsarray objectPrice object. List of payments
gold_protectionobjectPrice object. Gold Protection price
sms_notificationobjectPrice object. Sms Notification price
totalobjectPrice object. Total amount

Transfer object.

FieldTypeDescription
outwardobjectTransfer object. Information about the outward
destinationobjectTransfer object. Information about the destination
purchased_extraarray objectTransfer object. List of extras
vehicleobjectTransfer object. Description of the vehicle.
routeobjectTransfer object. Information about the route
pickup_instructionsstringTransfer object. Pick-up instructions

Essential Info

FieldTypeDescription
assistancestringInformation about assistance helplines
childseatsstringInformation about child seats
luggagestringInformation about luggage
vehiclestringInformation about the vehicle
wait_timestringInformation about the wait time

Priority numbers object

FieldTypeDescription
countrystringPhone country
phonestringPhone

Create Booking

In order to be able to create a booking you need to previously have read the All About Quotes chapter.

To create a booking you need to save the "QUOTE_ID" of the quote which you prefer and the "OFFER_HASH" which you will find it at the bottom of the quote request response starting with "api_".

curl -X POST \
  https://api.staging.suntransfers.biz/v1/bookings \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {TOKEN}' \
  -d '{
    "quote_id": "{QUOTE_ID}",
    "offer": {
        "hash": "{OFFER_HASH}"
    },
    "customer": {
        "title": "Mr",
        "name": "John",
        "surname": "Doe",
        "email": "[email protected]",
        "mobile_country_code": "ES",
        "mobile_phone": "612345678"
    },
    "lead_passenger": {
        "title": "Mr",
        "name": "John",
        "surname": "Doe",
        "email": "[email protected]",
        "mobile_country_code": "ES",
        "mobile_phone": "612345678"
    },
    "gold_protection": true,
    "sms_notification": true,
    "passengers": {
        "total": 4,
        "children_info": [
            {
                "birthday": "2019-08-08"
            },
            {
                "birthday": "2019-01-01"
            }
        ]
    },
    "currency": "EUR",
    "language": "en",
    "transfers": [
        {
            "outward": {
                "flight": {
                    "airline_code": "LS",
                    "flight_number": "LS331",
                    "airport_code": "LHR",
                    "flight_date_time": "2019-12-22T11:35:00"
                }
            },
            "destination": {
                "accommodation": {
                    "name": "Hotel Wella",
                    "address": "addr, Maspalomas, 00173, ES",
                    "pickup_date_time": "2019-12-22T12:35:00"
                }
            },
            "purchased_extras": [
                {
                    "code": "golf_bag",
                    "quantity": 1
                }
            ]
        },
        {
            "outward": {
                "accommodation": {
                    "name": "Hotel Wella",
                    "address": "address, Maspalomas, 00173, ES",
                    "pickup_date_time": "2019-12-29T15:35:00"
                }
            },
            "destination": {
                "flight": {
                    "airline_code": "LS",
                    "flight_number": "LS332",
                    "airport_code": "LHR",
                    "flight_date_time": "2019-12-29T18:35:00"
                }
            },
            "purchased_extras": [
                {
                    "code": "golf_bag",
                    "quantity": 1
                }
            ]
        }
    ]
}'
{
    "reference": "SUNTR_XXXXXX",
    "price": {
        "currency": "EUR",
        "value": 70.8852,
        "prefix_symbol": "",
        "suffix_symbol": "€"
    },
    "price_eur": {
        "currency": "EUR",
        "value": 70.8852,
        "prefix_symbol": "",
        "suffix_symbol": "€"
    }
}

Request explanation

FieldTypeDescription
quote_idstringMandatory field. The Quote Id that us get in the Quotes End Point
offerobjectMandatory field. Offer object, set the hash that is get from Quotes End Point
customerobjectMandatory field. Customer object, set the customer information
lead_passengerobjectMandatory field. LeadPassenger object, set the LeadPassenger information
gold_protectionbooleanMandatory field. Set if the customer want or not Gold Protection Service
sms_notificationbooleanMandatory field. Set if the customer want or not SMS Notification
passengersobjectMandatory field. Passengers object. Set the passengers info.
currencystringMandatory field. Set the currency that you want to use for the booking.
languagestringMandatory field. Set the language for the booking.
transfersobjectMandatory field. Set the transfer information
external_refstringSet a external reference

Offer object

FieldTypeDescription
hashstringMandatory field. Set hash from Quotes End Point

Customer object

FieldTypeDescription
titlestringMandatory field. The title of the customer.
namestringMandatory field. The name of the customer.
surnamestringMandatory field. The surname of the customer.
emailstringMandatory field. The email of the customer.
mobile_country_codestringMandatory field. The country code of the customer, ex: ES
mobile_phonestringMandatory field. The phone number of the customer.

Lead Passenger object

titlestringMandatory field. The title of the customer.
namestringMandatory field. The name of the customer.
surnamestringMandatory field. The surname of the customer.
emailstringMandatory field. The email of the customer.
mobile_country_codestringMandatory field. The country code of the customer, ex: ES
mobile_phonestringMandatory field. The phone number of the customer.

Passengers object

FieldTypeDescription
totalintegerMandatory field. The total number of passengers.
children_infoarray objectNot Mandatory field. In case of no kids, you can skip this field.

Children Info object

FieldTypeDescription
birthdaystringMandatory field. Birthday of child.

Transfer object

FieldTypeDescription
outwardobjectMandatory field.
destinationobjectMandatory field.
purchased_extrasobjectNot Mandatory field.

Outward object

Only is necessary to set one of follow options

FieldTypeDescription
flightobjectFlight information
accommodationobjectAccommodation information
cruiseobjectCruise information
trainobjectTrain information

Destination object

Only is necessary to set one of follow options

FieldTypeDescription
flightobjectFlight information
accommodationobjectAccommodation information
cruiseobjectCruise information
trainobjectTrain information

Purchased Extras object

FieldTypeDescription
codestringMandatory field. The code is get from Quotes End Point
quantityintegerMandatory field. The quantity of how many is want

Extras codes

FieldTypeDescription
golf_bagstringa bag full of golf sticks
skisstringa device that allows you to lower snowy slopes
extra_bagstringanother bag
child_booster_seatstringa booster seat
baby_seatstringspecial seat for babies
wheelchairstringa wheelchair
bicyclestringa bicycle

Flight object

FieldTypeDescription
airline_codestringMandatory field. Airline code
flight_numberstringMandatory field. Flight number
airport_codestringMandatory field. Airport code (IATA). Is ignored in Amend
flight_date_timestringMandatory field for flight date based bookings or shared vehicle from accommodation to airport. Flight date time. Is ignored in Amend
pickup_date_timestringMandatory field for pick-up date based bookings. Pickup date time. Is ignored in Amend

Accommodation object

FieldTypeDescription
namestringMandatory field for shuttles vehicles. Accommodation name
addressstring**Mandatory field **. Accommodation address
pickup_date_timestringMandatory field for pick-up date based bookings or outward object. Pickup date time. Is ignored in Amend
hotel_idintegerField for shuttles vehicles. Accommodation hotel id
google_place_idstringGoogle place id

Cruise object

FieldTypeDescription
cruise_linestringMandatory field. Cruise line
ship_namestringMandatory field. Ship name
cruise_terminalstringMandatory field. Cruise terminal
ship_date_timestringMandatory field for ship date based bookings or shared vehicle from accommodation to port station. Cruise date time. Is ignored in Amend
pickup_date_timestringMandatory field for pick-up date based bookings. Pickup date time. Is ignored in Amend

Train object

FieldTypeDescription
train_numberstringMandatory field. Train number
train_date_timestringMandatory field for train date based bookings or shared vehicle from accommodation to train station. Train date time. Is ignored in Amend
pickup_date_timestringMandatory field for pick-up date based bookings. Pickup date time. Is ignored in Amend

Response explanation

FieldTypeDescription
referencestringBooking reference
priceobjectPrice object, this is the price of request currency
price_eurobjectPrice object, this is the price always in EUR currency
external_refstringExternal reference, if is not provided in the create request, it should be empty
transfersarray objectTransfers information

Price object

FieldTypeDescription
currencystringCode of currencies, for example: EUR, USD
valuefloatThe amount, for example: 123.45
prefix_symbolstringIf the symbol is in front of amount, for example $
suffix_symbolstringIf the symbol is at the end of the amount, for example €

Transfer object

FieldTypeDescription
pickup_date_timestringPickup date and time for the transfer. Not available for shuttle transfers to the gateway at booking time
pickup_instructionsstringPickup instructions for the transfer

Amend Booking

At the moment we only allow amending fields that don't change the initial price. Lead passenger details such as name, surname, phone, email are fields that don't impact at all the price.

Editing airline code and flight number won't affect the price either.
You are allowed to add or remove extras that are free of charge, ex: golf equipment.

The number of passengers can change as long as the number of seats of the car permits the change.

In case you edit a field that is not currently available for changing you will receive an error message.

curl -X PATCH \
  https://api.staging.suntransfers.biz/v1/bookings/SUNTR_XXXXXX \
  -H 'Authorization: Bearer {TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{
    "lead_passenger": {
        "name": "Test",
        "surname": "Test",
        "mobile_country_code": "ES",
        "mobile_phone": "698765432",
        "email": "[email protected]"
    },
    "passengers": {
        "total": "2"
    },
    "transfers": [
        {
            "outward": {
                "flight": {
                    "airline_code": "LS",
                    "flight_number": "LS331"
                }
            },
            "destination": {
                "accommodation": {
                    "name": "Hotel Wella",
                    "address": "addr, Maspalomas1, 00173, ES"
                }
            },
            "purchased_extras": [
                {
                    "code": "child_booster_seat",
                    "quantity": 1
                }
            ]
        },
        {
            "outward": {
                "accommodation": {
                    "name": "Hotel Wella",
                    "address": "address, Maspalomas2, 00173, ES"
                }
            },
            "destination": {
                "flight": {
                    "airline_code": "LS",
                    "flight_number": "LS332"
                }
            },
            "purchased_extras": [
                {
                    "code": "child_booster_seat",
                    "quantity": 1
                }
            ]
        }
    ]
}'

Request explanation

FieldTypeDescription
lead_passengerobjectMandatory field. LeadPassenger object, set the LeadPassenger information
passengersobjectMandatory field. Passengers object. Set the passengers info.
transfersarray objectMandatory field. Set the transfer information

Cancel Booking

Bookings with Gold protection can be canceled at any time; on the other hand, those without it can only be canceled up to 48 hours before the transfer service.

curl -X DELETE \
  https://api.staging.suntransfers.biz/v1/bookings/SUNTR_XXXXXX \
  -H 'Authorization: Bearer {TOKEN}' \