Skip to main content

Connect contract card

Read this card every session. Do not invent fields from memory. Machine copy: AGENTS.md · index: llms.txt.

OpenAPI — generate the client

Stable YAML for OpenAPI Generator, Postman, Insomnia, and IDE plugins. Import the file; do not install unpublished SDK packages.

Authenticate once

Buyer header is Authorization with an ApiKey prefix. Sandbox keys only work on the test host.

HeaderAuthorization: ApiKey sk_test_*

Auth and hosts​

  • Header: Authorization: ApiKey sk_test_* or sk_prod_*. There are no hotels:search / hotels:book scopes.
  • Test: https://test-api.bundleport.com with sk_test_* only.
  • Production: https://api.bundleport.com with sk_prod_* only.
  • Do not mix keys and hosts.

Handoff (copy fields literally)​

FromFieldInto
Search options[]idQuote criteria.optionRefId
Quote optionQuoteoptionRefIdBook input.optionRefId
Book booking.referencebookingIDDetail / cancel bookingID
CancelcancelReferencePersist; confirm status via detail

There is no bookingReference. Do not pass search id to book after a successful quote.

Errors​

  • Connect Hotels transactional failures: HTTP 200 + errors[] with ERR_CODE_* / ERR_TYPE_*. Always inspect errors when response.ok.
  • Gateway: HTTP 401 / 403 / 429 / 5xx. Body is not aggregator errors[].
  • Search / SSE saturated: HTTP 503 { "error": "aggregator saturated", "code": "RESOURCE_EXHAUSTED" } on /availability and /availability/_stream only. Quote/book/cancel do not use this admission gate.
  • Book JSON shape: HTTP 400 { "code": "invalid_argument", "message" } (non-array rooms/remarks, or clientReference longer than 20 characters).
  • Content catalog: HTTP 400 / 404 / 500 + errors[]. A few Content paths (including translate-codes validation) use HTTP 400 { "error": "…" }. Hotels booking has no HTTP 404.
  • There is no PRICE_CHANGED, NO_AVAILABILITY, CONFIRMED, or error_category on Hotels JSON.
  • Follow additionalData.recommended_action when present. Hints match top-level description only (timeout also keys off announced_timeout_ms). A provider “check-in must be in the future” or “check-in date cannot be earlier than the current date”, a stay longer than it allows, an occupancy it does not sell, or an unknown source market is ERR_CODE_BAD_REQUEST / ERR_TYPE_CLIENT with fix_request. Stay dates are the hotel's local calendar days (T00:00:00Z is only the encoding): compute the earliest check-in in each hotel's time zone, not UTC. Budget misses are ERR_CODE_TIMEOUT with announced_timeout_ms.
  • On some connections, repeating a recent definitive book failure returns additionalData.book_option_blocked=true: same optionRefId after availability/price/request failures (new search/quote), same holder on a rate of an attempt that failed with verify_booking_then_restart (list by its clientReference first). An allotment remembered on prebooking also blocks book of that option. Prebooking uses additionalData.prebooking_option_blocked=true for allotment/request failures of that optionRefId (price-change failures are not replayed on prebooking, including a book-stored requote). Timeouts are never blocked this way.

Identifiers and status (strings as on the wire)​

  • Quote optionQuote.status: STATUS_TYPE_OK or STATUS_TYPE_RQ only.
  • Book/detail/list booking.status: BOOK_STATUS_TYPE_OK, BOOK_STATUS_TYPE_KO, BOOK_STATUS_TYPE_ON_REQUEST, BOOK_STATUS_TYPE_CANCELLED, BOOK_STATUS_TYPE_UNKNOWN, BOOK_STATUS_TYPE_PENDING_COMMIT. There is no BOOK_STATUS_TYPE_RQ (RQ is quote-only).
  • Never invent PENDING or CONFIRMED.
  • Availability criteria.hotels are base codes unless hotelCodeProvider is set (then they are that catalog's native ids). Prefer applyHotelCodesMapping / applyMarkup ("true"/"false"); legacy skip* keys are deprecated. Passthrough without mapping (applyHotelCodesMapping=false / skipHotelCodesMapping=true) cannot be combined with hotelCodeProvider. Optional criteria.destination (IATA / place / geo, XOR with hotels and hotelCodeProvider) expands codes via Content before fan-out; prefer SSE for large cities.
  • MCP availability: digest capped at 50 hotel rows (cheapest per hotel by markupGross); errors may include recommended_action, retryable, announced_timeout_ms. Discovery MCP lives on Content /content/hotels/v1/mcp.
  • Book input.clientReference: unique per attempt, max 20 characters (not a full UUID).

Timeouts​

  • settings.timeout is milliseconds.
  • Search default 10s (max 30s). Book floor 90s (values below 90000 ms are raised). Cancel floor 60s (values below 60000 ms are raised). Quote floor 2s.
  • Your HTTP client must outlive settings.timeout.

Search streaming​

  • SSE (Accept: text/event-stream): accumulate options from update events (one per connection for API keys). done.snapshot does not repeat options.
  • With gzip in Accept-Encoding the stream is Content-Encoding: gzip, flushed per event.
  • Supplier capacity text (rate limit exceeded) is HTTP 200 + errors[] with slow_down and retryable false on that connection. Do not retry the same request. An HTTP 429 without X-RateLimit-* headers is the per-source-IP edge limit (20,000 requests per minute).

Forbidden inventions​

  • Book response fields hotel, holder, stay (holder and rooms[].paxes are request only).
  • Official npm/pypi HTTP SDKs (@bundleport/connect-hotels-sdk, bundleport-connect-hotels).
  • Buyer booking webhooks. Poll bookingdetail for BOOK_STATUS_TYPE_ON_REQUEST.
  • GraphQL as a buyer Hotels surface.

OpenAPI (codegen)​

  • Booking: https://docs.bundleport.com/openapi/hotels.yaml
  • Content: https://docs.bundleport.com/openapi/content.yaml

HTML reference: Booking API · Content API.

Runtime agents vs codegen​

  • Codegen / IDE: this card + OpenAPI. Write fetch / httpx / net/http. Credentials stay in the buyer’s env.
  • Runtime booking: MCP Streamable HTTP (availability → quote → book → bookingDetail → cancel) at https://api.connect.bundleport.com/mcp. Same identifiers as REST. Not a substitute for OpenAPI.

Console (ops, not the wire)​

Business Analytics, API Performance, Transactions. error_category appears there only.