GET/v1/transfers/reservations/:reservationId
API 控制台
试一试
向沙箱 API 发送真实请求并查看响应。
凭证
登录后即可从已保存的 API 密钥中选择,无需手动粘贴。
路径参数
1 个字段预订 ID
创建预订时返回的预订标识符。在统一详情端点中,reservationId、confirmationNumber、searchId 三者只能发送其中一个。
查询参数
3 个字段GDS 提供方
接送服务内容选择器,目前仅支持 0。
货币
返回金额所用的货币。若已存在报价或预订,必须与其保持一致。
语言
旧版语言字段。建议使用 LANG 或 Accept-Language 请求头。
cURL 请求
bash
curl -X GET 'https://api.sandbox.travelandz.com/v1/transfers/reservations/:reservationId?gdsprovider=0¤cy=USD' \
-H 'Authorization: Bearer YOUR_SECRET_KEY' \
-H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE'请填写凭证以发送请求。
此请求需要来自上一次调用的标识符或令牌。请先运行前一个步骤,然后把它的值粘贴到这里。
响应
点击「试一试!」发送请求,响应将显示在此处。
按 reservation ID 查询单个预订。
认证和请求头
| 请求头 | 说明 |
|---|---|
Authorization | Bearer <secret_key>。密钥只能保存在服务器端,不能写入客户端日志。 |
X-Travelandz-Id | <public_key>:<profile_code>,持久化的 profile code 格式为 dp_<12 位字母数字>。 |
LANG | 推荐的语言请求头,也支持 Accept-Language。 |
Content-Type | 带 JSON body 的请求使用 application/json。 |
请求
此端点不接收请求体。reservationId 放在路径中,gdsprovider 放在查询参数中。
请求参数结构
reservationIdReservation identifier returned when the booking was created.
请求查询参数模式
gdsproviderTransfer content selector. Currently
0.currencyLowercase values are accepted and normalized. Defaults to
USD on a new search and is inherited afterwards.languageLegacy field. Prefer the
LANG or Accept-Language header.成功响应
直接返回单个预订对象,而不是其他读取端点使用的预订结构。
响应体结构
gdsproviderreservationIdPersist this value; reservation reads and cancellation need it.
confirmationNumberTraveller-facing confirmation code.
statuscancelledtotalAmountTotal charged for the reservation.
currencypickupInstructionsticketUrlselectedScheduleIndexdepartureDatetimearrivalDatetimeselectedAmenitiesselectedAmenities[]keyValue to send in
selectedAmenities.selectedAmenities[]nameLocalized name.
selectedAmenities[]descriptionselectedAmenities[]imageUrlselectedAmenities[]pngImageUrlselectedAmenities[]inputTypeselectedAmenities[]includedTrue when the amenity is already part of the offer.
selectedAmenities[]selectableTrue when the amenity can be added to this offer.
selectedAmenities[]selectedTrue when the amenity is part of the priced selection.
响应示例
json
{
"gdsprovider": 0,
"reservationId": "b8150702cb874abc8d592610afa2a2d9",
"confirmationNumber": "TZ-6202191",
"status": "completed",
"cancelled": false,
"totalAmount": 1462.82,
"currency": "USD",
"pickupInstructions": "Your driver will be waiting for you near the baggage claim with your name on a sign.",
"departureDatetime": "2026-08-16T14:40:00-04:00",
"arrivalDatetime": "2026-08-16T15:06:00-04:00",
"selectedAmenities": []
}错误
| HTTP | 代码 | 含义 | 建议操作 |
|---|---|---|---|
400 | 请求体、查询参数或路径无效,或包含未知属性。 | 根据 message 数组修正请求。 | |
400 | transfer_invalid_currency | 该货币不在支持列表中。 | 使用受支持的货币。 |
400 | transfer_invalid_language | 请求的语言不受支持。 | 使用文档中列出的语言值之一。 |
429 | transfer_provider_error | 服务暂时被限流。 | 使用指数退避重试。 |
502 | transfer_provider_error | 请求无法完成。 | 不要假定成功。保留标识符,并在该操作可能已创建时查询预订。 |
400 | transfer_currency_mismatch | 货币与报价、报价单或预订不一致。 | 复用上一步返回的货币,或省略该字段以继承它。 |
503 | 当前无法确认价格。 | 稍后重试。不要预订,也不要向旅客收费。 |
使用说明
此端点只返回结果中的第一个预订。含设施创建的预订请改用 searchId 查询,以免遗漏信息。
cURL 示例
bash
curl --request GET \
--url "https://api.sandbox.travelandz.com/v1/transfers/reservations/b8150702cb874abc8d592610afa2a2d9?gdsprovider=0¤cy=USD" \
-H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
-H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"