API Reference

Resolve a public-provider redirect

Recheck one Expedia.com or Booking.com public comparison when Search, Flexible Search, or hotel room offers returns nextAction.type=resolve_public_redirect. Requires the calling application's effective shopping:read scope.

POST/api/v1/agent-commerce/hotels/:propertyId/public-redirect

Headers

Authorization

string · required

Bearer $BREK_AGENT_API_KEY. Keep the key server-side.

Content-Type

string · required

application/json

Parameters

propertyId

path string · required

Copy the opaque propertyId from the same Search or Hotel Offers result and the returned action. Never substitute hotel.hotelCode, an MCP, consumer-site, provider, or transient source identifier.

body

object · required

Copy nextAction.body exactly from the current response: provider, checkIn, checkOut, occupancies, and optional currency. Do not reconstruct or edit it.

Request

{
  "provider": "expedia",
  "checkIn": "<selected check-in: YYYY-MM-DD>",
  "checkOut": "<selected check-out: YYYY-MM-DD>",
  "occupancies": [{ "paxes": [{ "age": 34 }] }],
  "currency": "USD"
}

cURL

Replace every placeholder and run this from a trusted server-side environment. Never expose the API key in browser code.

curl --request POST "https://api.brek.com/api/v1/agent-commerce/hotels/${PROPERTY_ID}/public-redirect" \
  --header "Authorization: Bearer $BREK_AGENT_API_KEY" \
  --header "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "provider": "expedia",
  "checkIn": "<selected check-in: YYYY-MM-DD>",
  "checkOut": "<selected check-out: YYYY-MM-DD>",
  "occupancies": [{ "paxes": [{ "age": 34 }] }],
  "currency": "USD"
}
JSON

Response

{
  "object": "agent_commerce.public_redirect",
  "propertyId": "hotel_123",
  "provider": "Expedia.com",
  "nextAction": {
    "type": "redirect",
    "url": "https://www.expedia.com/hotel/example",
    "termsOwner": "Expedia.com"
  },
  "revShare": {
    "eligible": false,
    "basis": "none",
    "reason": "external_provider_checkout"
  }
}

400 · Public provider unsupported

Use only the provider returned in a current resolve_public_redirect action.

{
  "error": {
    "code": "agent_commerce_public_provider_unsupported",
    "message": "Only Expedia.com and Booking.com are supported.",
    "status": 400,
    "requestId": "req_...",
    "retryable": false,
    "details": []
  }
}

400 · Trusted redirect unavailable

Discard the action and Search again. Never construct or repair an external URL.

{
  "error": {
    "code": "agent_commerce_public_redirect_unavailable",
    "message": "The selected public provider did not return a trusted HTTPS destination. Search again before redirecting the traveler.",
    "status": 400,
    "requestId": "req_...",
    "retryable": false,
    "details": []
  }
}

Response fields

object

agent_commerce.public_redirect

Typed read-only public-provider navigation response.

propertyId / provider

string

The hotel and external terms owner rechecked for this current action.

nextAction

object

Always type=redirect with the current allowlisted HTTPS URL and termsOwner. This response replaces an older shopping action.

revShare

object

Always ineligible with basis=none and reason=external_provider_checkout in v1.

Read-only resolver; external checkout

This POST is a read-only provider recheck: it does not charge, book, create checkout, or create a Brek transaction, and it needs no Idempotency-Key. It is safe to retry as a fresh read, but do not treat a URL as durable or one-time. Open it only after traveler approval; do not server-fetch, modify, append PII, or log it. Expedia.com or Booking.com owns the resulting checkout, terms, confirmation, and service, and the redirect earns no v1 rev share.