Create Order

Point-to-point support: Mandatory

Update Date: 2024-03-26 Mandatory Online test(Sandbox)


Summary

  1. This endpoint can be used to create booking.
  2. 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).
  3. Performance requirements: The response must be within 2000ms, preferably within 1000ms.

API address

API address Format:  {Domain}/{Channel}/ordercreate/2.0/{timeStamp}/{sign}

Request Payload

CreateOrderRequest

Parameter Type Airport/Station (required) Point-to-Point (required) Taxi (required) Description Example
ctripPurchaseOrderId Long Y Y Y Ctrip Purchase Order ID 881823967638342968
categoryCode String Y Y Y Service Type airport-pickup, point-to-point
fromType Integer Y Y Y channel 1
totalPrice BigDecimal Y Y Y Total Price  
priceMark String Y Y Y Price Mark B00AABFF7DEA0ABD
fixedLocation FixedLocationDTO Y N N Airport/Station Info  
vehicleType Long Y Y Y Vehicle Type 117
useTime String Y Y Y Use Time 2020-08-28 14:46
duseLocation GeoDTO Y Y Y Address of Departure  
auseLocation GeoDTO Y Y Y Address of Arrival  
flightInfo FlightInfoDTO Y N N Flight Info  
language String Y Y Y Site Language zh-CN
passenger PassengerInfoDTO Y Y Y Passenger Info  
agent AgentInfoDTO N N N Agent Info  
masterOrderId Long Y Y Y Ctrip User Order ID 12744251457
selectAddServices List<SelectAddServiceDTO> Y Y N Selected Additional Service  
permission PermissionDTO N N N permission  
supportExternalDriver Bool N N N Support external driver  
adults Integer N N N No. Adult  
children Integer N N N No. Child  
luggage Integer N N N No. Baggage (24inch)  
discountCode String N N N Discount Code  
discountAmount BigDecimal N N N Discount Amount  
discountName String N N N Discount Name  
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:

  1. ctripPurchaseOrderId: 18 digits. Ctrip Purchase Order ID is tracked separately from user order ID, suppliers should use it as the unique identifier.
  2. priceMark: Price identifier for this query
  3. fixedLocation: Required for airport/station scenarios only. Not required for point-to-point and taxi-on-demand
  4. flightInfo: Required for airport/station scenarios only. Not required for point-to-point and taxi-on-demand
  5. language: Please use it as a hint for both customer service and driver language. Site Language list
  6. selectAddServices: Additional Service Code
  7. supportExternalDriver: Ture Support;False Forbid
  8. estimation: Required for taxi-on-demand scenarios. For reference only in other scenarios

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    
  1. Either name or firstName and lastName will be provided.
  2. 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  

AddSvcDTO

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

{
  "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
    }
  ],
  "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": "价格标识符不存在"
}

results matching ""

    No results matching ""