POST/v1/flights/order/pending/cancel/:gdsprovider/:orderId
API 控制台
试一试
向沙箱 API 发送真实请求并查看响应。
凭证
登录后即可从已保存的 API 密钥中选择,无需手动粘贴。
路径参数
2 个字段GDS 提供方
用于获取航班内容的全球分销系统。选择 0 使用默认提供方。
Order ID
创建预订时返回的订单标识符。
cURL 请求
bash
curl -X POST 'https://api.sandbox.travelandz.com/v1/flights/order/pending/cancel/0/:orderId' \
-H 'Authorization: Bearer YOUR_SECRET_KEY' \
-H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE'请填写凭证以发送请求。
响应
点击「试一试!」发送请求,响应将显示在此处。
启动待确认取消流程,以便在最终取消前查看退款、罚金或供应方确认信息。
接口
| 方法 | 路径 | 认证 |
|---|---|---|
POST | /v1/flights/order/pending/cancel/:gdsprovider/:orderId | 需要 API key |
| Header | 说明 |
|---|---|
Authorization | Bearer <secret_key>. The secret is shown only once when the credential is created. |
X-Travelandz-Id | <public_key>:<profile_code>. The profile_code is the dp_-prefixed Developer Profile code shown in your dashboard. This binds the request to a profile and credential. |
Content-Type | Use application/json for requests with a body. |
请求参数结构
gdsproviderOnly gdsprovider "0" supports this flow
orderId请求体
不需要请求体。
成功响应
返回 the pending cancellation id, refund context, dates, airline credits and liveMode.
响应体结构
cancellationIdorderIdrefundrefundtorefundamountrefundcurrencycreatedAtexpiresAtconfirmedAtairlineCreditsairlineCredits[]passengerIdairlineCredits[]issuedOnairlineCredits[]idairlineCredits[]creditNameairlineCredits[]creditCurrencyairlineCredits[]creditCodeairlineCredits[]creditAmountliveModeTrue when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.
集成说明
Only gdsprovider "0" supports this flow. Travelandz returns the adapted public cancellation payload and persists the pending cancellation internally.
示例
bash
curl -X POST https://api.sandbox.travelandz.com/v1/flights/order/pending/cancel/0/order_123 \
-H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
-H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"响应
| 状态码 | 说明 |
|---|---|
200 | Pending flight cancellation created successfully. |
400 | 请求无效:payload 不合法。 |
401 | 未授权:凭证无效或缺失。 |
403 | 禁止访问:凭证无效。 |
500 | 服务器内部错误 |
200 响应体
媒体类型:application/json
json
{
"cancellationId": "ore_0000B7awtcMBc20FXigs1Z",
"orderId": "ord_0000B7aw6DtypHDaOdA5hV",
"refund": {
"to": "balance",
"amount": "221.89",
"currency": "EUR"
},
"createdAt": "2026-06-22T15:07:18.622Z",
"expiresAt": "2026-06-22T16:07:18.000Z",
"confirmedAt": null,
"airlineCredits": [],
"liveMode": false
}