GET/v1/flights/loyalty-programmes

列出常旅客计划

列出可在航班预订时关联到旅客的航空公司常旅客计划。

分享
GET/v1/flights/loyalty-programmes

API 控制台

试一试

向沙箱 API 发送真实请求并查看响应。

凭证

登录后即可从已保存的 API 密钥中选择,无需手动粘贴。

cURL 请求

cURL
bash
curl -X GET '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'

请填写凭证以发送请求。

响应

点击「试一试!」发送请求,响应将显示在此处。

列出可在航班预订时关联到旅客的航空公司常旅客计划。

接口

方法路径认证
GET/v1/flights/loyalty-programmes需要 API key
必需请求头:
Header说明
AuthorizationBearer <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-TypeUse application/json for requests with a body.

Request Parameters

不需要路径参数或查询参数。

请求体

不需要请求体。

成功响应

返回 programme names, airline association and identifiers.

响应体结构

loyaltyProgrammes
array
loyaltyProgrammes[]loyalty
object
loyaltyProgrammes[]loyaltyid
string
loyaltyProgrammes[]loyaltyname
string
loyaltyProgrammes[]loyaltyowner_airline_id
string可为空
loyaltyProgrammes[]loyaltyalliance
string可为空
loyaltyProgrammes[]loyaltylogo_url
string可为空
loyaltyProgrammes[]airline
object
loyaltyProgrammes[]airlineid
string
loyaltyProgrammes[]airlinename
string
loyaltyProgrammes[]airlineiata_code
string可为空
loyaltyProgrammes[]airlinelogo_symbol_url
string可为空
loyaltyProgrammes[]airlinelogo_lockup_url
string可为空
loyaltyProgrammes[]airlineconditions_of_carriage_url
string可为空
liveMode
boolean
True when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.

集成说明

Use these programmes with passengers[].loyaltyProgrammeAccounts[] when the selected offer lists the airline in supportedLoyaltyPrograms.

示例

bash
bash
curl 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"

响应

状态码说明
200Loyalty programmes retrieved successfully.
400请求无效:payload 不合法。
401未授权:凭证无效或缺失。
403禁止访问:凭证无效。
500服务器内部错误

200 响应体

媒体类型:application/json

json
json
{
  "loyaltyProgrammes": [
    {
      "loyalty": {
        "owner_airline_id": "arl_0000Adtsa6QkLRuGEnKV3Q",
        "alliance": null,
        "logo_url": null,
        "name": "A+",
        "id": "loy_0000AdwMH7AIm6BBxIQ4Nl"
      },
      "airline": {
        "logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/A4.svg",
        "logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/A4.svg",
        "conditions_of_carriage_url": null,
        "iata_code": "A4",
        "name": "Azimuth",
        "id": "arl_0000Adtsa6QkLRuGEnKV3Q"
      }
    },
    {
      "loyalty": {
        "owner_airline_id": "arl_00009VME7DAGiJjwomhv32",
        "alliance": "oneworld",
        "logo_url": "https://assets.duffel.com/img/loyalty-programmes/full-color-logo/AA-AAdvantage.svg",
        "name": "AAdvantage",
        "id": "loy_0000AdwMH7AIm6BBxIQ4Nm"
      },
      "airline": {
        "logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/AA.svg",
        "logo_lockup_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/AA.svg",
        "conditions_of_carriage_url": "https://www.aa.com/i18n/customer-service/support/conditions-of-carriage.jsp",
        "iata_code": "AA",
        "name": "American Airlines",
        "id": "arl_00009VME7DAGiJjwomhv32"
      }
    }
  ],
  "liveMode": false
}