DELETE/v1/hotels/book/:gdsprovider/:reference

取消酒店预订

通过供应方和 reference 取消已有酒店预订,结果取决于供应方政策和预订状态。

分享

通过供应方和 reference 取消已有酒店预订,结果取决于供应方政策和预订状态。

接口

方法路径认证
DELETE/v1/hotels/book/:gdsprovider/:reference需要 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.

请求参数结构

gdsprovider
number
reference
string

请求体

不需要请求体。

成功响应

返回 cancellation status and provider confirmation when available.

错误

状态代码场景
400hotel_booking_already_cancelledBooking was already cancelled.
400unable_to_perform_hotel_booking_cancellationProvider could not cancel.
404hotel_booking_not_foundBooking was not found.
401/403auth codesInvalid credentials.
500-Internal error.

示例

bash
bash
curl -X DELETE https://api.sandbox.travelandz.com/v1/hotels/book/:gdsprovider/:reference \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"

响应

状态码说明
204Booking cancelled successfully