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.
llms-full.txthttps://docs.bundleport.com/llms-full.txt
Authenticate once
Buyer header is Authorization with an ApiKey prefix. Sandbox keys only work on the test host.
HeaderAuthorization: ApiKey sk_test_*
Sandbox hosthttps://test-api.bundleport.com
Auth and hosts
- Header:
Authorization: ApiKey sk_test_*orsk_prod_*. There are nohotels:search/hotels:bookscopes. - Test:
https://test-api.bundleport.comwithsk_test_*only. - Production:
https://api.bundleport.comwithsk_prod_*only. - Do not mix keys and hosts.
Handoff (copy fields literally)
| From | Field | Into |
|---|---|---|
Search options[] | id | Quote criteria.optionRefId |
Quote optionQuote | optionRefId | Book input.optionRefId |
Book booking.reference | bookingID | Detail / cancel bookingID |
| Cancel | cancelReference | Persist; 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[]withERR_CODE_*/ERR_TYPE_*. Always inspecterrorswhenresponse.ok. - Gateway: HTTP
401/403/429/5xx. Body is not aggregatorerrors[]. - Search / SSE saturated: HTTP
503{ "error": "aggregator saturated", "code": "RESOURCE_EXHAUSTED" }on/availabilityand/availability/_streamonly. Quote/book/cancel do not use this admission gate. - Book JSON shape: HTTP
400{ "code": "invalid_argument", "message" }(non-arrayrooms/remarks, orclientReferencelonger than 20 characters). - Content catalog: HTTP
400/404/500+errors[]. A few Content paths (includingtranslate-codesvalidation) use HTTP400{ "error": "…" }. Hotels booking has no HTTP 404. - There is no
PRICE_CHANGED,NO_AVAILABILITY,CONFIRMED, orerror_categoryon Hotels JSON. - Follow
additionalData.recommended_actionwhen present. Hints match top-leveldescriptiononly (timeout also keys offannounced_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 isERR_CODE_BAD_REQUEST/ERR_TYPE_CLIENTwithfix_request. Stay dates are the hotel's local calendar days (T00:00:00Zis only the encoding): compute the earliest check-in in each hotel's time zone, not UTC. Budget misses areERR_CODE_TIMEOUTwithannounced_timeout_ms. - On some connections, repeating a recent definitive book failure returns
additionalData.book_option_blocked=true: sameoptionRefIdafter availability/price/request failures (new search/quote), same holder on a rate of an attempt that failed withverify_booking_then_restart(list by itsclientReferencefirst). An allotment remembered on prebooking also blocks book of that option. Prebooking usesadditionalData.prebooking_option_blocked=truefor allotment/request failures of thatoptionRefId(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_OKorSTATUS_TYPE_RQonly. - 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 noBOOK_STATUS_TYPE_RQ(RQis quote-only). - Never invent
PENDINGorCONFIRMED. - Availability
criteria.hotelsare base codes unlesshotelCodeProvideris set (then they are that catalog's native ids). PreferapplyHotelCodesMapping/applyMarkup("true"/"false"); legacyskip*keys are deprecated. Passthrough without mapping (applyHotelCodesMapping=false/skipHotelCodesMapping=true) cannot be combined withhotelCodeProvider. Optionalcriteria.destination(IATA / place / geo, XOR withhotelsandhotelCodeProvider) 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 includerecommended_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.timeoutis 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): accumulateoptionsfromupdateevents (one per connection for API keys).done.snapshotdoes not repeatoptions. - With
gzipinAccept-Encodingthe stream isContent-Encoding: gzip, flushed per event. - Supplier capacity text (
rate limit exceeded) is HTTP 200 +errors[]withslow_downandretryablefalseon that connection. Do not retry the same request. An HTTP429withoutX-RateLimit-*headers is the per-source-IP edge limit (20,000 requests per minute).
Forbidden inventions
- Book response fields
hotel,holder,stay(holder androoms[].paxesare request only). - Official npm/pypi HTTP SDKs (
@bundleport/connect-hotels-sdk,bundleport-connect-hotels). - Buyer booking webhooks. Poll
bookingdetailforBOOK_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) athttps://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.