住宿报价
使用住宿报价 API 获取 Vrbo 房源的价格和可用性。
有关检索属性 ID 的详细信息,请参阅检索属性静态数据。 有关报价 API 的更多信息,请参阅报价 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);