旅游 API · v1
基于整个行程进行构建
一次集成,两款产品:机票 API(低价日历、搜索、定价、附加服务、下单、出票、取消)和酒店 API(按城市或酒店代码搜索、房型、价格核验、预订、取消),另有静态内容。基于 HTTPS 的简洁 JSON、签名请求,沙箱与生产环境共用一个基础 URL。
基础 URL
https://api.dubaitrip.com/v1沙箱与生产环境共用一个 URL——由密钥决定:dt_sbx_ 密钥访问我们供应商的测试系统,dt_live_ 密钥访问真实库存。
指南
- 快速入门五个步骤,从注册到在沙箱中完成一张机票预订。
- 身份验证两种身份验证方式,均绑定到您的密钥 ID:签名请求(推荐)或 OAuth 2 客户端凭据 Bearer 令牌。
- 环境、限额与版本沙箱与生产环境共用一个基础 URL;由签名所用的密钥选择环境。
- 错误每一次失败都会返回一个 RFC 7807 问题文档,其中包含稳定的机器可读代码。
- 机票 API低价日历、覆盖 900+ 家航空公司的搜索、报价定价、附加服务、创建订单、出票、退款报价与退款处理。
- 酒店 API按城市代码(IATA 风格,例如 DXB)或您从我们目录中保存的酒店代码搜索 1.5M+ 家住宿,读取包含餐食类型和取消政策的房型级价格,完成验证与预订,并按政策取消。
- 静态内容用于构建搜索界面以及按城市存储我们酒店目录的参考数据查询:机场、航空公司、城市和酒店。
- 变更日志旅游 API 的每一项变更,最新的排在最前。
端点
身份验证
账户
机票
- get
/v1/flights/price-calendarCheapest fare per day for a route over a date window, from our price cache — instant and never a live supplier call. Draw a fare calendar before searching. Omit the return window for one-way prices. - post
/v1/flights/searchSearch flights. Returns a session to poll, or the complete result when `wait` is true. - get
/v1/flights/search/{searchId}Read the next page of a running search. `status` becomes `complete` when every supplier answered. - post
/v1/flights/offers/{offerId}/priceRe-price an offer right before booking. `priceChanged` tells you the total moved. - get
/v1/flights/offers/{offerId}/fare-rulesFare rules and conditions of an offer. - get
/v1/flights/offers/{offerId}/ancillariesChargeable extras available for an offer — today extra checked-baggage allowances, priced by the airline per passenger. Add them to the order via `ancillaries[]` on POST /v1/flights/orders. - post
/v1/flights/ordersCreate an order (hold) from an offer. Requires an `Idempotency-Key` header. - get
/v1/flights/orders/{orderId}Read an order: status, time limit, tickets. - post
/v1/flights/orders/{orderId}/issueIssue the tickets of a held order (charges your deposit balance). - get
/v1/flights/orders/{orderId}/refund-quoteWhat a cancellation would refund, before you commit. - post
/v1/flights/orders/{orderId}/cancelCancel: a held order is released; a ticketed order is voided inside the void window, else refunded. - get
/v1/flights/scheduleTimetable for a route on one day: which flights operate, with local times and equipment — no fares. Query: `origin`, `destination` (IATA), `date` (yyyy-MM-dd). - post
/v1/flights/orders/{orderId}/exchange/searchExchange step 1: search replacement itineraries for a ticketed order. Offers come back in the search shape and expire the same way. - post
/v1/flights/orders/{orderId}/exchange/quoteExchange step 2: what exchanging the listed tickets onto an offer would cost. No side effects. - post
/v1/flights/orders/{orderId}/exchangeExchange step 3: re-issue the listed tickets onto the offer (charges your deposit balance). Requires an `Idempotency-Key` header.
酒店
- post
/v1/hotels/searchSearch hotels by city code (IATA-style, e.g. DXB — see /v1/content/cities), by hotel codes from your stored catalogue, or by a geo circle. Returns a session to poll, or the complete result when `wait` is true. - get
/v1/hotels/search/{searchId}Read the next page of a running search. Pass the same dates and room count as the search so rate keys stay bookable. - get
/v1/hotels/{hotelCode}/roomsRoom types of a hotel. Pass any `rateKey` from the same search so the right supplier answers. - post
/v1/hotels/rates/{rateKey}/checkPre-book check: confirms the rate is still bookable and its price. - post
/v1/hotels/bookingsBook a rate. Requires an `Idempotency-Key` header. - get
/v1/hotels/bookings/{bookingId}Read a booking (voucher). - get
/v1/hotels/bookings/{bookingId}/cancellation-quoteWhat a cancellation would refund, before you commit. - post
/v1/hotels/bookings/{bookingId}/cancelCancel a booking under its cancellation policy.
内容
- get
/v1/content/airportsAirports (IATA), optionally filtered by a free-text term or a country. - get
/v1/content/citiesCities usable as a hotel search destination, optionally filtered by term or country. - get
/v1/content/airlinesAirlines (IATA two-letter codes). - get
/v1/content/hotelsLook up hotels by city and/or name — a lookup, not a catalogue export: a cityCode or a name of 3+ characters is required, 50 per page, 20 pages per query. Store the codes you need: availability is searched by `cityCode` or `hotelCodes`.