1. 程式人生 > >訂酒店介面 攜程酒店線上預訂

訂酒店介面 攜程酒店線上預訂

攜程酒店資訊查詢,訂酒店介面,線上預訂和支付下單。

介面名稱:訂酒店介面

介面地址:http://api2.juheapi.com/xiecheng/hotel/avail

支援格式:json

請求方式:http post

請求引數說明:

名稱

型別

必填

說明

HotelCode

string

酒店程式碼

Start

string

開始時間(格式:2013-06-27T13:00:00.000+08:00)

End

string

結束時間(格式:2013-06-27T13:00:00.000+08:00)

RatePlanCode

string

價格計劃程式碼

Quantity

string

將要預訂的房間數量

Count

string

客人數量

LateArrivalTime

string

入住人最晚到店時間

key

string

應用APPKEY(應用詳細頁查詢)

引數示例:

{"Key":"您申請的appkey","HotelCode":"1024365","Start":"2015-03-23T18:00:00.000+08:00","End":"2015-03-24T13:00:00.000+08:00","RatePlanCode":"5694600","Quantity":"2","Count":"2","LateArrivalTime":"2015-03-23T23:00:00.000+08:00"}

返回引數說明:

名稱

型別

說明

AvailabilityStatus

string

是否可定(AvailableForSale:可定)

Text

string

該酒店訂單說明(需要特別注意!!)

Total.AmountBeforeTax

string

總費用

訂酒店介面呼叫JSON返回示例:

{
  "error_code": "200",
  "reason": "請求成功",
  "result": {
    "Response": {
      "HotelResponse": {
        "OTA_HotelAvailRS": {
          "PrimaryLangID": "zh",
          "TimeStamp": "2015-03-16T11:30:45.6045434+08:00",
          "Version": "2.0",
          "xmlns": "http://www.opentravel.org/OTA/2003/05",
          "RoomStays": {
            "RoomStay": {
              "AvailabilityStatus": "AvailableForSale",
              "CancelPenalties": {
                "CancelPenalty": {
                  "End": "2015-03-24T13:00:00",
                  "Start": "2015-03-23T18:00:00",
                  "AmountPercent": {
                    "Amount": "150.00",
                    "CurrencyCode": "CNY"
                  }
                }
              },
              "DepositPayments": {
                "GuaranteePayment": {
                  "End": "2015-03-23 00:00:00",
                  "GuaranteeCode": "4",
                  "Start": "2015-03-23 00:00:00",
                  "AmountPercent": {
                    "Amount": "150.00",
                    "CurrencyCode": "CNY"
                  },
                  "Description": {
                    "Text": "訂單提交後我們會立即操作扣款,如訂單不確認將全額退款至您的付款賬戶。如需修改取消訂單,請在2015-03-23 18:00以前通知攜程。若未入住或過此時間取消修改,我們將收取您首日房費{Money}。"
                  }
                }
              },
              "RatePlans": {
                "RatePlan": {
                  "AvailableQuantity": "8",
                  "PrepaidIndicator": "true",
                  "RatePlanCode": "5694600",
                  "RatePlanName": "單人間",
                  "MealsIncluded": {
                    "Breakfast": "false"
                  },
                  "RatePlanDescription": {
                    "Text": ""
                  }
                }
              },
              "RoomRates": {
                "RoomRate": {
                  "RatePlanCode": "5694600",
                  "RoomTypeCode": "2481396",
                  "Rates": {
                    "Rate": {
                      "EffectiveDate": "2015-03-23",
                      "ExpireDate": "2015-03-23",
                      "MaxGuestApplicable": "1",
                      "Base": {
                        "AmountBeforeTax": "75.00",
                        "CurrencyCode": "CNY",
                        "TPA_Extensions": {
                          "OtherCurrency": {
                            "AmountPercentType": {
                              "Amount": "75.00",
                              "CurrencyCode": "CNY"
                            }
                          }
                        }
                      },
                      "Fees": ""
                    }
                  }
                }
              },
              "RoomTypes": {
                "RoomType": {
                  "RoomType": "單人間",
                  "RoomTypeCode": "2481396",
                  "RoomDescription": {
                    "Text": ""
                  }
                }
              },
              "Total": {
                "AmountBeforeTax": "150.00",
                "CurrencyCode": "CNY"
              }
            }
          },
          "Success": ""
        }
      }
    }
  }
}