POST/v1/transfers/flights/verify
API 控制台
试一试
向沙箱 API 发送真实请求并查看响应。
凭证
登录后即可从已保存的 API 密钥中选择,无需手动粘贴。
请求体
cURL 请求
bash
curl -X POST 'https://api.sandbox.travelandz.com/v1/transfers/flights/verify' \
-H 'Authorization: Bearer YOUR_SECRET_KEY' \
-H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE' \
-H 'Content-Type: application/json' \
-d '{"returnVoyage":true,"pickupDatetime":"2026-06-26T08:00:00+07:00","airlineCode":"5J","airportCode":"BKK","flightDirection":"dep","flightNumber":"930","currency":"USD"}'请填写凭证以发送请求。
响应
点击「试一试!」发送请求,响应将显示在此处。
检查某个航班是否适配所请求的接客时间。
认证和请求头
| 请求头 | 说明 |
|---|---|
Authorization | Bearer <secret_key>。密钥只能保存在服务器端,不能写入客户端日志。 |
X-Travelandz-Id | <public_key>:<profile_code>,持久化的 profile code 格式为 dp_<12 位字母数字>。 |
LANG | 推荐的语言请求头,也支持 Accept-Language。 |
Content-Type | 带 JSON body 的请求使用 application/json。 |
请求
发送航班信息和你打算预订的接客时间。检查返程航段时请设置 returnVoyage。
请求体结构
pickupDatetimeairlineCodeairportCodeflightDirectionflightNumberreturnVoyageTrue when checking the return leg.
searchIdSearch context, when available.
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.请求示例
json
{
"returnVoyage": true,
"pickupDatetime": "2026-06-26T08:00:00+07:00",
"airlineCode": "5J",
"airportCode": "BKK",
"flightDirection": "dep",
"flightNumber": "930",
"currency": "USD"
}成功响应
isValid: false 表示验证成功完成,而非错误:该航班与接客时间不匹配。此时 possiblePickupDatetime 会给出可行的接客时间,message 会用请求的语言说明原因。
响应体结构
isValidFalse is a valid HTTP
200 outcome: the flight does not fit the pickup time.messageTitlemessageLocalized explanation. May contain basic HTML tags.
possiblePickupDatetimeSuggested pickup time when the current one does not fit.
响应示例
json
{
"isValid": false,
"messageTitle": "Late Arrival!",
"message": "You're expected to arrive at the airport at <b>9:30AM</b>.<br/>This gives you 1 hours and 45 minutes until your flight.<br/>To ensure you don't miss it, we recommend arriving 3 hours before departure.",
"possiblePickupDatetime": "2026-06-26T06:45:00+07:00"
}错误
| HTTP | 代码 | 含义 | 建议操作 |
|---|---|---|---|
400 | 请求体、查询参数或路径无效,或包含未知属性。 | 根据 message 数组修正请求。 | |
400 | transfer_invalid_currency | 该货币不在支持列表中。 | 使用受支持的货币。 |
400 | transfer_invalid_language | 请求的语言不受支持。 | 使用文档中列出的语言值之一。 |
429 | transfer_provider_error | 服务暂时被限流。 | 使用指数退避重试。 |
502 | transfer_provider_error | 请求无法完成。 | 不要假定成功。保留标识符,并在该操作可能已创建时查询预订。 |
使用说明
message 可能包含基本 HTML 标记,请按富文本渲染或先去除标签。请在预订前验证航班,使旅客可以及时调整接客时间,而不是在出行当天才发现问题。
cURL 示例
bash
curl --request POST \
--url "https://api.sandbox.travelandz.com/v1/transfers/flights/verify" \
-H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
-H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE" \
-H "Content-Type: application/json" \
--data '{
"returnVoyage": true,
"pickupDatetime": "2026-06-26T08:00:00+07:00",
"airlineCode": "5J",
"airportCode": "BKK",
"flightDirection": "dep",
"flightNumber": "930",
"currency": "USD"
}'