# 订单搜索

查询订单接口,可以以订单号或者其他参数搜索订单。

以下 "DidaApiTestID" 这个账号的所有订单数据均为测试数据。

POST
https://api.didatravel.com/api/booking/HotelBookingSearch?$format=json
  • 使用道旅订单号搜索 推荐
{
	"Header": {
		"ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
	},
	"SearchBy": {
		"BookingID": "1674000176857108480"
	}
}
<HotelBookingSearchRQ>
    <Header>
        <ClientID>DidaApiTestID</ClientID>
        <LicenseKey>TestKey</LicenseKey>
    </Header>
    <SearchBy>
        <BookingID>1674000176857108480</BookingID>
    </SearchBy>
</HotelBookingSearchRQ>

  • 使用客户订单号搜索 推荐
{
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "SearchBy": {
        "BookingInfo": {
            "ClientReference": "v-test-2023-06-28"
        }
    }
}
<HotelBookingSearchRQ>
    <Header>
        <ClientID>DidaApiTestID</ClientID>
        <LicenseKey>TestKey</LicenseKey>
    </Header>
    <SearchBy>
        <BookingInfo>
            <ClientReference>v-test-2023-06-28</ClientReference>
        </BookingInfo>
    </SearchBy>
</HotelBookingSearchRQ>

  • 使用入住时间范围搜索
{
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "SearchBy": {
        "BookingInfo": {
            "CheckInDateRange":{
                "from": "2023-06-26",
                "to": "2023-06-26"
            }
        }
    }
}
<HotelBookingSearchRQ>
    <Header>
        <ClientID>DidaApiTestID</ClientID>
        <LicenseKey>TestKey</LicenseKey>
    </Header>
    <SearchBy>
        <BookingInfo>
            <CheckInDateRange from="2023-06-26" to="2023-06-26" />
        </BookingInfo>
    </SearchBy>
</HotelBookingSearchRQ>

  • 使用离店时间范围搜索
{
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "SearchBy": {
        "BookingInfo": {
            "CheckOutDateRange":{
                "from": "2023-06-27",
                "to": "2023-06-27"
            }
        }
    }
}
<HotelBookingSearchRQ>
    <Header>
        <ClientID>DidaApiTestID</ClientID>
        <LicenseKey>TestKey</LicenseKey>
    </Header>
    <SearchBy>
        <BookingInfo>
            <CheckOutDateRange from="2023-06-27" to="2023-06-27" />
        </BookingInfo>
    </SearchBy>
</HotelBookingSearchRQ>

  • 使用订单创建时间范围来搜索
{
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "SearchBy": {
        "BookingInfo": {
            "BookDateRange":{
                "from": "2023-06-26",
                "to": "2023-06-26"
            }
        }
    }
}
<HotelBookingSearchRQ>
    <Header>
        <ClientID>DidaApiTestID</ClientID>
        <LicenseKey>TestKey</LicenseKey>
    </Header>
    <SearchBy>
        <BookingInfo>
            <BookDateRange from="2023-06-26" to="2023-06-26" />
        </BookingInfo>
    </SearchBy>
</HotelBookingSearchRQ>

  • 使用复杂的组合条件来搜索
{
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "SearchBy": {
        "BookingInfo": {
            "CheckInDateRange":{
                "from": "2023-06-26",
                "to": "2023-06-27"
            },
            "CheckOutDateRange":{
                "from": "2023-06-26",
                "to": "2023-06-27"
            },
            "BookDateRange":{
                "from": "2023-06-26",
                "to": "2023-06-26"
            }
        }
    }
}
<HotelBookingSearchRQ>
    <Header>
        <ClientID>DidaApiTestID</ClientID>
        <LicenseKey>TestKey</LicenseKey>
    </Header>
    <SearchBy>
        <BookingInfo>
            <CheckInDateRange from="2023-06-26" to="2023-06-27" />
            <CheckOutDateRange from="2023-06-26" to="2023-06-27" />
            <BookDateRange from="2023-06-26" to="2023-06-26" />
        </BookingInfo>
    </SearchBy>
</HotelBookingSearchRQ>
In the following example, the code parameters inside are modifiable.
Use the following method to test API:
{
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "SearchBy": {
        "BookingID": "1674000176857108480"
    }
}
In the following example, the code parameters inside are modifiable.
Use the following method to test API:
<HotelBookingSearchRQ>
  <Header>
    <ClientID>DidaApiTestID</ClientID>
    <LicenseKey>TestKey</LicenseKey>
  </Header>
  <SearchBy>
    <BookingID>1674000176857108480</BookingID>
  </SearchBy>
</HotelBookingSearchRQ>
   [
    {
        "name": "Header",
        "description": "机构账号信息",
        "children": [
            {
                "name": "ClientID",
                "description": "机构账号"
            },
            {
                "name": "LicenseKey",
                "description": "机构账号密码"
            }
        ]
    },
    {
        "name": "SearchBy",
        "description": "Search condition",
        "children": [
            {
                "name": "BookingID",
                "description": "Dida BookingID"
            },
            {
                "name": "BookingInfo",
                "description": "Booking info",
                "children": [
                    {
                        "name": "GuestName",
                        "description": "Guest name",
                        "children": [
                            {
                                "name": "First",
                                "description": "Guest first name"
                            },
                            {
                                "name": "Last",
                                "description": "Guest last name"
                            }
                        ]
                    },
                    {
                        "name": "ContactName",
                        "description": "Contact name",
                        "children": [
                            {
                                "name": "First",
                                "description": "联系人名字"
                            },
                            {
                                "name": "Last",
                                "description": "联系人姓氏"
                            }
                        ]
                    },
                    {
                        "name": "Status",
                        "description": "Bookings tatus"
                    },
                    {
                        "name": "CheckInDateRange",
                        "description": "Check-indaterange",
                        "children": [
                            {
                                "name": "from",
                                "description": "Start date"
                            },
                            {
                                "name": "to",
                                "description": "End date"
                            }
                        ]
                    },
                    {
                        "name": "CheckOutDateRange",
                        "description": "Check-outdaterange",
                        "children": [
                            {
                                "name": "from",
                                "description": "Start date"
                            },
                            {
                                "name": "to",
                                "description": "End date"
                            }
                        ]
                    },
                    {
                        "name": "BookDateRange",
                        "description": "Booking date range",
                        "children": [
                            {
                                "name": "from",
                                "description": "Start date"
                            },
                            {
                                "name": "to",
                                "description": "End date"
                            }
                        ]
                    },
                    {
                        "name": "CityCode",
                        "description": "City code"
                    },
                    {
                        "name": "ClientReference",
                        "description": "客户订单号"
                    }
                ]
            }
        ]
    }
]
Request Parameters
Header HeaderType
机构账号信息HeaderType
SearchBy HotelBookingSearchRQSearchBy
Search conditionHotelBookingSearchRQSearchBy
Request Sample
{
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "SearchBy": {
        "BookingID": "1674000176857108480"
    }
}
Request Sample
<HotelBookingSearchRQ>
  <Header>
    <ClientID>DidaApiTestID</ClientID>
    <LicenseKey>TestKey</LicenseKey>
  </Header>
  <SearchBy>
    <BookingID>1674000176857108480</BookingID>
  </SearchBy>
</HotelBookingSearchRQ>
   [
    {
        "name": "Error",
        "description": "Error",
        "children": [
            {
                "name": "Code",
                "description": "Error code"
            },
            {
                "name": "Message",
                "description": "Error message"
            },
            {
                "name": "BookingID",
                "description": "Dida BookingID"
            }
        ]
    },
    {
        "name": "Success",
        "description": "",
        "children": [
            {
                "name": "BookingDetailsList",
                "description": "Booking details Collection",
                "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
ErrorErrorType
Success HotelBookingSearchRSSuccess
HotelBookingSearchRSSuccess
Response Sample
{
    "Success": {
        "BookingDetailsList": [
            {
                "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
                                }
                            ],
                            "MaxOccupancy": 2,
                            "RoomTypeID": 6950339,
                            "Currency": "USD",
                            "RatePlanName": "Double Standard Floor 19-30F (28-31sqm)",
                            "RatePlanID": "1494507509528725623",
                            "RoomName": "Queen Room"
                        }
                    ],
                    "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"
                        }
                    ],
                    "TotalPrice": 299.13,
                    "HotelName": "Cerulean Tower Tokyu Hotel"
                },
                "ClientReference": "v-test-2023-06-28",
                "BookingID": "1674000176857108480"
            }
        ]
    }
}
Response Sample
<HotelBookingSearchRS>
  <Success>
    <BookingDetailsList>
      <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.13</TotalPrice>
        <GuestList>
          <Room RoomNum="1">
            <GuestInfo>
              <Name First="vincent" Last="ye" />
              <IsAdult>true</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>
        <Hotel>
          <HotelID>512</HotelID>
          <HotelName>Cerulean Tower Tokyu Hotel</HotelName>
          <Destination CityCode="179900" />
          <TotalPrice>299.13</TotalPrice>
          <RatePlanList>
            <RatePlan>
              <RoomOccupancy RoomNum="1" AdultCount="2" ChildCount="0" />
              <RoomTypeID>6950339</RoomTypeID>
              <RoomName>Queen Room</RoomName>
              <RatePlanID>1494507509528725623</RatePlanID>
              <RatePlanName>Double Standard Floor 19-30F (28-31sqm)</RatePlanName>
              <BedType>2</BedType>
              <BreakfastType>1</BreakfastType>
              <MaxOccupancy>2</MaxOccupancy>
              <RoomStatus>1</RoomStatus>
              <Currency>USD</Currency>
              <TotalPrice>299.13</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.13</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>
    </BookingDetailsList>
  </Success>
</HotelBookingSearchRS>