GET/v1/transfers/amenities
API 控制台
试一试
向沙箱 API 发送真实请求并查看响应。
凭证
登录后即可从已保存的 API 密钥中选择,无需手动粘贴。
查询参数
2 个字段货币
返回金额所用的货币。若已存在报价或预订,必须与其保持一致。
语言
旧版语言字段。建议使用 LANG 或 Accept-Language 请求头。
cURL 请求
bash
curl -X GET 'https://api.sandbox.travelandz.com/v1/transfers/amenities?currency=USD' \
-H 'Authorization: Bearer YOUR_SECRET_KEY' \
-H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE'请填写凭证以发送请求。
响应
点击「试一试!」发送请求,响应将显示在此处。
获取可与接送服务一同提供的本地化设施目录。
认证和请求头
| 请求头 | 说明 |
|---|---|
Authorization | Bearer <secret_key>。密钥只能保存在服务器端,不能写入客户端日志。 |
X-Travelandz-Id | <public_key>:<profile_code>,持久化的 profile code 格式为 dp_<12 位字母数字>。 |
LANG | 推荐的语言请求头,也支持 Accept-Language。 |
Content-Type | 带 JSON body 的请求使用 application/json。 |
请求
此端点不接收请求体,所有查询参数均为可选。
请求查询参数模式
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 数组返回目录。每项的 key 就是请求 pricing 时在 selectedAmenities 中发送的值。
此端点不返回价格。所选内容的费用只能在 pricing 之后得知。
响应体结构
keyValue to send in
selectedAmenities.nameLocalized name.
descriptionimageUrlpngImageUrlinputTypeincludedTrue when the amenity is already part of the offer.
selectableTrue when the amenity can be added to this offer.
响应示例
json
[
{
"key": "baby_seats",
"name": "Baby seats",
"description": "Your vehicle will have a child safety seat to keep children under age 4 safe.",
"imageUrl": "https://api.sandbox.travelandz.com/v1/assets/transfers/images/0/amenities/baby-seats.svg",
"pngImageUrl": "https://api.sandbox.travelandz.com/v1/assets/transfers/images/0/amenities/baby-seats.png",
"inputType": "numeric",
"included": false,
"selectable": true
},
{
"key": "child_booster",
"name": "Child booster",
"description": "Your vehicle will have a child booster seat to keep children from age 4-8 safe.",
"imageUrl": "https://api.sandbox.travelandz.com/v1/assets/transfers/images/0/amenities/child-booster.svg",
"pngImageUrl": "https://api.sandbox.travelandz.com/v1/assets/transfers/images/0/amenities/child-booster.png",
"inputType": "numeric",
"included": false,
"selectable": true
},
{
"key": "sms_notifications",
"name": "SMS notifications",
"inputType": "boolean",
"included": false,
"selectable": true
}
]错误
| HTTP | 代码 | 含义 | 建议操作 |
|---|---|---|---|
400 | 请求体、查询参数或路径无效,或包含未知属性。 | 根据 message 数组修正请求。 | |
400 | transfer_invalid_currency | 该货币不在支持列表中。 | 使用受支持的货币。 |
400 | transfer_invalid_language | 请求的语言不受支持。 | 使用文档中列出的语言值之一。 |
429 | transfer_provider_error | 服务暂时被限流。 | 使用指数退避重试。 |
502 | transfer_provider_error | 请求无法完成。 | 不要假定成功。保留标识符,并在该操作可能已创建时查询预订。 |
使用说明
报价本身可能已包含部分设施。将此目录作为可加购项展示前,请先检查报价上的 included 和 selectable。
cURL 示例
bash
curl --request GET \
--url "https://api.sandbox.travelandz.com/v1/transfers/amenities?currency=USD" \
-H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
-H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"