Parse and apply hotel cancellation penalty windows from the Expedia Rapid cancel_penalties object to drive real-time refund decisions

domain: developers.expediagroup.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. During the shopping response, extract the cancel_penalties array from each rate option; each entry contains start (ISO 8601 datetime), end (ISO 8601 datetime), penalty_type (e.g., NIGHTS, AMOUNT, PERCENT), and value.
  2. Convert the start and end timestamps to the property's local time using the property_timezone field in the rate response — cancellation deadlines are enforced in property local time, not the customer's timezone.
  3. At cancellation request time, compare the current UTC timestamp to the penalty window boundaries; if the current time is before the first penalty window's start, the cancellation is penalty-free.
  4. If within a penalty window, compute the penalty amount: NIGHTS type multiplies by the nightly rate, PERCENT type multiplies by the total stay cost, and AMOUNT type is a fixed charge; surface this to the user before confirming cancellation.
  5. Display the cancellation policy in the booking confirmation using human-readable rendering of the penalty windows: 'Free cancellation until [local date/time at property]; after that, a [X] night penalty applies.'
  6. After cancellation, store the penalty_amount charged and refund_amount returned from the cancel API response; these override the pre-calculated estimate if the property has applied a different rate at time of cancellation.

Known gotchas

Related routes

Handle a hotel booking cancellation via the Booking.com Demand API and interpret the penalty response
developers.booking.com · 6 steps · unrated
Parse hotel cancellation policies and distinguish guarantee vs deposit semantics
hotel-apis · 6 steps · unrated
Execute a hotel search and room booking through the Expedia Rapid API
developers.expediagroup.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans