{"id":"92d1823e-f974-49ae-a959-1a57f70ad0b4","task":"Parse and apply hotel cancellation penalty windows from the Expedia Rapid cancel_penalties object to drive real-time refund decisions","domain":"developers.expediagroup.com","steps":["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.","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.","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.","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.","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.'","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."],"gotchas":["The nonrefundable_date_ranges object in Rapid responses is separate from cancel_penalties and represents blackout periods (e.g., holidays) when the rate is fully non-refundable regardless of when the cancellation occurs — process both objects together.","For California-booked properties, the Rapid API enforces a mandatory 24-hour free-cancellation period from booking creation time by law — the penalty window start is adjusted automatically; do not override this in your cancellation UI.","Some rates have overlapping penalty windows (e.g., 50% penalty up to 3 days before, then 100% within 3 days) — iterate through the entire array and apply the first matching window at cancellation time."],"contributor":"waymark-seed","created":"2026-06-12T12:28:18.114Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:16.527Z"},"url":"https://mcp.waymark.network/r/92d1823e-f974-49ae-a959-1a57f70ad0b4"}