住宿報價
使用「住宿報價 API」查詢 Vrbo 旅宿的價格與空房狀況。
有關檢索旅宿識別碼的詳細資訊,請參閱檢索旅宿靜態資料。 如需有關 Quotes API 的更多資訊,請參閱Quotes API 文件。
1. 使用 SDK 中定義的類別建立請求物件
GetLodgingQuotesOperationParams quotesOperationParams =
GetLodgingQuotesOperationParams.builder()
.partnerTransactionId("PARTNER TRANSACTION ID")
// Check-in 5 days from now
.checkIn(LocalDate.now().plusDays(5))
// Check-out 10 days from now
.checkOut(LocalDate.now().plusDays(10))
// Vrbo Property IDs to search for
.propertyIds(new HashSet<>(Arrays.asList("87704892","12410858")))
// The links to return, WEB includes WS (Web Search Result Page) and WD (Web Details Page)
.links(Collections.singletonList(GetLodgingQuotesOperationParams.Links.WEB))
.build();
GetLodgingQuotesOperation quotesOperation =
new GetLodgingQuotesOperation(quotesOperationParams);2. 使用服務客戶端進行 API 呼叫。
Response<LodgingQuotesResponse> hotelQuotesResponse =
client.execute(quotesOperation);