All about Quotes
AssumptionsIn 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 |
|
| |
origin | string | Description in the next table | ||
destination | string | Description in the next table | ||
passengers | string |
|
| |
outwardDate | string |
|
| |
returnDate | string |
|
| |
exchangeCurrencies | array |
|
|
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). |
|
coords | Geolocation coordinations, is need to split it by comma (latitude,longitude) or (lat[][_],long[][_]). |
|
location | Location from our API, to get the origin should to use Getways endpoint. To get the destination should to use Routes endpoint. |
|
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. |
|
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
Field | Description |
---|---|
restrictions | The restrictions that are on that country to drive. For example Children Seat is obligatory for kids until 14 years old. |
route | Information about the route, the estimation time in minutes and the estimation in kilometers. |
quotes | Here are severals fields, and will explain in the next table. |
cross_selling | The notifications and protections that the company give, for example send a SMS to the lead passenger. |
hotels | List of hotels availables for shuttles vehicles |
_metadata | The expiration_time is until when this offer are valid. And the hash is to send it in the Create Booking endpoint. |
Restriction schema
Field | Type | Description |
---|---|---|
type | string | Which area are restrictions. |
name | string | Restriction field |
Route schema
Field | Type | Description |
---|---|---|
id | integer | Primary key |
minutes | integer | The aprox time to arrive to destination. |
kilometers | integer | The aprox kilometers to destination. |
origin | object | Origin information |
destination | object | Destination information |
outward_pickup_date_time | string | Estimated pickup date time for outward date (outwardDate parameter) |
return_pickup_date_time | string | Estimated pickup date time for return date. Only in case that there is a return date (returnDate parameter) |
Origin/destination schema
Field | Type | Description |
---|---|---|
id | integer | Primary key |
name | string | Location name |
Quotes schema
Field | Type | Description |
---|---|---|
id | string | This field is mandatory for Create Booking endpoint. |
vehicle | object | Description of the vehicle. |
extras | array object | The extra that is can book and his price. |
price | object | The trip price, without extras and cross_salling |
exchange_prices | array object | Price object. The trip price in the exchange currencies that you request |
base_price | object | Price object. Base price without taxes. |
minutes | integer | Journey time in minutes |
Vehicle schema
Field | Type | Description |
---|---|---|
id | integer | Primary key |
code | string | Vehicle internal code |
type | string | Type of vehicle, for example: taxi |
title | string | Title of vehicle, for example: private taxi |
model | string | Model of vehicle, for example: Mercedes Class S |
description | string | Description of the vehicle |
max_passengers | integer | Number of maximum passengers that allow the vehicle |
max_luggage | integer | Number of maximum luggage that allow the vehicle |
is_shared | boolean | If 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
Field | Type | Description |
---|---|---|
code | string | Code of extra, the code must be one of these: golf_bag, skis, extra_bag, child_booster_seat, baby_seat, wheelchair, bicycle |
max_quantity | integer | Maximum number that allow the vehicle |
unitary_price | object | Price object |
description | string | Extra description |
Price object
Field | Type | Description |
---|---|---|
currency | string | Code of currencies, for example: EUR, USD |
value | float | The amount, for example: 123.45 |
prefix_symbol | string | If the symbol is in front of amount, for example $ |
suffix_symbol | string | If the symbol is at the end of the amount, for example € |
Cross Selling schema
Field | Type | Description |
---|---|---|
sms | object | The price of SMS notification service |
gold_protection | object | The price of Gold Protection service |
SMS object
Field | Type | Description |
---|---|---|
price | object | Price object |
Gold Protection object
Field | Type | Description |
---|---|---|
price | object | Price object |
Metadata schema
Field | Type | Description |
---|---|---|
offer | object | Offer object |
Offer object
Field | Type | Description |
---|---|---|
expiration_time | string | Time when the quotes expire |
hash | string | Hash to use in the Booking Creation |
Hotels schema
Field | Type | Description |
---|---|---|
id | integer | This field is used for shuttles vehicles type on Create Booking endpoint. |
location_id | integer | Location internal primary key |
name | string | Name of the hotel. |
address | string | Address of the vehicle. |
phone | string | Phone of the vehicle. |
latitude | float | Latitude coordinates |
longitude | float | Longitude coordinates |
pickup_latitude | float | Latitude coordinates for pickup instructions |
pickup_longitude | float | Longitude 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"
}
}
}
Updated about 7 hours ago