Create Order
Update Date: 2024-03-26 Mandatory
Online test(Sandbox)
Summary
- This endpoint can be used to create booking.
- If Ctrip does not receive an OK response with vendorOrderId, it will continue to retry once every 5 seconds. If there is still no vendorOrderId after the retry, the order will be canceled. Therefore, the supplier interface needs to support idempotency based on the ctripPurchaseOrderId field (multiple calls with the same ctripPurchaseOrderId should return the result of the first successful vendorOrderId).
- Performance requirements: The response must be within 2000ms, preferably within 1000ms.
API address
API address Format:
{Domain}/JNT/ordercreate/2.0/{timeStamp}/{sign}
Request Payload
CreateOrderRequest
Parameter |
Type |
Required |
Description |
Example |
Note |
masterOrderId |
Long |
Y |
Ctrip Main order ID |
12744251457 |
The unique order number of booking |
ctripPurchaseOrderId |
Long |
Y |
Ctrip Purchase Order ID |
881823967638342968 |
18 digital. masterOrderId and ctripPurchaseOrderId are one-to-many relationships, Please use this parameter as the unique id for API interaction |
categoryCode |
String |
Y |
Service Type |
airport-pickup |
Service Type |
fromType |
Integer |
Y |
channel |
1 |
Booking channel source, 1:Ctrip&Trip App, 2:Air tickets, 3:Trip.Biz, 4:Trip.Biz-MICE |
totalPrice |
BigDecimal |
Y |
Total Price |
|
Not Include Additional Service |
priceMark |
String |
Y |
Price Mark |
B00AABFF7DEA0ABD |
|
fixedLocation |
FixedLocationDTO |
Y |
Airport Info |
|
|
vehicleType |
Long |
Y |
Vehicle Type |
117 |
Vehicle Type List |
useTime |
String |
Y |
Use Time |
2020-08-28 14:46 |
Local Time, Format:yyyy-MM-dd HH:mm, For airport pick-up, please use the flight landing time plus the buffer time to calculate use time. For airport drop-off, customers can choose use time themselves. |
duseLocation |
GeoDTO |
Y |
Address of Departure |
|
|
auseLocation |
GeoDTO |
Y |
Address of Arrival |
|
|
flightInfo |
FlightInfoDTO |
N |
Flight Info |
|
Must Be Provided in Airport Pick-Up |
language |
String |
N |
Site Language |
zh-CN(Ignore Case) |
It means user's site and language preference, empty means zh-CN. Please use it as a hint for both customer service and driver language. Site Language list |
passenger |
PassengerInfoDTO |
Y |
Passenger Info |
|
|
agent |
AgentInfoDTO |
N |
Agent Info |
|
Booking car for others |
selectAddServices |
List<SelectAddServiceDTO> |
N |
Selected Additional Service |
|
Additional Service Code |
adults |
Integer |
N |
No. Adult |
|
|
children |
Integer |
N |
No. Child |
|
|
luggage |
Integer |
N |
No. Baggage (24inch) |
|
|
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 |
N |
Airport/Station Name |
Shanghai Pudong International Airport |
|
cityId |
String |
Y |
City Id |
258 |
City ID List |
cityName |
String |
N |
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.
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
FlightInfoDTO
Parameter |
Type |
Required |
Description |
Example |
Note |
flightNumber |
String |
Y |
Flight Number |
CA1884 |
|
takeOffTime |
String |
N |
Flight take off Time |
2020-10-06 18:50:00 |
Flight Plan take off (Local) Time; yyyy-MM-dd HH:mm:ss |
flightLandingTime |
String |
N |
Flight Landing Time |
2020-10-06 21:20:00 |
Flight Plan Landing (Local) Time; yyyy-MM-dd HH:mm:ss |
departDelayTime |
Integer |
N |
Buffer time:Use car after landing |
20 |
Unit: Minute |
PassengerInfoDTO
Parameter |
Type |
Required |
Description |
Example |
Note |
name |
String |
N |
Passenger Name |
Zhang San |
|
firstName |
String |
N |
Passenger First Name |
San |
|
lastName |
String |
N |
Passenger Last Name |
Zhang |
|
localPhoneAreaCode |
String |
N |
Passenger local phone country calling code |
+86 |
|
localPhone |
String |
N |
Passenger local phone number |
13161453199 |
|
email |
String |
N |
Passenger Email |
car@ctrip.com |
|
intlPhoneAreaCode |
String |
N |
Passenger destined country calling code |
+44 |
|
intlPhone |
String |
N |
Passenger destined phone number |
|
|
emergencyPhone |
String |
N |
Emergency Contact Person country calling code |
|
|
emergencyPhoneAreaCode |
String |
N |
Emergency Contact Person phone number |
|
|
imType |
String |
N |
Instant Messaging App |
WeChat |
WhatsApp/Skype/LINE/WeChat |
imNo |
String |
N |
Instant Messaging Number |
|
|
- Either name or firstName and lastName will be provided.
- Either localPhone or intlPhone will be provided. If it is China mainland order, then the number is an encrypted number which is coupled with the corresponding driver. Only the Driver can contact with this passenger.
AgentInfoDTO
Parameter |
Type |
Required |
Description |
Example |
Note |
name |
String |
N |
Agent Name |
Isaac Newton |
|
firstName |
String |
N |
Agent First Name |
Isaac |
|
lastName |
String |
N |
Agent Last Name |
Newton |
|
intlPhoneAreaCode |
String |
Y |
Agent country calling code |
+86 |
|
intlPhone |
String |
Y |
Agent phone number |
13161453199 |
|
SelectAddServiceDTO
Parameter |
Type |
Required |
Description |
Example |
Note |
vendorAddServiceCode |
String |
Y |
Additional Service Code |
DR-ZH |
Additional Service Code |
count |
Integer |
Y |
Amount |
|
|
price |
BigDecimal |
Y |
Price |
|
|
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.
PermissionDTO
参数 |
类型 |
必传 |
描述 |
示例 |
备注 |
record |
Bool |
Y |
Recording during the journey |
Ture |
Ture: allowed; False: denied |
video |
Bool |
Y |
Take Video during the journey |
False |
Ture: allowed; False: denied |
Response Payload
CreateOrderResponse
Parameter |
Type |
Required |
Description |
Example |
Note |
vendorOrderId |
String |
Y |
Vendor's Order ID |
|
Provide by Vendor |
msgCode |
String |
Y |
Response Code |
OK |
Response Code |
message |
String |
N |
Response Detail |
Success |
Response Code |
Request Example
{
"ctripPurchaseOrderId": 4295005950716883,
"categoryCode": "airport-dropoff",
"totalPrice": 199,
"priceMark": "64A06FFD269E5B32",
"fixedLocation": {
"fixedCode": "SHA",
"cityId": "2",
"cityName": "上海"
},
"vehicleType": 121,
"useTime": "2020-10-30 16:22",
"duseLocation": {
"address": "地铁11号线",
"detailAddress": "嘉定区 嘉定区",
"longitude": 121.23748480579,
"latitude": 31.391551182385,
"geoType": "GCJ02"
},
"auseLocation": {
"address": "虹桥国际机场",
"detailAddress": "虹桥国际机场",
"longitude": 121.326179,
"latitude": 31.195514,
"geoType": "GCJ02"
},
"flightInfo": {
"departDelayTime": 30
},
"passenger": {
"name": "张晓欢",
"localPhoneAreaCode": "86",
"localPhone": "13963746361",
"maskRealPhone": "159***98902"
},
"agent": {},
"masterOrderId": 4295005950716883,
"needLandingVisa": false,
"adults": 0,
"children": 0,
"luggage": 0
}
Response Example
{
"msgCode": "OK",
"message": "成功",
"vendorOrderId": "20AD8D1J9WTW4W"
}
Error Example
{
"msgCode": "ERROR_NO_PRICEMARK",
"message": "价格标识符不存在"
}