# Price Confirm

This API is used to confirm the rate plan level before making a booking.
It requires detailed information such as the number of rooms and occupancy to be provided.
Before creating a booking, this API needs to be called to obtain a reference number.
Dida typically returns a PriceConfirm result within 2 seconds and the timeout configuration is set at 20 seconds at the PriceConfirm step. If a result is not received within 20 seconds, it is suggested to resend a PriceConfirm request.

Please note: If the PriceConfirm cancellation policy (including meal type, rate, room name, availability, etc.) is inconsistent with the PriceSearch result, consider the PriceConfirm information as the final information.

POST
https://apiint.didatravel.com/api/rate/PriceConfirm?$format=json

# Difference between PreBook true/false

PreBook True/False: The PreBook parameter is used to indicate whether you intend to proceed to the booking confirmation step or not.

  • PreBook True: When PreBook is set to true, a reference number will be returned in the response. This reference number is required in the booking confirmation step.

  • PreBook False: If the client just wants to confirm the price without proceeding to the booking creation/confirmation step, PreBook should be set to false. This improves API performance as it prevents unnecessary processing.

In the following example, the code parameters inside are modifiable.
Use the following method to test API:
{
    "PreBook": true,
    "CheckInDate": "2023-08-01",
    "CheckOutDate": "2023-08-02",
    "NumOfRooms": 1,
    "HotelID": 512,
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "OccupancyDetails": [
        {
            "ChildCount": 2,
            "AdultCount": 2,
            "RoomNum": 1,
            "ChildAgeDetails": [1, 2]
        }
    ],
    "Currency": "USD",
    "Nationality": "CN",
    "RatePlanID": "1494507509528725623",
    "IsNeedOnRequest": false
}
In the following example, the code parameters inside are modifiable.
Use the following method to test API:
<PriceConfirmRequest>
  <Header>
    <ClientID>DidaApiTestID</ClientID>
    <LicenseKey>TestKey</LicenseKey>
  </Header>
  <HotelID>512</HotelID>
  <RatePlanID>1494507509528725623</RatePlanID>
  <CheckInDate>2023-08-01</CheckInDate>
  <CheckOutDate>2023-08-02</CheckOutDate>
  <Nationality>CN</Nationality>
  <NumOfRooms>1</NumOfRooms>
  <OccupancyDetails>
    <RoomOccupancy RoomNum="1" AdultCount="2" ChildCount="2">
       <ChildAgeDetails>
			<ChildAge>1</ChildAge>
            <ChildAge>2</ChildAge>
	   </ChildAgeDetails>
    </RoomOccupancy>
  </OccupancyDetails>
  <PreBook>true</PreBook>
  <Currency>USD</Currency>
  <IsNeedOnRequest>false</IsNeedOnRequest>
</PriceConfirmRequest>
   [
    {
        "name": "Header",
        "description": "Client authentication info",
        "children": [
            {
                "name": "ClientID",
                "description": "Client ID"
            },
            {
                "name": "LicenseKey",
                "description": "Client password"
            }
        ]
    },
    {
        "name": "HotelID",
        "description": "HotelID"
    },
    {
        "name": "RatePlanID",
        "description": "RateplanID"
    },
    {
        "name": "CheckInDate",
        "description": "Check-indate"
    },
    {
        "name": "CheckOutDate",
        "description": "Check-outdate"
    },
    {
        "name": "Nationality",
        "description": "ISO 3166-1 alpha-2, two-letter region codes. CN, US for example. Default CN if not provided"
    },
    {
        "name": "NumOfRooms",
        "description": "Number of rooms"
    },
    {
        "name": "OccupancyDetails",
        "description": "Guest info Collection",
        "children": [
            {
                "name": "ChildAgeDetails",
                "description": "Child age list. No age limit. If there is rate return in the response that means you input is valid for supplier/hotel"
            },
            {
                "name": "RoomNum",
                "description": "Room index. Starts from 1."
            },
            {
                "name": "AdultCount",
                "description": "Adult count for this room"
            },
            {
                "name": "ChildCount",
                "description": "Child count for this room"
            }
        ]
    },
    {
        "name": "PreBook",
        "description": "Whether it is prebook. If true, reference number will be returned. Should not set to true while it&#39;s not in the booking create/confirm step for a better api performance."
    },
    {
        "name": "Currency",
        "description": "Currency code"
    }
]
Request Parameters
Header HeaderType
Client authentication infoHeaderType
HotelID Int32 HotelIDInt32
RatePlanID String RateplanIDString
CheckInDate DateTime Check-indateDateTime
CheckOutDate DateTime Check-outdateDateTime
Nationality String ISO 3166-1 alpha-2, two-letter region codes. CN, US for example. Default CN if not providedString
NumOfRooms Int32 Number of roomsInt32
OccupancyDetails List<RoomOccupancyType>
Guest info CollectionList<RoomOccupancyType>
PreBook Boolean Whether it is prebook. If true, reference number will be returned. Should not set to true while it's not in the booking create/confirm step for a better api performance.Boolean
Currency String Currency codeString
Request Sample
{
    "PreBook": true,
    "CheckInDate": "2023-08-01",
    "CheckOutDate": "2023-08-02",
    "NumOfRooms": 1,
    "HotelID": 512,
    "Header": {
        "ClientID": "DidaApiTestID",
        "LicenseKey": "TestKey"
    },
    "OccupancyDetails": [
        {
            "ChildCount": 0,
            "AdultCount": 2,
            "RoomNum": 1,
            "ChildAgeDetails": []
        }
    ],
    "Currency": "USD",
    "Nationality": "CN",
    "RatePlanID": "1494507509528725623",
    "IsNeedOnRequest": true
}
Request Sample
<PriceConfirmRequest>
  <Header>
    <ClientID>DidaApiTestID</ClientID>
    <LicenseKey>TestKey</LicenseKey>
  </Header>
  <HotelID>512</HotelID>
  <RatePlanID>1494507509528725623</RatePlanID>
  <CheckInDate>2023-08-01</CheckInDate>
  <CheckOutDate>2023-08-02</CheckOutDate>
  <Nationality>CN</Nationality>
  <NumOfRooms>1</NumOfRooms>
  <OccupancyDetails>
    <RoomOccupancy RoomNum="1" AdultCount="2" ChildCount="0">
      <ChildAgeDetails />
    </RoomOccupancy>
  </OccupancyDetails>
  <PreBook>true</PreBook>
  <Currency>USD</Currency>
  <IsNeedOnRequest>true</IsNeedOnRequest>
</PriceConfirmRequest>
   [
    {
        "name": "Error",
        "description": "",
        "children": [
            {
                "name": "Code",
                "description": "Error code"
            },
            {
                "name": "Message",
                "description": "Error message"
            }
        ]
    },
    {
        "name": "Success",
        "description": "",
        "children": [
            {
                "name": "PriceDetails",
                "description": "Pricedetails",
                "children": [
                    {
                        "name": "ReferenceNo",
                        "description": "Return while PreBook is true. Reference number is needed for booking creation."
                    },
                    {
                        "name": "CheckInDate",
                        "description": "Check-indate"
                    },
                    {
                        "name": "CheckOutDate",
                        "description": "Check-outdate"
                    },
                    {
                        "name": "HotelList",
                        "description": "HotelinfoCollection",
                        "children": [
                            {
                                "name": "HotelID",
                                "description": "HotelID"
                            },
                            {
                                "name": "HotelName",
                                "description": "Hotel name"
                            },
                            {
                                "name": "Destination",
                                "description": "Hotel destination",
                                "children": [
                                    {
                                        "name": "CityCode",
                                        "description": "Region code"
                                    }
                                ]
                            },
                            {
                                "name": "TotalPrice",
                                "description": "Total price for the full length of stay"
                            },
                            {
                                "name": "TotalSupplement",
                                "description": "Obsolete"
                            },
                            {
                                "name": "TotalPriceWithoutSupplement",
                                "description": "Obsolete"
                            },
                            {
                                "name": "RatePlanList",
                                "description": "Rateplan Collection",
                                "children": [
                                    {
                                        "name": "RoomOccupancy",
                                        "description": "Guest info",
                                        "children": [
                                            {
                                                "name": "ChildAgeDetails",
                                                "description": "Child age list. No age limit. If there is rate return in the response that means you input is valid for supplier/hotel"
                                            },
                                            {
                                                "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": "RecommendIndex",
                                        "description": "RecommendIndex = 1, this rateplan rate is recommended"
                                    },
                                    {
                                        "name": "RatePlanName",
                                        "description": "Ratepla nname"
                                    },
                                    {
                                        "name": "BedType",
                                        "description": "BedtypeID"
                                    },
                                    {
                                        "name": "BreakfastType",
                                        "description": "BreakfasttypeID. Kind of obsolete. MealType is recommended. Please check MealType in Content API."
                                    },
                                    {
                                        "name": "MaxOccupancy",
                                        "description": "Obsolete"
                                    },
                                    {
                                        "name": "InventoryCount",
                                        "description": "Inventory count. For reference only"
                                    },
                                    {
                                        "name": "RoomStatus",
                                        "description": "Obsolete"
                                    },
                                    {
                                        "name": "Currency",
                                        "description": "Currency code"
                                    },
                                    {
                                        "name": "TotalPrice",
                                        "description": "Total booking price"
                                    },
                                    {
                                        "name": "PriceWithoutSupplement",
                                        "description": "Obsolete"
                                    },
                                    {
                                        "name": "PriceList",
                                        "description": "PriceinfoCollection",
                                        "children": [
                                            {
                                                "name": "Price",
                                                "description": "Price"
                                            },
                                            {
                                                "name": "InventoryCount",
                                                "description": "Inventory count. 仅供参考,不准的。供应商自身就无法提供准确的数字"
                                            },
                                            {
                                                "name": "StayDate",
                                                "description": "Staydate"
                                            },
                                            {
                                                "name": "MealType",
                                                "description": "MealType, please check MealType in content api"
                                            },
                                            {
                                                "name": "MealAmount",
                                                "description": "Regarding meal plans, Dida provides two fields to obtain information about the meal types. The first is BreakfastType, which in the Response only indicates the inclusion or exclusion of breakfast without specifying the number of meal servings. For clients developing the Dida API, this field is not recommended. The second is MealType, which not only represents the specific meal plan in the Response but is also accompanied by MealAmount to denote the number of meal servings included. If you utilize MealType, it is imperative to also parse the MealAmount field to avoid any interpretation errors or future disputes regarding the number of meal servings.Furthermore, in theory, the quantity of MealAmount is always less than or equal to the number of guests staying. For instance, if two guests are staying and MealAmount is 0, it means that breakfast is not included. A MealAmount of 1 indicates that only one breakfast serving is included, which is a scenario where some hotels may include one complimentary breakfast for two guests, and any additional servings would need to be purchased separately upon arrival. A MealAmount of 2 signifies that both guests have breakfast included in their stay."
                                            },
                                            {
                                                "name": "SalesRate",
                                                "description": "Recommended retail price"
                                            }
                                        ]
                                    },
                                    {
                                        "name": "StandardOccupancy",
                                        "description": "Obsolete"
                                    },
                                    {
                                        "name": "IsOnRequest",
                                        "description": "Is on-request price"
                                    },
                                    {
                                        "name": "TotalSalesRate",
                                        "description": "Total recommended retail price"
                                    },
                                    {
                                        "name": "IncludedFeeList",
                                        "description": "Included tax and fee list. For reference only. ",
                                        "children": [
                                            {
                                                "name": "FeeTypeName",
                                                "description": "Fee type name"
                                            },
                                            {
                                                "name": "Currency",
                                                "description": "Fee Currency"
                                            },
                                            {
                                                "name": "Amount",
                                                "description": "Fee Amount"
                                            }
                                        ]
                                    },
                                    {
                                        "name": "ExcludedFeeList",
                                        "description": "Excluded tax and fee list. For reference only. Guest should pay them at property.",
                                        "children": [
                                            {
                                                "name": "FeeTypeName",
                                                "description": "Fee type name"
                                            },
                                            {
                                                "name": "Currency",
                                                "description": "Fee Currency"
                                            },
                                            {
                                                "name": "Amount",
                                                "description": "Fee Amount"
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "name": "CancellationPolicyList",
                                "description": "CancellationpolicyinfoCollection",
                                "children": [
                                    {
                                        "name": "FromDate",
                                        "description": "Date when the cancellation rule is applied (please be kindly note all the cancelation are based on Beijing time)"
                                    },
                                    {
                                        "name": "Amount",
                                        "description": "Cancellation penalty amount"
                                    }
                                ]
                            },
                            {
                                "name": "TotalSalesRate",
                                "description": "Total recommended retail price"
                            },
                            {
                                "name": "IncludedFeeList",
                                "description": "Included tax and fee list. For reference only. ",
                                "children": [
                                    {
                                        "name": "FeeTypeName",
                                        "description": "Fee type name"
                                    },
                                    {
                                        "name": "Currency",
                                        "description": "Currency code"
                                    },
                                    {
                                        "name": "Amount",
                                        "description": "Fee Amount"
                                    }
                                ]
                            },
                            {
                                "name": "ExcludedFeeList",
                                "description": "Excluded tax and fee list. For reference only. Guest should pay them at property.",
                                "children": [
                                    {
                                        "name": "FeeTypeName",
                                        "description": "Fee type name"
                                    },
                                    {
                                        "name": "Currency",
                                        "description": "Currency code"
                                    },
                                    {
                                        "name": "Amount",
                                        "description": "Fee Amount"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    }
]
Response Parameters
Error ErrorType
ErrorType
Success PriceConfirmResponseSuccess
PriceConfirmResponseSuccess
Response Sample
{
    "Success": {
        "PriceDetails": {
            "CheckOutDate": "2023-08-02 00:00:00",
            "CheckInDate": "2023-08-01 00:00:00",
            "HotelList": [
                {
                    "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
                                }
                            ],
                            "IsOnRequest": false,
                            "StandardOccupancy": 2,
                            "PriceWithoutSupplement": 299.13,
                            "Supplement": 0.0,
                            "InventoryCount": 5,
                            "MaxOccupancy": 2,
                            "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"
                        }
                    ],
                    "TotalPriceWithoutSupplement": 299.13,
                    "TotalSupplement": 0.0,
                    "TotalPrice": 299.13,
                    "HotelName": "Cerulean Tower Tokyu Hotel"
                }
            ],
            "ReferenceNo": "1674000176857108480"
        }
    }
}
Response Sample
<PriceConfirmResponse>
  <Success>
    <PriceDetails>
      <ReferenceNo>1674000176857108480</ReferenceNo>
      <CheckInDate>2023-08-01</CheckInDate>
      <CheckOutDate>2023-08-02</CheckOutDate>
      <HotelList>
        <Hotel>
          <HotelID>512</HotelID>
          <HotelName>Cerulean Tower Tokyu Hotel</HotelName>
          <Destination CityCode="179900" />
          <TotalPrice>299.13</TotalPrice>
          <TotalSupplement>0.00</TotalSupplement>
          <TotalPriceWithoutSupplement>299.13</TotalPriceWithoutSupplement>
          <RatePlanList>
            <RatePlan>
              <RoomOccupancy RoomNum="1" AdultCount="2" />
              <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>
              <InventoryCount>5</InventoryCount>
              <RoomStatus>1</RoomStatus>
              <Currency>USD</Currency>
              <TotalPrice>299.13</TotalPrice>
              <Supplement>0.00</Supplement>
              <PriceWithoutSupplement>299.13</PriceWithoutSupplement>
              <PriceList>
                <PriceInfo>
                  <Price>299.13</Price>
                  <StayDate>2023-08-01</StayDate>
                  <MealType>1</MealType>
                  <MealAmount>0</MealAmount>
                </PriceInfo>
              </PriceList>
              <StandardOccupancy>2</StandardOccupancy>
              <IsOnRequest>false</IsOnRequest>
            </RatePlan>
          </RatePlanList>
          <CancellationPolicyList>
            <CancellationPolicy>
              <FromDate>2023-07-29T14:00:00+08:00</FromDate>
              <Amount>299.13</Amount>
            </CancellationPolicy>
          </CancellationPolicyList>
        </Hotel>
      </HotelList>
    </PriceDetails>
  </Success>
</PriceConfirmResponse>