POST/v1/transfers/reservations/changes/search

搜索接送预订变更方案

为现有预订查找替代报价。

分享
POST/v1/transfers/reservations/changes/search

API 控制台

试一试

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

凭证

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

请求体

cURL 请求

cURL
bash
curl -X POST 'https://api.sandbox.travelandz.com/v1/transfers/reservations/changes/search' \
  -H 'Authorization: Bearer YOUR_SECRET_KEY' \
  -H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE' \
  -H 'Content-Type: application/json' \
  -d '{"reservationHashedId":"5c8563a5d31d4c33a3a1eafbbfe59c4b","pickupDatetime":"2026-08-30 22:00","numPassengers":2,"currency":"USD"}'

请填写凭证以发送请求。

此请求需要来自上一次调用的标识符或令牌。请先运行前一个步骤,然后把它的值粘贴到这里。

响应

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

为现有预订查找替代报价。

认证和请求头

请求头说明
AuthorizationBearer <secret_key>。密钥只能保存在服务器端,不能写入客户端日志。
X-Travelandz-Id<public_key>:<profile_code>,持久化的 profile code 格式为 dp_<12 位字母数字>。
LANG推荐的语言请求头,也支持 Accept-Language。
Content-Type带 JSON body 的请求使用 application/json。

请求

只有 reservationHashedId 是必需的。仅发送你想修改的字段,省略的字段沿用原预订。

此端点始终以 JSON 响应,不会打开流。

请求体结构

reservationHashedId
string是
Identifier of the reservation you want to replace.
mode
enum
one_wayround_trip
否
numPassengers
number否
When sent, an integer of at least 1.
startAddress
string否
Optional override of the original location.
startCity
string否
Appended to the address to improve resolution.
startZipcode
string否
Appended to the address to improve resolution.
startLat
number否
Must be sent together with startLng.
startLng
number否
Must be sent together with startLat.
startPlaceId
string否
Alternative to an address or coordinates.
endAddress
string否
Optional override of the original location.
endCity
string否
Appended to the address to improve resolution.
endZipcode
string否
Appended to the address to improve resolution.
endLat
number否
Must be sent together with endLng.
endLng
number否
Must be sent together with endLat.
endPlaceId
string否
Alternative to an address or coordinates.
pickupDatetime
string
格式: YYYY-MM-DD HH:mm
否
flightDatetime
string否
returnPickupDatetime
string否
returnFlightDatetime
string否
amenities
array是
amenities[]
string[]否
currency
enum
EURUSDINRCHFJPYGBPAUDCADCNYSGDNZDMXN
否
Lowercase values are accepted and normalized. Defaults to USD on a new search and is inherited afterwards.
campaign
string否
Your own campaign context.
branch
string否
Requires campaign when sent.
language
enum
en-USes-ESde-DEfr-FRpt-BRzh-CNit-IT
否
Legacy field. Prefer the LANG or Accept-Language header.

请求示例

json
json
{
  "reservationHashedId": "5c8563a5d31d4c33a3a1eafbbfe59c4b",
  "pickupDatetime": "2026-08-30 22:00",
  "numPassengers": 2,
  "currency": "USD"
}

成功响应

返回新的变更 searchId 和 offers[]。这些报价与普通搜索结果结构相同,每个报价都带有不透明的 bookingToken。

响应体结构

gdsprovider
enum
0
是
searchId
string是
Change search identifier. Send it to pricing and confirmation.
moreComing
boolean是
True when more replacement offers may still arrive.
pickupDatetime
string
格式: ISO 8601
否
numPassengers
number否
startLocation
object是
startLocationformattedAddress
string否
startLocationfullAddress
string否
startLocationiataCode
string否
Present for airport locations.
startLocationicaoCode
string否
startLocationplaceId
string否
Reusable place identifier; send it back to skip geocoding.
startLocationlatitude
number否
startLocationlongitude
number否
startLocationtimezone
string否
IANA timezone of the location.
endLocation
object是
endLocationformattedAddress
string否
endLocationfullAddress
string否
endLocationiataCode
string否
Present for airport locations.
endLocationicaoCode
string否
endLocationplaceId
string否
Reusable place identifier; send it back to skip geocoding.
endLocationlatitude
number否
endLocationlongitude
number否
endLocationtimezone
string否
IANA timezone of the location.
offers
array是
offers[]searchId
string是
Send this value in pricing, booking and reservation reads.
offers[]gdsprovider
enum
0
是
offers[]resultId
string是
Identifies the selected offer.
offers[]bookingToken
string是
Opaque value. Copy it into pricing and booking; never decode or modify it.
offers[]expiresAt
string
格式: ISO 8601
是
The offer and its token stop being usable after this moment.
offers[]vehicleId
string否
offers[]totalAmount
number是
Indicative total for the offer in currency.
offers[]currency
enum
EURUSDINRCHFJPYGBPAUDCADCNYSGDNZDMXN
是
offers[]bookable
boolean是
False when the offer cannot be booked.
offers[]flightInfoRequired
boolean是
When true, airline and flightNumber are required to book.
offers[]extraPaxRequired
boolean是
When true, extraPaxInfo is required to book.
offers[]goodToKnowInfo
array是
offers[]goodToKnowInfo[]
string[]是
Localized operational notes to show the traveller.
offers[]supports
object是
offers[]cancellationPolicies
array是
offers[]cancellationPolicies[]notice
number否
Hours of notice the policy requires.
offers[]cancellationPolicies[]refundPercent
number否
offers[]cancellationPolicies[]refundableUntilDatetime
string
格式: ISO 8601
否
offers[]cancellationPolicies[]refundAmount
number否
Refundable amount in the offer currency.
offers[]cancellationPolicies[]currency
enum
EURUSDINRCHFJPYGBPAUDCADCNYSGDNZDMXN
否
offers[]steps
array是
offers[]steps[]stepType
string否
Leg type, for example car.
offers[]steps[]main
boolean否
True for the primary leg of the transfer.
offers[]steps[]description
string否
offers[]steps[]departureDatetime
string
格式: ISO 8601
否
offers[]steps[]durationMinutes
number否
offers[]steps[]durationSeconds
number否
offers[]steps[]distanceMeters
number否
offers[]steps[]distanceMiles
number否
offers[]steps[]lineName
string否
Present for scheduled line transport.
offers[]steps[]lineColor
string否
offers[]steps[]provider
object是
offers[]steps[]providername
string否
offers[]steps[]providerrating
number否
offers[]steps[]vehicle
object是
offers[]steps[]vehicletype
string否
Vehicle name, for example Shared Ride Van.
offers[]steps[]vehiclecategory
string否
Vehicle grouping, for example Shared or Private.
offers[]steps[]vehiclemaxBags
number否
offers[]steps[]vehiclemaxPassengers
number否
offers[]steps[]vehiclenumVehicles
number否
offers[]steps[]vehicleimageUrl
string
格式: URL
否
offers[]steps[]waitTime
object是
offers[]steps[]waitTimeincluded
boolean否
offers[]steps[]waitTimeminutesIncluded
number否
offers[]steps[]waitTimeextraWaitTimeChargeable
boolean否
offers[]steps[]amenities
array是
offers[]steps[]amenities[]key
string是
Value to send in selectedAmenities.
offers[]steps[]amenities[]name
string是
Localized name.
offers[]steps[]amenities[]description
string否
offers[]steps[]amenities[]imageUrl
string
格式: URL
否
offers[]steps[]amenities[]pngImageUrl
string
格式: URL
否
offers[]steps[]amenities[]inputType
enum
booleannumeric
否
offers[]steps[]amenities[]included
boolean是
True when the amenity is already part of the offer.
offers[]steps[]amenities[]selectable
boolean是
True when the amenity can be added to this offer.
offers[]steps[]amenities[]selected
boolean是
True when the amenity is part of the priced selection.
offers[]steps[]startLocation
object是
offers[]steps[]startLocationformattedAddress
string否
offers[]steps[]startLocationfullAddress
string否
offers[]steps[]startLocationiataCode
string否
Present for airport locations.
offers[]steps[]startLocationicaoCode
string否
offers[]steps[]startLocationplaceId
string否
Reusable place identifier; send it back to skip geocoding.
offers[]steps[]startLocationlatitude
number否
offers[]steps[]startLocationlongitude
number否
offers[]steps[]startLocationtimezone
string否
IANA timezone of the location.
offers[]steps[]endLocation
object是
offers[]steps[]endLocationformattedAddress
string否
offers[]steps[]endLocationfullAddress
string否
offers[]steps[]endLocationiataCode
string否
Present for airport locations.
offers[]steps[]endLocationicaoCode
string否
offers[]steps[]endLocationplaceId
string否
Reusable place identifier; send it back to skip geocoding.
offers[]steps[]endLocationlatitude
number否
offers[]steps[]endLocationlongitude
number否
offers[]steps[]endLocationtimezone
string否
IANA timezone of the location.
offers[]ticketTypes
array是
offers[]ticketTypes[]id
string是
Send this value in ticketTypes[].id when booking.
offers[]ticketTypes[]name
string否
offers[]ticketTypes[]departureDatetime
string
格式: ISO 8601
否
offers[]ticketTypes[]arrivalDatetime
string
格式: ISO 8601
否
offers[]alternativeTimes
array是
offers[]alternativeTimes[]departureDatetime
string
格式: ISO 8601
否
offers[]alternativeTimes[]arrivalDatetime
string
格式: ISO 8601
否

响应示例

json
json
{
  "gdsprovider": 0,
  "searchId": "5c8563a5d31d4c33a3a1eafbbfe59c49",
  "moreComing": false,
  "pickupDatetime": "2026-08-30T22:00:00-04:00",
  "numPassengers": 2,
  "startLocation": {
    "formattedAddress": "433 Park Ave, New York, NY 10022, USA",
    "fullAddress": "433 Park Ave, New York",
    "placeId": "EiU0MzMgUGFyayBBdmUsIE5ldyBZb3JrLCBOWSAxMDAyMiwgVVNB",
    "latitude": 40.7607634,
    "longitude": -73.971212,
    "timezone": "America/New_York"
  },
  "endLocation": {
    "formattedAddress": "John F Kennedy International Airport",
    "fullAddress": "John F Kennedy International Airport",
    "iataCode": "JFK",
    "icaoCode": "KJFK",
    "latitude": 40.639751,
    "longitude": -73.778926,
    "timezone": "America/New_York"
  },
  "offers": [
    {
      "searchId": "5c8563a5d31d4c33a3a1eafbbfe59c49",
      "gdsprovider": 0,
      "resultId": "763475651c06f5ac31ea587084dc0640",
      "bookingToken": "opaque_change_offer_token_generated_by_travelandz",
      "expiresAt": "2026-08-30T22:20:00.000Z",
      "totalAmount": 49.84,
      "currency": "USD",
      "bookable": true,
      "flightInfoRequired": true,
      "extraPaxRequired": false,
      "goodToKnowInfo": [],
      "cancellationPolicies": [
        {
          "notice": 48,
          "refundPercent": 100,
          "refundAmount": 49.84,
          "currency": "USD"
        }
      ],
      "supports": {},
      "steps": [
        {
          "stepType": "car",
          "main": true,
          "departureDatetime": "2026-08-30T22:40:00-04:00",
          "provider": {
            "name": "GO Airlink NYC",
            "rating": 5
          },
          "vehicle": {
            "type": "Shared Ride Van",
            "category": "Shared",
            "maxBags": 4,
            "maxPassengers": 11,
            "numVehicles": 1
          },
          "amenities": []
        }
      ],
      "ticketTypes": [],
      "alternativeTimes": [
        {
          "departureDatetime": "2026-08-30T22:40:00-04:00",
          "arrivalDatetime": "2026-08-30T23:06:10-04:00"
        },
        {
          "departureDatetime": "2026-08-30T23:40:00-04:00",
          "arrivalDatetime": "2026-08-31T00:06:10-04:00"
        }
      ]
    }
  ]
}

错误

HTTP代码含义建议操作
400请求体、查询参数或路径无效,或包含未知属性。根据 message 数组修正请求。
400transfer_invalid_currency该货币不在支持列表中。使用受支持的货币。
400transfer_invalid_language请求的语言不受支持。使用文档中列出的语言值之一。
429transfer_provider_error服务暂时被限流。使用指数退避重试。
502transfer_provider_error请求无法完成。不要假定成功。保留标识符,并在该操作可能已创建时查询预订。
400transfer_location_not_found无法解析起点或终点。补充城市或邮编,或改用 place ID 或经纬度对。
503当前无法确认价格。稍后重试。不要预订,也不要向旅客收费。

使用说明

旅客选定替代报价后,先为其调用 pricing,然后确认变更。在确认变更之前,原预订保持有效。

cURL 示例

bash
bash
curl --request POST \
  --url "https://api.sandbox.travelandz.com/v1/transfers/reservations/changes/search" \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE" \
  -H "Content-Type: application/json" \
  --data '{
  "reservationHashedId": "5c8563a5d31d4c33a3a1eafbbfe59c4b",
  "pickupDatetime": "2026-08-30 22:00",
  "numPassengers": 2,
  "currency": "USD"
}'