# 订单创建

订单创建接口。创建订单前必须获得订单参考号,参考号可在价格确认接口获得。
订单参数如入住日期,房间数,人数等参数必须与订单确认中的参数保持一致。

POST
https://api.didatravel.com/api/booking/HotelBookingConfirm?$format=json
In the following example, the code parameters inside are modifiable.
Use the following method to test API:
{
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "CheckInDate": "2023-08-01",
    "CheckOutDate": "2023-08-02",
    "NumOfRooms": 1,
    "GuestList": [
        {
            "RoomNum": 1,
            "GuestInfo": [
                {
                    "Name": {
                        "Last": "ye",
                        "First": "vincent"
                    },
                    "IsAdult": true
                },
                {
					"Name": {
						"First": "ye",
						"Last": "vincent"
					},
					"IsAdult": false,
					"Age": 1
				}
            ]
        }
    ],
    "Contact": {
        "Name": {
            "Last": "ye",
            "First": "vincent"
        },
        "Email": "1476817418@qq.com",
        "Phone": "18328376425"
    },
    "ClientReference": "v-test-2023-06-28",
    "ReferenceNo": "1674000176857108480"
}
In the following example, the code parameters inside are modifiable.
Use the following method to test API:
<HotelBookingConfirmRQ>
  <Header>
    <ClientID>DidaApiTestID</ClientID>
    <LicenseKey>TestKey</LicenseKey>
  </Header>
  <ReferenceNo>1674000176857108480</ReferenceNo>
  <CheckInDate>2023-08-01</CheckInDate>
  <CheckOutDate>2023-08-02</CheckOutDate>
  <NumOfRooms>1</NumOfRooms>
  <GuestList>
    <Room RoomNum="1">
      <GuestInfo>
        <Name First="vincent" Last="ye" />
        <IsAdult>true</IsAdult>
      </GuestInfo>
      <GuestInfo>
        <Name First="vincent" Last="ye" />
        <Age>1</Age>
        <IsAdult>false</IsAdult>
      </GuestInfo>
    </Room>
  </GuestList>
  <Contact>
    <Name First="vincent" Last="ye" />
    <Phone>18328376425</Phone>
    <Email>1476817418@qq.com</Email>
  </Contact>
  <ClientReference>v-test-2023-06-28</ClientReference>
</HotelBookingConfirmRQ>
   [
    {
        "name": "Header",
        "description": "机构账号信息",
        "children": [
            {
                "name": "ClientID",
                "description": "机构账号"
            },
            {
                "name": "LicenseKey",
                "description": "机构账号密码"
            }
        ]
    },
    {
        "name": "ReferenceNo",
        "description": "要填写 Price Confirm 的 Response 里的 ReferenceNo"
    },
    {
        "name": "CheckInDate",
        "description": "Check-indate"
    },
    {
        "name": "CheckOutDate",
        "description": "Check-outdate"
    },
    {
        "name": "NumOfRooms",
        "description": "Number of rooms"
    },
    {
        "name": "GuestList",
        "description": "Guest info Collection",
        "children": [
            {
                "name": "GuestInfo",
                "description": "Guest info node Collection",
                "children": [
                    {
                        "name": "Name",
                        "description": "Guest name",
                        "children": [
                            {
                                "name": "First",
                                "description": "客人名字"
                            },
                            {
                                "name": "Last",
                                "description": "客人姓氏"
                            }
                        ]
                    },
                    {
                        "name": "Gender",
                        "description": "客人性别,M: 男性;F: 女性。只能是 M 或 F,不能是其他值"
                    },
                    {
                        "name": "Phone",
                        "description": "Guest phone"
                    },
                    {
                        "name": "Address",
                        "description": "Guest address"
                    },
                    {
                        "name": "Email",
                        "description": "Guest email"
                    },
                    {
                        "name": "Age",
                        "description": "客人年龄。成人选填,儿童必填"
                    },
                    {
                        "name": "IsAdult",
                        "description": "客人是否是成人"
                    }
                ]
            },
            {
                "name": "RoomNum",
                "description": "Booking room index"
            }
        ]
    },
    {
        "name": "Contact",
        "description": "联系人信息。可以填客人的联系信息 或 贵司的订单客服联系信息",
        "children": [
            {
                "name": "Name",
                "description": "Booking contac tname",
                "children": [
                    {
                        "name": "First",
                        "description": "Contact first name"
                    },
                    {
                        "name": "Last",
                        "description": "Contact last name"
                    }
                ]
            },
            {
                "name": "Phone",
                "description": "Contact phone"
            },
            {
                "name": "Email",
                "description": "Contact email"
            }
        ]
    },
    {
        "name": "CustomerRequest",
        "description": "特殊需求。我们会尽力满足客人的需求,但无法保证能完全满足。"
    },
    {
        "name": "ClientReference",
        "description": "贵方的订单号。贵方的订单号跟我们的订单号存在一对一的绑定关系,贵方不能使用同一个订单号来创建两个或以上的道旅订单。请注意,此字段为选填,假如不提供此字段的值,那么您无须担心一对一关系的问题,不提供就不构成这个关系。"
    },
    {
        "name": "PaymentInfo",
        "description": "Payment Information。假如贵方使用的不是信用卡结算,无须填充此节点",
        "children": [
            {
                "name": "CreditCardInfo",
                "description": "Credit card information",
                "children": [
                    {
                        "name": "CardNumber",
                        "description": "Credit card number"
                    },
                    {
                        "name": "CardExpirationYear",
                        "description": "卡片过期-年,请使用 4 位数字。如 2030"
                    },
                    {
                        "name": "CardExpirationMonth",
                        "description": "卡片过期-月,请使用 2 位数字。如 02, 11 等"
                    },
                    {
                        "name": "CardCVV",
                        "description": "Card Verification Value"
                    },
                    {
                        "name": "CardHolderName",
                        "description": "持卡人姓名"
                    },
                    {
                        "name": "CardHolderCountry",
                        "description": "持卡人地区码 (ISO3166-2)"
                    },
                    {
                        "name": "CardHolderEmail",
                        "description": "持卡人邮箱"
                    },
                    {
                        "name": "CardHolderCity",
                        "description": "持卡人城市"
                    },
                    {
                        "name": "CardHolderAddress",
                        "description": "持卡人地址"
                    },
                    {
                        "name": "CardHolderZip",
                        "description": "持卡人邮编号码"
                    }
                ]
            }
        ]
    }
]
Request Parameters
Header HeaderType
机构账号信息HeaderType
ReferenceNo String 要填写 Price Confirm 的 Response 里的 ReferenceNoString
CheckInDate DateTime Check-indateDateTime
CheckOutDate DateTime Check-outdateDateTime
NumOfRooms Int32 Number of roomsInt32
GuestList List<GuestListTypeRoom>
Guest info CollectionList<GuestListTypeRoom>
Contact ContactType Mandatory
联系人信息。可以填客人的联系信息 或 贵司的订单客服联系信息ContactTypeMandatory
CustomerRequest String 特殊需求。我们会尽力满足客人的需求,但无法保证能完全满足。String
ClientReference String Optional 贵方的订单号。贵方的订单号跟我们的订单号存在一对一的绑定关系,贵方不能使用同一个订单号来创建两个或以上的道旅订单。请注意,此字段为选填,假如不提供此字段的值,那么您无须担心一对一关系的问题,不提供就不构成这个关系。StringOptional
PaymentInfo PaymentInfoType Optional
Payment Information。假如贵方使用的不是信用卡结算,无须填充此节点PaymentInfoTypeOptional
Request Sample
{
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "CheckInDate": "2023-08-01",
    "CheckOutDate": "2023-08-02",
    "NumOfRooms": 1,
    "GuestList": [
        {
            "RoomNum": 1,
            "GuestInfo": [
                {
                    "Name": {
                        "Last": "ye",
                        "First": "vincent"
                    },
                    "IsAdult": true
                }
            ]
        }
    ],
    "Contact": {
        "Name": {
            "Last": "ye",
            "First": "vincent"
        },
        "Email": "1476817418@qq.com",
        "Phone": "18328376425"
    },
    "ClientReference": "v-test-2023-06-28",
    "ReferenceNo": "1674000176857108480"
}
Request Sample
<HotelBookingConfirmRQ>
  <Header>
    <ClientID>DidaApiTestID</ClientID>
    <LicenseKey>TestKey</LicenseKey>
  </Header>
  <ReferenceNo>1674000176857108480</ReferenceNo>
  <CheckInDate>2023-08-01</CheckInDate>
  <CheckOutDate>2023-08-02</CheckOutDate>
  <NumOfRooms>1</NumOfRooms>
  <GuestList>
    <Room RoomNum="1">
      <GuestInfo>
        <Name First="vincent" Last="ye" />
        <IsAdult>true</IsAdult>
      </GuestInfo>
      <GuestInfo>
        <Name First="vincent" Last="ye" />
        <Age>1</Age>
        <IsAdult>false</IsAdult>
      </GuestInfo>
    </Room>
  </GuestList>
  <Contact>
    <Name First="vincent" Last="ye" />
    <Phone>18328376425</Phone>
    <Email>1476817418@qq.com</Email>
  </Contact>
  <ClientReference>v-test-2023-06-28</ClientReference>
</HotelBookingConfirmRQ>
   [
    {
        "name": "Error",
        
        "description": "",
        "children": [
            {
                "name": "Code",
                
                "description": "Error code"
            },
            {
                "name": "Message",
                
                "description": "Error message"
            },
            {
                "name": "BookingID",
                
                "description": null
            }
        ]
    },
    {
        "name": "Success",
        
        "description": "",
        "children": [
            {
                "name": "BookingDetails",
                
                "description": "Bookingdetails",
                "children": [
                    {
                        "name": "BookingID",
                        
                        "description": "Dida/Supplier booking ID"
                    },
                    {
                        "name": "Status",
                        
                        "description": "订单状态。 0-PreBook, 2-Confirmed, 3-Canceled, 4-Failed, 5-Pending(InProcess), 6-OnRequest"
                    },
                    {
                        "name": "CheckInDate",
                        
                        "description": "Check-indate"
                    },
                    {
                        "name": "CheckOutDate",
                        
                        "description": "Check-outdate"
                    },
                    {
                        "name": "OrderDate",
                        
                        "description": "Booking create date (北京时区)"
                    },
                    {
                        "name": "NumOfRooms",
                        
                        "description": "Number of rooms"
                    },
                    {
                        "name": "TotalPrice",
                        
                        "description": "Total booking price"
                    },
                    {
                        "name": "GuestList",
                        
                        "description": "Guest info Collection",
                        "children": [
                            {
                                "name": "GuestInfo",
                                
                                "description": "Guest info node Collection",
                                "children": [
                                    {
                                        "name": "Name",
                                        
                                        "description": "Guest name",
                                        "children": [
                                            {
                                                "name": "First",
                                                
                                                "description": "客人名字"
                                            },
                                            {
                                                "name": "Last",
                                                
                                                "description": "客人姓氏"
                                            }
                                        ]
                                    },
                                    {
                                        "name": "Gender",
                                        
                                        "description": "客人性别"
                                    },
                                    {
                                        "name": "Phone",
                                        
                                        "description": "Guest phone"
                                    },
                                    {
                                        "name": "Address",
                                        
                                        "description": "Guest address"
                                    },
                                    {
                                        "name": "Email",
                                        
                                        "description": "Guest email"
                                    },
                                    {
                                        "name": "Age",
                                        
                                        "description": "客人年龄,成人选填,儿童必填"
                                    },
                                   
                                    {
                                        "name": "IsAdult",
                                        
                                        "description": "客人是否是成人"
                                    }
                                ]
                            },
                            {
                                "name": "RoomNum",
                                
                                "description": "Booking room index"
                            }
                        ]
                    },
                    {
                        "name": "Contact",
                        
                        "description": "Contact info. 客人或贵方的联系方式",
                        "children": [
                            {
                                "name": "Name",
                                
                                "description": "Booking contact name",
                                "children": [
                                    {
                                        "name": "First",
                                        
                                        "description": "联系人名字"
                                    },
                                    {
                                        "name": "Last",
                                        
                                        "description": "联系人姓氏"
                                    }
                                ]
                            },
                            {
                                "name": "Phone",
                                
                                "description": "Contact phone"
                            },
                            {
                                "name": "Email",
                                
                                "description": "Contact email"
                            }
                        ]
                    },
                    {
                        "name": "CustomerRequest",
                        
                        "description": "特殊需求。我们会尽力满足客人的需求,但无法保证能完全满足。"
                    },
                    {
                        "name": "ClientReference",
                        
                        "description": "贵方的订单号。贵方的订单号跟我们的订单号存在一对一的绑定关系,贵方不能使用同一个订单号来创建两个或以上的道旅订单。请注意,此字段为选填,假如不提供此字段的值,那么您无须担心一对一关系的问题,不提供就不构成这个关系。"
                    },
                    {
                        "name": "ConfirmationCode",
                        
                        "description": "酒店确认号"
                    },
                    {
                        "name": "Hotel",
                        
                        "description": "Booking hotel details",
                        "children": [
                            {
                                "name": "HotelID",
                                
                                "description": "HotelID"
                            },
                            {
                                "name": "HotelName",
                                
                                "description": "Hotel Name"
                            },
                            {
                                "name": "Destination",
                                
                                "description": "Hotel destination info",
                                "children": [
                                    {
                                        "name": "CityCode",
                                        
                                        "description": "Region code"
                                    }
                                ]
                            },
                          
                            {
                                "name": "RatePlanList",
                                
                                "description": "Booking rateplan details Collection",
                                "children": [
                                    {
                                        "name": "RoomOccupancy",
                                        
                                        "description": "Occupancy details",
                                        "children": [
                                            {
                                                "name": "ChildAgeDetails",
                                                
                                                "description": "Child age details"
                                            },
                                            {
                                                "name": "RoomNum",
                                                
                                                "description": "Booking room index"
                                            },
                                            {
                                                "name": "AdultCount",
                                                
                                                "description": "Adult count"
                                            },
                                            {
                                                "name": "ChildCount",
                                                
                                                "description": "Child count"
                                            }
                                        ]
                                    },
                                    {
                                        "name": "RoomTypeID",
                                        
                                        "description": "RoomTypeID"
                                    },
                                 
                                    {
                                        "name": "RoomName",
                                        
                                        "description": "Room Name"
                                    },
                                    {
                                        "name": "RoomName_CN",
                                        
                                        "description": "Room Name in CN"
                                    },
                                    {
                                        "name": "RatePlanID",
                                        
                                        "description": "RateplanID"
                                    },
                                    {
                                        "name": "RatePlanName",
                                        
                                        "description": "Rateplan name"
                                    },
                                    {
                                        "name": "BedType",
                                        
                                        "description": "BedtypeID"
                                    },
                                    {
                                        "name": "BreakfastType",
                                        
                                        "description": "BreakfasttypeID. 已经过时了, 可以使用 MealType + MealAmount 组合. 当然, 这个字段的值会跟 MealType + MealAmount 保持一致。但有一种场景不一样。例如 入住 2 人, MealType = Breakfast, MealAmount = 1 (只含单早),此字段会表现为无早。如果人数跟餐数对不齐,就会认为是无早。"
                                    },
                                    {
                                        "name": "Currency",
                                        
                                        "description": "Currencycode"
                                    },
                                    {
                                        "name": "TotalPrice",
                                        
                                        "description": "此房间的总价"
                                    },
                                    {
                                        "name": "PriceList",
                                        
                                        "description": "Price info Collection",
                                        "children": [
                                            {
                                                "name": "Price",
                                                
                                                "description": "Price"
                                            },
                                            {
                                                "name": "StayDate",
                                                
                                                "description": "StayDate"
                                            },
                                            {
                                                "name": "MealType",
                                                
                                                "description": "MealType"
                                            },
                                            {
                                                "name": "MealAmount",
                                                
                                                "description": "关于餐型,Dida 有两个字段可以获取餐型信息。第一个是 BreakfastType,在 Response 里面,Dida 只返回是否含早或者不含早,不能显示具体的餐型份数,对于新开发 DidaAPI 的客户,不推荐使用这个字段。第二个是 MealType,在 Response 里面,不仅有 MealType 可以表示具体的餐型,还有 MealAmount 表示含餐的份数,如果您使用了 MealType,那么请一定要同时解析 MealAmount 字段,以免出现解析错误或者未来产生关于餐型份数的争议。 且理论上来说,MealAmount 的数量总是小于或者等于入住人数。例如,如果有两个客人入住,MealAmount 为 0,则表示不含早。MealAmount 为 1,表示只含1份早餐,这种情况是存在的,有些酒店2人入住,只包含1份免费早餐,如果需要2份早餐的话,另外一份需要在线或者到店额外付费购买。MealAmount 为 2,表示入住的2个人买,都含有早餐。"
                                            }
                                        ]
                                    },
                                   
                                    {
                                        "name": "StandardOccupancy",
                                        
                                        "description": "Obsolete"
                                    }
                                    
                                ]
                            },
                            {
                                "name": "CancellationPolicyList",
                                
                                "description": "整个订单的取消政策",
                                "children": [
                                    {
                                        "name": "FromDate",
                                        
                                        "description": "此取消政策生效的起始日期。注意了,是北京时间,不是酒店的当地时间"
                                    },
                                    {
                                        "name": "Amount",
                                        
                                        "description": "Cancellation penaly amount"
                                    }
                                ]
                            },
                            {
                                "name": "IncludedFeeList",
                                
                                "description": "此报价包含了的税费,仅供参考。实现的时候不要再把此税费列表里的价格跟 TotalPrice 运算, TotalPrice 就已经包含.",
                                "children": [
                                    {
                                        "name": "FeeTypeName",
                                        
                                        "description": "Fee type name"
                                    },
                                    {
                                        "name": "Currency",
                                        
                                        "description": "Currency code"
                                    },
                                    {
                                        "name": "Amount",
                                        
                                        "description": "Cancellation penalty amount"
                                    }
                                ]
                            },
                            {
                                "name": "ExcludedFeeList",
                                
                                "description": "此报价不包含的税费,这些税费是客人需要到酒店后付的。",
                                "children": [
                                    {
                                        "name": "FeeTypeName",
                                        
                                        "description": "Fee type name"
                                    },
                                    {
                                        "name": "Currency",
                                        
                                        "description": "Currency code"
                                    },
                                    {
                                        "name": "Amount",
                                        
                                        "description": "Cancellation penalty amount"
                                    }
                                ]
                            },
                            
                        ]
                    }
                    
                ]
            }
        ]
    }
]
Response Parameters
Error ErrorType
ErrorType
Success HotelBookingConfirmRSSuccess
HotelBookingConfirmRSSuccess
Response Sample
{
    "Success": {
        "BookingDetails": {
            "TotalPrice": 299.13,
            "OrderDate": "2023-06-28 18:21:58.877",
            "CheckOutDate": "2023-08-02 00:00:00",
            "CheckInDate": "2023-08-01 00:00:00",
            "NumOfRooms": 1,
            "Status": 2,
            "GuestList": [
                {
                    "RoomNum": 1,
                    "GuestInfo": [
                        {
                            "IsAdult": true,
                            "Name": {
                                "Last": "ye",
                                "First": "vincent"
                            }
                        }
                    ]
                }
            ],
            "Contact": {
                "Name": {
                    "Last": "ye",
                    "First": "vincent"
                },
                "Email": "1476817418@qq.com",
                "Phone": "18328376425"
            },
            "Hotel": {
                "HotelID": 512,
                "Destination": {
                    "CityCode": "179900"
                },
                "RatePlanList": [
                    {
                        "TotalPrice": 299.13,
                        "RoomStatus": 1,
                        "BreakfastType": 1,
                        "BedType": 2,
                        "RoomOccupancy": {
                            "ChildCount": 0,
                            "AdultCount": 2,
                            "RoomNum": 1
                        },
                        "PriceList": [
                            {
                                "StayDate": "2023-08-01 00:00:00",
                                "Price": 299.13,
                                "MealAmount": 0,
                                "MealType": 1
                            }
                        ],
                        "Currency": "USD",
                        "RatePlanName": "Double Standard Floor 19-30F (28-31sqm)",
                        "RatePlanID": "1494507509528725623"
                    }
                ],
                "CancellationPolicyList": [
                    {
                        "Amount": 299.13,
                        "FromDate": "2023-07-29T14:00:00+08:00"
                    }
                ],
                "IncludedFeeList": [
                    {
                        "Amount": 28.5,
                        "Currency": "USD",
                        "FeeTypeName": "tax_and_service_fee"
                    }
                ],
                "ExcludedFeeList": [
                    {
                        "Amount": 2.73,
                        "Currency": "USD",
                        "FeeTypeName": "A tax is imposed by the city"
                    }
                ],
                "HotelName": "Cerulean Tower Tokyu Hotel"
            },
            "ClientReference": "v-test-2023-06-28",
            "CustomerRequest": "",
            "BookingID": "1674000176857108480"
        }
    }
}
Response Sample
<HotelBookingConfirmRS>
  <Success>
    <BookingDetails>
      <BookingID>1674000176857108480</BookingID>
      <Status>2</Status>
      <CheckInDate>2023-08-01</CheckInDate>
      <CheckOutDate>2023-08-02</CheckOutDate>
      <OrderDate>2023-06-28T18:21:58.877+08:00</OrderDate>
      <NumOfRooms>1</NumOfRooms>
      <TotalPrice>299.1300000000</TotalPrice>
      <GuestList>
        <Room RoomNum="1">
          <GuestInfo>
            <Name First="vincent" Last="ye" />
            <IsAdult>true</IsAdult>
          </GuestInfo>
          <GuestInfo>
            <Name First="vincent" Last="ye" />
            <Age>1</Age>
            <IsAdult>false</IsAdult>
          </GuestInfo>
        </Room>
      </GuestList>
      <Contact>
        <Name First="vincent" Last="ye" />
        <Phone>18328376425</Phone>
        <Email>1476817418@qq.com</Email>
      </Contact>
      <CustomerRequest />
      <ClientReference>v-test-2023-06-28</ClientReference>
      <Hotel>
        <HotelID>512</HotelID>
        <HotelName>Cerulean Tower Tokyu Hotel</HotelName>
        <Destination CityCode="179900" />
        <RatePlanList>
          <RatePlan>
            <RoomOccupancy RoomNum="1" AdultCount="2" />
            <RatePlanID>1494507509528725623</RatePlanID>
            <RatePlanName>Double Standard Floor 19-30F (28-31sqm)</RatePlanName>
            <BedType>2</BedType>
            <BreakfastType>1</BreakfastType>
            <RoomStatus>1</RoomStatus>
            <Currency>USD</Currency>
            <TotalPrice>299.1300000000</TotalPrice>
            <PriceList>
              <PriceInfo>
                <Price>299.13</Price>
                <StayDate>2023-08-01</StayDate>
                <MealType>1</MealType>
                <MealAmount>0</MealAmount>
              </PriceInfo>
            </PriceList>
          </RatePlan>
        </RatePlanList>
        <CancellationPolicyList>
          <CancellationPolicy>
            <FromDate>2023-07-29T14:00:00+08:00</FromDate>
            <Amount>299.1300000000</Amount>
          </CancellationPolicy>
        </CancellationPolicyList>
        <IncludedFeeList>
            <FeeInfo>
                <FeeTypeName>tax_and_service_fee</FeeTypeName>
                <Currency>USD</Currency>
                <Amount>28.5</Amount>
            </FeeInfo>
        </IncludedFeeList>
        <ExcludedFeeList>
            <FeeInfo>
                <FeeTypeName>A tax is imposed by the city</FeeTypeName>
                <Currency>USD</Currency>
                <Amount>2.73</Amount>
            </FeeInfo>
        </ExcludedFeeList>
      </Hotel>
    </BookingDetails>
  </Success>
</HotelBookingConfirmRS>