API Reference

Brek Hotel API

Exact request and response contracts for every step from hotel search to post-booking service. If you are making your first call, start with the Quickstart instead.

Base URL and authentication

Send an application-scoped key from a trusted server. A Live key uses production inventory and can transact when Live execution is enabled for the Brek deployment; a Test key searches the same inventory, creates Stripe test-mode payments, and simulates the hotel supplier.

https://api.brek.com/api/v1/agent-commerce
Authorization: Bearer $BREK_AGENT_API_KEY

New integration? Read the API key lifecycle for Test and Live isolation, one-time secret storage, verification, rotation, revocation, and workspace quotas.

Endpoints

Before displaying a price, read the pricing contract. It defines Brek versus public-provider prices, full-stay and multi-room scope, pay-now, pay-at-property, traveler total, taxes, and fees.

GETCapabilities/api/v1/agent-commerce/capabilitiesRead this key's environment, transaction readiness, limits, checkout, and agreement.POSTSearch hotels/api/v1/agent-commerce/searchReturn hotels with one starting price and public comparisons.POSTSearch flexible dates/api/v1/agent-commerce/search/flexibleFind one chosen stay per returned hotel across accepted check-in windows and stay lengths.POSTGet hotel room offers/api/v1/agent-commerce/hotels/:propertyId/offersReturn all current room types and bookable options.POSTResolve a public redirect/api/v1/agent-commerce/hotels/:propertyId/public-redirectRead-only provider recheck when a public comparison requires a current external URL.POSTQuote a room/api/v1/agent-commerce/quoteRecheck price, availability, and cancellation terms.POSTCreate checkout/api/v1/agent-commerce/checkout-sessionsStart hosted or native payment authorization.GETRetrieve checkout/api/v1/agent-commerce/checkout-sessions/:idRead payment, expiry, and the next action.POSTAbandon Test checkout/api/v1/agent-commerce/checkout-sessions/:id/abandonRelease a Stripe Test authorization and make the unconfirmed checkout terminal; never available in Live.POSTConfirm booking/api/v1/agent-commerce/checkout-sessions/:id/confirmCreate the reservation after approved payment and terms.GETRetrieve booking/api/v1/agent-commerce/bookings/:referenceRead confirmation, stay, email, and cancellation state.GETPreview cancellation/api/v1/agent-commerce/bookings/:reference/cancellation-previewRead current refund consequences and, when cancellable in Live, obtain a five-minute approval token.POSTCancel booking/api/v1/agent-commerce/bookings/:reference/cancelCancel and return the refundable amount and final state.

Standard policy

Request limit
60/min/application
Revenue share
10% realized Brek profit

Workspace app and key guardrails are returned by capabilities. They prevent accidental resource sprawl and are not an onboarding step.

Common response headers

  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset
  • X-RateLimit-Scope
  • Retry-After (when limited)

Every authenticated Brek Hotel API response includes an X-Request-Id. You may send one and Brek echoes it; if omitted, Brek creates one. X-RateLimit-Reset is an ISO 8601 UTC timestamp. Retry-After is integer seconds and appears on a 429. Rate-limit headers apply after successful application authentication.

Only confirm can book a hotel

Search, room offers, and quote have no payment or booking side effect. Create checkout creates a payment session and starts authorization; it still does not reserve a hotel. Only confirm may capture payment and create the supplier reservation, and confirm requires an Idempotency-Key.

Before implementing retries, read the errors, idempotency, and side-effect guide. Payment authorization happens in Brek-hosted checkout or in Stripe.js for native checkout; it is not a Brek API call.

OpenAPI contains only the external server API

Generate application clients from the published contract. Browser transport and legacy Test helpers are excluded from the served OpenAPI document, so every published operation is an external server integration step.