Query Product
Point-to-point support: Mandatory
Update Date: 2024-03-26 Mandatory Online test(Sandbox)
Summary
- This interface is used to query prices, You should return the available car types and corresponding quotes.
- Performance requirements: The response must be within 2000ms, preferably within 1000ms.
API address
API address Format: {Domain}/{Channel}/productquery/2.0/{timeStamp}/{sign}
Request Payload
QueryProductRequest
| Parameter | Type | Airport/Station (required) | Point-to-Point (required) | Taxi (required) | Description | Example |
|---|---|---|---|---|---|---|
| categoryCode | String | Y | Y | Y | Service Type | airport-pickup, point-to-point |
| fromType | Integer | Y | Y | Y | channel | 1 |
| duseLocation | GeoDTO | Y | Y | Y | Address of Departure | |
| auseLocation | GeoDTO | Y | Y | Y | Address of Arrival | |
| useTime | String | Y | Y | Y | Use Time | 2020-08-28 14:46 |
| fixedLocation | FixedLocationDTO | Y | N | N | Airport/Station Info | |
| flightNumber | String | Y | N | N | Flight Number | EU2777 |
| language | String | Y | Y | Y | Site Language | zh-CN |
| vehicleTypeList | List<Long> | N | N | N | Vehicle Type List | 117,118,119 |
| discountCodeList | List<String> | N | N | N | Discount Code | |
| companyCode | String | N | N | N | Enterprise Customers Code | |
| estimation | EstimationStandardDTO | N | N | Y | Estimated Information | |
| orderWayPoint | List<OrderWayPoint> | N | N | N | Waypoint list |
OrderWayPoint
| Parameter | Type | Required | Description | Example | Remark |
|---|---|---|---|---|---|
| seq | Integer | Y | Waypoint sequence | 1 | Starts from 0 in travel order, up to 2 |
| address | String | Y | Waypoint address | Hongqiao Railway Station | POI name |
| detailAddress | String | N | Detail address | 1500 Shengui Rd, Minhang, Shanghai | POI detail address |
| longitude | BigDecimal | Y | Longitude | 121.320170 | 6 decimal places, pad with 0 if less |
| latitude | BigDecimal | Y | Latitude | 31.194360 | 6 decimal places, pad with 0 if less |
| geoType | String | Y | Coordinate type | GCJ02 | GCJ02; WGS84 |
| cityId | long | Y | City Id | 2 | City ID list |
| cityName | String | Y | City name | Shanghai | City ID list |
| status | Integer | N | Waypoint status | 0 | 0-Not arrived; 1-Arrived; 2-Departed; default 0 in request |
Note:
- categoryCode: Service Type
- fromType: 1-Ctrip;2-flight;3-Corp
- fixedLocation: Required for airport/station scenarios only. Not required for point-to-point and taxi-on-demand
- flightNumber: Required for airport/station scenarios only
- language: Please use it as a hint for both customer service and driver language. Site Language list
- vehicleTypeList: Vehicle Type List. Empty means all
- estimation: Required for taxi-on-demand scenarios. For reference only in other scenarios
GeoDTO
| Parameter | Type | Required | Description | Example | Note |
|---|---|---|---|---|---|
| address | String | Y | Address | Ctrip headquarters building | POI name |
| detailAddress | String | Y | Address Detail | Skysoho 16, No. 968 Jin Zhong Road,Changning District, Shanghai | POI address |
| longitude | BigDecimal | Y | Longitude | 121.351145 | Keep 6 decimal places |
| latitude | BigDecimal | Y | Latitude | 31.221373 | Keep 6 decimal places |
| geoType | String | Y | Geographic Coordinate System | GCJ02 | GCJ02 is used in China, and WGS84 is used outside China (including China Hong Kong, Macao and Taiwan). |
| cityId | String | Y | City Id | 258 | City ID List |
| cityName | String | Y | City Name | Fuzhou | City ID List |
We will prioritize providing address information based on the site language selected by the user. For example, if a customer places an order on the Korean site, we will prioritize providing Korean address information, but in some cases, we can only provide Chinese or English address information. If you only need English address information, please contact Ctrip PM
FixedLocationDTO
| Parameter | Type | Required | Description | Example | Note |
|---|---|---|---|---|---|
| fixedCode | String | Y | Airport/Station code | PVG | Airport use IATA code. Station code is defined by Ctrip, please contact Ctrip BD if needed. |
| fixedLocationName | String | Y | Airport/Station Name | Shanghai Pudong International Airport | |
| cityId | String | Y | City Id | 258 | City ID List |
| cityName | String | Y | City Name | Fuzhou | City ID List |
Ctrip will specify the terminal as much as possible when querying products. If we are unable to obtain the specific terminal, we will transmit the airport latitude and longitude, which you should handle on your own. If you do not allow this situation, please contact Ctrip R&D, and we will block requests in this scenario.
EstimationStandardDTO
| Parameter | Type | Required | Description | Example | Note |
|---|---|---|---|---|---|
| estimateDistance | Integer | Y | Estimated Mileage | 16000 | Unit: Meter |
| estimateTime | Integer | Y | Estimated Time | 1200 | Unit: Second |
This estimated information only for reference.
Response Payload
QueryProductResponse
| Parameter | Type | Required | Description | Example | Note |
|---|---|---|---|---|---|
| priceMark | String | Y | Price Mark | B00AABFF7DEA | This parameter is used to identify the unique id of each price query. You may cache the key information such as the starting and ending points, travel time, etc. for this price query. If you cache the key, please kindly ensure that the cache is valid for at least 2 hours |
| currency | String | Y | Currency | CNY | Support: USD/CNY/EUR/JPY |
| queryResultList | List<ShoppingQueryProductDTO> | Y | Price Info | ||
| msgCode | String | Y | Response Code | OK | Recommend response Code |
| message | String | N | Response Detail | Success | Recommend response message |
If you find that Trip.com does not display your price, please go to "https://vbooking.ctrip.com/micro/carwork/ota/logSystem" to inquire about the specific reason
ShoppingQueryProductDTO
| Parameter | Type | Required | Description | Example | Note |
|---|---|---|---|---|---|
| vehicleType | Long | Y | Vehicle Type | 117 | Vehicle Type List |
| price | BigDecimal | Y | Price | 50 | Do not Include Additional Service price |
| addServices | List<AddServiceDTO> | Y | Additional Service | Please note that driver language is an important additional service and we will filter prices by language. | |
| feeItems | List<FeeItemDTO> | N | fee details | Notice 1:Necessary for taxi |
AddServiceDTO
| Parameter | Type | Required | Description | Example | Note |
|---|---|---|---|---|---|
| vendorAddServiceCode | String | Y | Additional Service Code | DR-ZH | Additional Service Code |
| maxCount | Integer | Y | Maximum Amount | 1 |
We will calculate the additional service price based on these parameters and the sku information configured by VBK
FeeItemDTO
| Parameter | Type | Required | Description | Example | Note |
|---|---|---|---|---|---|
| code | String | Y | fee code | Taxi Fee Code | |
| name | String | Y | fee name | ||
| amount | BigDecimal | Y | fee amount | Note 1:The cost amount of the discount item should be negative, such as a discount amount of 8 yuan, which should be returned as -8 here | |
| discount | Boolean | Y | Is it a discount/promotion | Note 1:Return true only in scenarios where the cost amount is negative |
Request Example
{
"orderWayPoint": [
{
"seq": 1,
"address": "Hongqiao Railway Station",
"detailAddress": "1500 Shengui Rd, Minhang, Shanghai",
"longitude": 121.320170,
"latitude": 31.194360,
"geoType": "GCJ02",
"cityId": 2,
"cityName": "Shanghai",
"status": 0
}
],
"categoryCode": "airport-dropoff",
"duseLocation": {
"address": "清华大学",
"detailAddress": "海淀区 双清路30号",
"longitude": 116.32676694616,
"latitude": 40.003909840453,
"geoType": "GCJ02"
},
"auseLocation": {
"address": "首都国际机场",
"detailAddress": "首都国际机场",
"longitude": 116.588057,
"latitude": 40.080519,
"geoType": "GCJ02"
},
"useTime": "2020-10-29 18:26",
"fixedLocation": {
"fixedCode": "PEK",
"fixedLocationName": "首都国际机场",
"cityId": "1",
"cityName": "北京"
},
"fromType": 1
}
Response Example
{
"msgCode": "OK",
"message": "成功",
"priceMark": "B3730C27FE83FC8B",
"currency":"CNY",
"queryResultList": [
{
"price": 195,
"vehicleType": 118,
"addServices": [
{
"maxCount": 1,
"vendorAddServiceCode": "DR-ZH"
}
]
},
{
"price": 268,
"vehicleType": 125,
"addServices": [
{
"maxCount": 1,
"vendorAddServiceCode": "DR-ZH"
}
]
},
{
"price": 278,
"vehicleType": 129,
"addServices": [
{
"maxCount": 1,
"vendorAddServiceCode": "DR-ZH"
}
]
},
{
"price": 536,
"vehicleType": 131,
"addServices": [
{
"maxCount": 1,
"vendorAddServiceCode": "DR-ZH"
}
]
},
{
"price": 692,
"vehicleType": 135,
"addServices": [
{
"maxCount": 1,
"vendorAddServiceCode": "DR-ZH"
}
]
},
{
"price": 854,
"vehicleType": 140,
"addServices": [
{
"maxCount": 1,
"vendorAddServiceCode": "DR-ZH"
}
]
}
]
}
Error Example
{
"msgCode": "NO_TIMESERVICE",
"message": "提前预定时间过短",
"priceMark": "",
"currency":"",
"queryResultList": []
}