All about Quotes

📘

Assumptions

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

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

All end points need a token to be authenticated.

Search Quotes

Search quote endpoint

curl -X POST \
  https://api.staging.suntransfers.biz/v1/quotes \
  -H 'Authorization: Bearer {token}' \
  -H 'Content-Type: application/json' \
  -d '{
      "currency": "EUR",
      "origin": "location:32",
      "destination": "location:33",
      "passengers": "2,1,1",
      "outwardDate": "2019-12-29T06:30:00",
      "returnDate": "2019-12-30T01:45:00",
      "exchangeCurrencies": [
          "USD",
          "JPY"
      ]
}'
{
    "restrictions": {
        "type": "extras",
        "name": "children_seat_compulsory"
    },
    "route": {
        "id": 77,
        "minutes": 30,
        "kilometers": 15,
        "origin": {
            "id": 32,
            "name": "Barcelona airport"
        },
        "destination": {
            "id": 33,
            "name": "Barcelona city (all areas)"
        },
        "outward_pickup_date_time": "2019-12-29 06:30:00",
        "return_pickup_date_time": "2019-12-29 23:05:00"
    },
    "quotes": [
        {
            "id": "ce258324-9f73-49ab-a76d-c17e790fedfa",
            "vehicle": {
                "id": 1,
                "code": "tx4",
                "type": "taxi",
                "title": "Private Taxi",
                "model": "",
                "description": "private",
                "max_passengers": 4,
                "max_luggage": 4,
                "is_shared": false
            },
            "extras": [
                {
                    "code": "golf_bag",
                    "max_quantity": 3,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 0.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "child_booster_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "baby_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                }
            ],
            "price": {
                "currency": "EUR",
                "value": 88.1696,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "exchange_prices": [
                {
                    "currency": "USD",
                    "value": 98.2738,
                    "prefix_symbol": "$",
                    "suffix_symbol": ""
                },
                {
                    "currency": "JPY",
                    "value": 10754.0461,
                    "prefix_symbol": "Â¥",
                    "suffix_symbol": ""
                }
            ],
            "base_price": {
                "currency": "EUR",
                "value": 80.1542,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "extra_data": {
                "price_id": 3429378,
                "rate_id": 8516
            }
        },
        {
            "id": "ade03996-1d41-4823-8af0-57908e6880ad",
            "vehicle": {
                "id": 66,
                "code": "premtx4",
                "type": "premium_taxi",
                "title": "Premium Taxi",
                "model": "premium_taxi",
                "description": "private",
                "max_passengers": 4,
                "max_luggage": 4,
                "is_shared": false
            },
            "extras": [
                {
                    "code": "golf_bag",
                    "max_quantity": 2,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 0.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "child_booster_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "baby_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                }
            ],
            "price": {
                "currency": "EUR",
                "value": 110.9367,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "exchange_prices": [
                {
                    "currency": "USD",
                    "value": 123.65,
                    "prefix_symbol": "$",
                    "suffix_symbol": ""
                },
                {
                    "currency": "JPY",
                    "value": 13530.9493,
                    "prefix_symbol": "Â¥",
                    "suffix_symbol": ""
                }
            ],
            "base_price": {
                "currency": "EUR",
                "value": 100.8514,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "extra_data": {
                "price_id": 3369604,
                "rate_id": 8356
            }
        }
    ],
    "cross_selling": {
        "sms": {
            "price": {
                "currency": "EUR",
                "value": 1.75,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            }
        },
        "gold_protection": {
            "price": {
                "currency": "EUR",
                "value": 3.0,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            }
        }
    },
    "_metadata": {
        "offer": {
            "expiration_time": "2019-12-18T12:14:51+00:00",
            "hash": "api_aa19af8e398308e2e7486f03153281b1df8e2642294db714caeb0057587d069a"
        }
    }
}

Field

Type

Description

Example

currency

string

  • Mandatory field*
  • EUR, USD, GBP

origin

string

Description in the next table

destination

string

Description in the next table

passengers

string

  • Mandatory field*. Here should define the passengers that will go, the value is split by comma (,) in the first place we have the adults, second place we have the kids and in the last place we have the babies. As an example we can get a family with 2 adults, one kid and one baby, the value to send is 2,1,1.
  • 2,1,1
  • 2,0,0
  • 2,0,1

outwardDate

string

  • Mandatory field*. Here should define the date and time to get the passengers.
  • 2019-12-29T06:30:00
  • 2020-01-29T12:30:00

returnDate

string

  • Not mandatory field*. Here can define the date and time to get the passengers.
  • 2019-12-30T01:45:00
  • 2020-01-30T18:45:00

exchangeCurrencies

array

  • Not mandatory field*. Here can define the exchange currencies that you want to get. Is an array and here can pass many options.
  • [USD, JPY]

Here you have the few possibilities to use in origin and destination field.

Field

Description

Examples

iata

An IATA airport code, is a three-letter geocode designating many airports and metropolitan areas around the world, defined by the International Air Transport Association (IATA).

  • BCN
  • MAD

coords

Geolocation coordinations, is need to split it by comma (latitude,longitude) or (lat[][_],long[][_]).

  • 41.4038,2.1913
  • lat[41.4038],long[2.1913]

location

Location from our API, to get the origin should to use Getways endpoint. To get the destination should to use Routes endpoint.

  • origin:22176 (Philadelphia airport)
  • destination: 19912 (Manhattan)

gplace

Is a hash that is get from Google Places. Please check

https://developers.google.com/places/place-id

in order to get the gplace hash.

  • ChIJmykInhWjpBIR-a0ptes0VYY
  • ChIJKye2O32AhYAReYE_INe4rf4

Here you can switch the origin and destination as you want, it is not mandatory to use for example only iata or coords. For example you can mess between iata and location:

curl -X POST \
  https://api.staging.suntransfers.biz/v1/quotes \
  -H 'Authorization: Bearer {token}' \
  -H 'Content-Type: application/json' \
  -d '{
      "currency": "EUR",
      "origin": "iata:BCN",
      "destination": "location:33",
      "passengers": "2,1,1",
      "outwardDate": "2019-12-29T06:30:00",
      "returnDate": "2019-12-30T01:45:00",
      "exchangeCurrencies": [
          "USD",
          "JPY"
      ]
}'
{
    "restrictions": {
        "type": "extras",
        "name": "children_seat_compulsory"
    },
    "route": {
        "id": 77,
        "minutes": 30,
        "kilometers": 15,
        "origin": {
            "id": 32,
            "name": "Barcelona airport"
        },
        "destination": {
            "id": 33,
            "name": "Barcelona city (all areas)"
        },
        "outward_pickup_date_time": "2019-12-29 06:30:00",
        "return_pickup_date_time": "2019-12-29 23:05:00"
    },
    "quotes": [
        {
            "id": "ce258324-9f73-49ab-a76d-c17e790fedfa",
            "vehicle": {
                "id": 1,
                "code": "tx4",
                "type": "taxi",
                "title": "Private Taxi",
                "model": "",
                "description": "private",
                "max_passengers": 4,
                "max_luggage": 4,
                "is_shared": false
            },
            "extras": [
                {
                    "code": "golf_bag",
                    "max_quantity": 3,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 0.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "child_booster_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "baby_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                }
            ],
            "price": {
                "currency": "EUR",
                "value": 88.1696,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "exchange_prices": [
                {
                    "currency": "USD",
                    "value": 98.2738,
                    "prefix_symbol": "$",
                    "suffix_symbol": ""
                },
                {
                    "currency": "JPY",
                    "value": 10754.0461,
                    "prefix_symbol": "Â¥",
                    "suffix_symbol": ""
                }
            ],
            "base_price": {
                "currency": "EUR",
                "value": 80.1542,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "extra_data": {
                "price_id": 3429378,
                "rate_id": 8516
            }
        },
        {
            "id": "ade03996-1d41-4823-8af0-57908e6880ad",
            "vehicle": {
                "id": 66,
                "code": "premtx4",
                "type": "premium_taxi",
                "title": "Premium Taxi",
                "model": "premium_taxi",
                "description": "private",
                "max_passengers": 4,
                "max_luggage": 4,
                "is_shared": false
            },
            "extras": [
                {
                    "code": "golf_bag",
                    "max_quantity": 2,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 0.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "child_booster_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "baby_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                }
            ],
            "price": {
                "currency": "EUR",
                "value": 110.9367,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "exchange_prices": [
                {
                    "currency": "USD",
                    "value": 123.65,
                    "prefix_symbol": "$",
                    "suffix_symbol": ""
                },
                {
                    "currency": "JPY",
                    "value": 13530.9493,
                    "prefix_symbol": "Â¥",
                    "suffix_symbol": ""
                }
            ],
            "base_price": {
                "currency": "EUR",
                "value": 100.8514,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "extra_data": {
                "price_id": 3369604,
                "rate_id": 8356
            }
        }
    ],
    "cross_selling": {
        "sms": {
            "price": {
                "currency": "EUR",
                "value": 1.75,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            }
        },
        "gold_protection": {
            "price": {
                "currency": "EUR",
                "value": 3.0,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            }
        }
    },
    "_metadata": {
        "offer": {
            "expiration_time": "2019-12-18T12:14:51+00:00",
            "hash": "api_aa19af8e398308e2e7486f03153281b1df8e2642294db714caeb0057587d069a"
        }
    }
}

Response schema

FieldDescription
restrictionsThe restrictions that are on that country to drive. For example Children Seat is obligatory for kids until 14 years old.
routeInformation about the route, the estimation time in minutes and the estimation in kilometers.
quotesHere are severals fields, and will explain in the next table.
cross_sellingThe notifications and protections that the company give, for example send a SMS to the lead passenger.
hotelsList of hotels availables for shuttles vehicles
_metadataThe expiration_time is until when this offer are valid. And the hash is to send it in the Create Booking endpoint.

Restriction schema

FieldTypeDescription
typestringWhich area are restrictions.
namestringRestriction field

Route schema

FieldTypeDescription
idintegerPrimary key
minutesintegerThe aprox time to arrive to destination.
kilometersintegerThe aprox kilometers to destination.
originobjectOrigin information
destinationobjectDestination information
outward_pickup_date_timestringEstimated pickup date time for outward date (outwardDate parameter)
return_pickup_date_timestringEstimated pickup date time for return date. Only in case that there is a return date (returnDate parameter)

Origin/destination schema

FieldTypeDescription
idintegerPrimary key
namestringLocation name

Quotes schema

FieldTypeDescription
idstringThis field is mandatory for Create Booking endpoint.
vehicleobjectDescription of the vehicle.
extrasarray objectThe extra that is can book and his price.
priceobjectThe trip price, without extras and cross_salling
exchange_pricesarray objectPrice object. The trip price in the exchange currencies that you request
base_priceobjectPrice object. Base price without taxes.
minutesintegerJourney time in minutes

Vehicle schema

FieldTypeDescription
idintegerPrimary key
codestringVehicle internal code
typestringType of vehicle, for example: taxi
titlestringTitle of vehicle, for example: private taxi
modelstringModel of vehicle, for example: Mercedes Class S
descriptionstringDescription of the vehicle
max_passengersintegerNumber of maximum passengers that allow the vehicle
max_luggageintegerNumber of maximum luggage that allow the vehicle
is_sharedbooleanIf the vehicle can be shared

Vehicles types

code

type

Description

citytxN

string

City taxi with capacity for N persons. Example: citytx4 is a city taxi with capacity for 4 persons.

chN

string

Coach with capacity for N persons. Example: ch46 is a coach with capacity for 46 persons.

expsh

string

Express Shuttle.

expshN

string

Express Shuttle with capacity for N persons. Example: expsh5 is an express shuttle with capacity for 5 persons.

mbN

string

Mini bus with capacity for N persons. Example: mb10 is a mini bus with capacity for 10 persons.

mchN

string

Mini coach with capacity for N persons. Example: mch19 is a mini coach with capacity for 19 persons.

LmmvN, mvN, lmmvN, mvN

string

Minivan with capacity for N persons. Example: Lmmv5 is a mini van with capacity for 5 persons.

premmbN

string

Premium busith capacity for N persons. Example: premmb12 is an premium bus with capacity for 12 persons.

premmchN

string

Premium mini couch with capacity for N persons. Example: premmch14 is amini couch with capacity for 14 persons.

premmvN

string

Premium minivan with capacity for N persons. Example: premmch14 is a premium minivan with capacity for 14 persons.

premtxN

string

Premium taxi with capacity for N persons. Example: premtx3 is a premium taxi with capacity for 3 persons.

sh

string

Shuttle bus

shN

string

Shuttle bus with capacity for N persons. Example: sh10 is a shuttle bus with capacity for 10 persons.

txN

string

Taxi with capacity for N persons. Example: tx4 is a taxi with capacity for 4 persons.

viptxN

string

VIP car with capacity for N persons. Example: viptx4 is a VIP car with capacity for 4 persons.

wavN

string

wheelchair accessible vehicle with capacity for N persons. Example: wav3 is a wheelchair accessible vehicle with capacity for 3 persons.

wtxN

string

Private water with capacity for N persons. Example: wtx6 is a taxi with capacity for 6 persons.

wtxsh

string

Shuttle water taxi

premwtxN

string

Premium water taxi with capacity for N persons. Example: premwtx6 is a premium taxi with capacity for 6 persons.

Extras schema

FieldTypeDescription
codestringCode of extra, the code must be one of these: golf_bag, skis, extra_bag, child_booster_seat, baby_seat, wheelchair, bicycle
max_quantityintegerMaximum number that allow the vehicle
unitary_priceobjectPrice object
descriptionstringExtra description

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 €

Cross Selling schema

FieldTypeDescription
smsobjectThe price of SMS notification service
gold_protectionobjectThe price of Gold Protection service

SMS object

FieldTypeDescription
priceobjectPrice object

Gold Protection object

FieldTypeDescription
priceobjectPrice object

Metadata schema

FieldTypeDescription
offerobjectOffer object

Offer object

FieldTypeDescription
expiration_timestringTime when the quotes expire
hashstringHash to use in the Booking Creation

Hotels schema

FieldTypeDescription
idintegerThis field is used for shuttles vehicles type on Create Booking endpoint.
location_idintegerLocation internal primary key
namestringName of the hotel.
addressstringAddress of the vehicle.
phonestringPhone of the vehicle.
latitudefloatLatitude coordinates
longitudefloatLongitude coordinates
pickup_latitudefloatLatitude coordinates for pickup instructions
pickup_longitudefloatLongitude coordinates for pickup instructions

Here more example that you are free to use

To get Getways you may use this end point:

curl -X GET \
  https://api.staging.suntransfers.biz/v1/gateways \
  -H 'Authorization: Bearer {token}' \
  -H 'Content-Type: application/json'
{
    "gateways": [
        {
            "id": 13,
            "name": "Alicante airport",
            "subtype": "airport",
            "code": "ALC",
            "country_code": "ES"
        },
        {
            "id": 15,
            "name": "Almeria airport",
            "subtype": "airport",
            "code": "LEI",
            "country_code": "ES"
        },
        {
            "id": 32,
            "name": "Barcelona airport",
            "subtype": "airport",
            "code": "BCN",
            "country_code": "ES"
        },
        {
            "id": 138,
            "name": "Girona airport",
            "subtype": "airport",
            "code": "GRO",
            "country_code": "ES"
        },
        {
            "id": 141,
            "name": "Granada airport",
            "subtype": "airport",
            "code": "GRX",
            "country_code": "ES"
        }
    ]
}

Based on the previous response you can search for Routes with the next end point

curl -X GET \
  https://api.staging.suntransfers.biz/v1/routes/{gatewayID} \
  -H 'Authorization: Bearer {token}' \
  -H 'Content-Type: application/json'
{
    "routes": [
        {
            "id": 138,
            "name": "Girona airport",
            "subtype": "airport",
            "code": "GRO",
            "country_code": "ES"
        },
        {
            "id": 161,
            "name": "La Massana (Andorra)",
            "subtype": "",
            "code": "",
            "country_code": "AD"
        }
    ]
}

As an example we can take, Gateway id 32 (Barcelona Airport) and one of his Route id 161 (La Massana (Andorra))

curl -X POST \
  https://api.staging.suntransfers.biz/v1/quotes \
  -H 'Authorization: Bearer {token}' \
  -H 'Content-Type: application/json' \
  -d '{
      "currency": "EUR",
      "origin": "location:32",
      "destination": "location:161",
      "passengers": "2,1,1",
      "outwardDate": "2019-12-29T06:30:00",
      "returnDate": "2019-12-30T01:45:00",
      "exchangeCurrencies": [
          "USD",
          "JPY"
      ]
}'
{
    "restrictions": [],
    "route": {
        "id": 810,
        "minutes": 200,
        "kilometers": 206
    },
    "quotes": [
        {
            "id": "8dbf8f58-a2ed-4c4d-9290-9b263399329f",
            "vehicle": {
                "id": 1,
                "code": "tx4",
                "type": "taxi",
                "title": "Private Taxi",
                "model": "",
                "description": "private",
                "max_passengers": 4,
                "max_luggage": 4,
                "is_shared": false
            },
            "extras": [
                {
                    "code": "golf_bag",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 0.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "skis",
                    "max_quantity": 2,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 0.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "child_booster_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "baby_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                }
            ],
            "price": {
                "currency": "EUR",
                "value": 588.064,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "exchange_prices": [
                {
                    "currency": "USD",
                    "value": 656.397,
                    "prefix_symbol": "$",
                    "suffix_symbol": ""
                },
                {
                    "currency": "JPY",
                    "value": 71926.1078,
                    "prefix_symbol": "Â¥",
                    "suffix_symbol": ""
                }
            ],
            "base_price": {
                "currency": "EUR",
                "value": 588.064,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "extra_data": {
                "price_id": 3563926,
                "rate_id": 8873
            }
        },
        {
            "id": "3c495c40-c6fa-43f9-bbce-550fe42a30c1",
            "vehicle": {
                "id": 66,
                "code": "premtx4",
                "type": "premium_taxi",
                "title": "Premium Taxi",
                "model": "premium_taxi",
                "description": "private",
                "max_passengers": 4,
                "max_luggage": 4,
                "is_shared": false
            },
            "extras": [
                {
                    "code": "golf_bag",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 0.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "child_booster_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                },
                {
                    "code": "baby_seat",
                    "max_quantity": 1,
                    "unitary_price": {
                        "currency": "EUR",
                        "value": 7.0,
                        "prefix_symbol": "",
                        "suffix_symbol": "€"
                    }
                }
            ],
            "price": {
                "currency": "EUR",
                "value": 665.3816,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "exchange_prices": [
                {
                    "currency": "USD",
                    "value": 742.6989,
                    "prefix_symbol": "$",
                    "suffix_symbol": ""
                },
                {
                    "currency": "JPY",
                    "value": 81382.8235,
                    "prefix_symbol": "Â¥",
                    "suffix_symbol": ""
                }
            ],
            "base_price": {
                "currency": "EUR",
                "value": 604.8924,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            },
            "extra_data": {
                "price_id": 3541786,
                "rate_id": 8804
            }
        }
    ],
    "cross_selling": {
        "sms": {
            "price": {
                "currency": "EUR",
                "value": 1.75,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            }
        },
        "gold_protection": {
            "price": {
                "currency": "EUR",
                "value": 3.0,
                "prefix_symbol": "",
                "suffix_symbol": "€"
            }
        }
    },
    "_metadata": {
        "offer": {
            "expiration_time": "2019-12-19T16:02:35+00:00",
            "hash": "api_059b06a628ba685ffb2846f28adf514fbfe821a16024fa11681f8826b06ce746"
        }
    }
}