POST/v1/flights/loyalty-programmes
API 控制台
试一试
向沙箱 API 发送真实请求并查看响应。
凭证
登录后即可从已保存的 API 密钥中选择,无需手动粘贴。
请求体
cURL 请求
bash
curl -X POST 'https://api.sandbox.travelandz.com/v1/flights/loyalty-programmes' \
-H 'Authorization: Bearer YOUR_SECRET_KEY' \
-H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE' \
-H 'Content-Type: application/json' \
-d '{"name":"Iberia"}'请填写凭证以发送请求。
响应
点击「试一试!」发送请求,响应将显示在此处。
按名称搜索航空公司常旅客计划,用于增量搜索和旅客表单自动补全。
接口
| 方法 | 路径 | 认证 |
|---|---|---|
POST | /v1/flights/loyalty-programmes | 需要 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. |
Request Parameters
不需要路径参数或查询参数。
请求体结构
name成功响应
返回 matching loyalty programmes.
响应体结构
loyaltyProgrammesloyaltyProgrammes[]loyaltyloyaltyProgrammes[]loyaltyidloyaltyProgrammes[]loyaltynameloyaltyProgrammes[]loyaltyowner_airline_idloyaltyProgrammes[]loyaltyallianceloyaltyProgrammes[]loyaltylogo_urlloyaltyProgrammes[]airlineloyaltyProgrammes[]airlineidloyaltyProgrammes[]airlinenameloyaltyProgrammes[]airlineiata_codeloyaltyProgrammes[]airlinelogo_symbol_urlloyaltyProgrammes[]airlinelogo_lockup_urlloyaltyProgrammes[]airlineconditions_of_carriage_urlliveModeTrue when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.
集成说明
The search term can match a loyalty programme name or airline name when provider metadata can resolve it.
示例
bash
curl -X POST https://api.sandbox.travelandz.com/v1/flights/loyalty-programmes \
-H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
-H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE" \
-H "Content-Type: application/json" \
-d '{"name":"Iberia"}'请求体 - 示例
json
{
"name": "Iberia"
}响应
| 状态码 | 说明 |
|---|---|
200 | Matching loyalty programmes retrieved successfully. |
400 | 请求无效:payload 不合法。 |
401 | 未授权:凭证无效或缺失。 |
403 | 禁止访问:凭证无效。 |
500 | 服务器内部错误 |
200 响应体
媒体类型:application/json
json
{
"loyaltyProgrammes": [
{
"loyalty": {
"owner_airline_id": "arl_00009VME7DCOaPRQvNhcMu",
"alliance": "oneworld",
"logo_url": null,
"name": "Iberia Plus",
"id": "loy_0000AdwMH7BMi91w0auv2q"
},
"airline": {
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/IB.svg",
"logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/IB.svg",
"conditions_of_carriage_url": "https://www.iberia.com/gb/bills/conditions/",
"iata_code": "IB",
"name": "Iberia",
"id": "arl_00009VME7DCOaPRQvNhcMu"
}
}
],
"liveMode": false
}