跳到主要内容

错误

每一次失败都会返回一个 RFC 7807 问题文档,其中包含稳定的机器可读代码。

  1. 问题详情
  2. 您会遇到的代码
  3. 安全重试

问题详情

非 2xx 响应以 application/problem+json 格式返回,包含 status、title、detail、稳定的 code(snake_case)、指明出错请求属性的可选 field,以及联系客服时需提供的 traceId。

示例
{
  "type": "https://dubaitrip.com/docs/api/errors#price_changed",
  "title": "Price changed",
  "status": 409,
  "detail": "The fare is now 412.50 USD (was 398.00 USD). Re-price and confirm.",
  "code": "price_changed",
  "traceId": "00-3f2a…"
}

您会遇到的代码

401 api_key_invalid、api_signature_invalid、api_timestamp_skew、api_nonce_reused、api_token_invalid——身份验证问题。403 api_scope_missing(您的密钥缺少该权限范围)、api_ip_not_allowed、api_partner_suspended。429 api_rate_limited、api_quota_exceeded。400 validation_failed(附带 field)。404 search_session_not_found、order_not_found、booking_not_found。409 offer_expired、rate_expired、price_changed。402 insufficient_credit(仅限生产环境——请为保证金充值)。502 supplier_error——航空公司或酒店供应商出错;请重新搜索。

安全重试

429 请在 Retry-After 之后重试,502/503/504 请采用指数退避重试。除 429 外,切勿重试任何 4xx。提交类操作(订单、预订、出票、取消)只能使用相同的 Idempotency-Key 重试。如果搜索会话过期(404),请发起新的搜索——报价 ID 和价格密钥不能跨会话使用。