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"
}

成功响应

返回新的变更 searchIdoffers[]。这些报价与普通搜索结果结构相同,每个报价都带有不透明的 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"
}'