{"uid":"cap_Cm5W1M7HCa0Ym-mrw6fUx","slug":"writerslogic-booking-change-penalty-calculator-81e34343","name":"WritersLogic Booking Change Penalty Calculator","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/booking-change-penalty?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"tiers":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":64},"daysBefore":{"type":"integer","maximum":3650,"minimum":0,"description":"...later than the local date of start minus this many days at atLocalTime."},"penaltyBps":{"type":"integer","maximum":10000,"minimum":0,"description":"Percent of the amount in basis points. Exactly one of penaltyBps or penaltyMinor."},"atLocalTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","maxLength":5,"description":"With daysBefore."},"hoursBefore":{"type":"integer","maximum":87600,"minimum":0,"description":"This tier applies when the change is later than start minus this many hours. Exactly one of hoursBefore or daysBefore."},"penaltyMinor":{"type":"integer","maximum":1000000000000,"minimum":0}}},"maxItems":12,"minItems":1},"startAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}[Tt ]\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,9})?)?(Z|z|[+-]\\d{2}:?\\d{2})$","maxLength":36},"changeAt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}[Tt ]\\d{2}:\\d{2}(:\\d{2}(\\.\\d{1,9})?)?(Z|z|[+-]\\d{2}:?\\d{2})$","maxLength":36,"description":"The moment of cancellation/change; never read from the clock."},"currency":{"type":"string","pattern":"^[A-Z]{3}$","maxLength":3},"rounding":{"enum":["half-up","floor","ceil"],"type":"string","description":"Applied to percentage penalties."},"timeZone":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_+-]*(/[A-Za-z0-9_+-]+){0,2}$","maxLength":64,"description":"Needed for daysBefore tiers."},"noShowTier":{"type":"string","maxLength":64,"description":"Tier name charged when changeAt is after startAt; default the most severe tier."},"amountMinor":{"type":"integer","maximum":1000000000000,"minimum":0},"claimedPenaltyMinor":{"type":"integer","maximum":1000000000000,"minimum":0}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_F5ubWjbjRiWC-SzAQiDXD","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the applicable cancellation/change penalty tier and penalty amount in minor currency units for a booking, given caller-supplied tiered deadline policies based on hours or local calendar days before the booking start.","exampleAgentPrompt":"My venue booking starts on 2025-08-15T14:00:00+02:00, the guest wants to cancel right now at 2025-08-13T10:00:00+02:00, the booking total is 25000 minor units (EUR), and my policy has two tiers: free cancellation if more than 48 hours before start, then 5000 basis points penalty if 48 hours or less — can you calculate the applicable tier and exact penalty amount using half-up rounding?","exampleUseCases":[{"title":"Hotel cancellation fee verification","prompt":"A guest booked a hotel room for 2025-09-10T15:00:00+01:00 and wants to cancel now at 2025-09-08T20:00:00+01:00. The room cost 18000 minor units in GBP. Our policy is: free if more than 48 hours before check-in, 2500 bps penalty if 24–48 hours out, and 10000 bps (full charge) if under 24 hours. Use half-up rounding and tell me which tier applies and what the penalty is."},{"title":"Event venue day-based refund policy check","prompt":"I need to verify a claimed refund of 15000 minor units for an event booking of 60000 minor units in USD. The event starts 2025-11-01T18:00:00-05:00, the cancellation happened at 2025-10-28T09:00:00-05:00, timezone America/New_York. Policy: free before 7 days prior at 18:00 local, 5000 bps penalty from 7 days to 3 days at 18:00, full charge after that. Use floor rounding and check if 15000 minor units is correct."},{"title":"Rental booking penalty tier lookup","prompt":"A customer is cancelling a boat rental that starts 2025-07-04T09:00:00+00:00. They're cancelling now at 2025-07-03T08:30:00+00:00. The rental is 8000 minor units in USD. My policy tiers are: 0 bps if more than 72 hours before, 5000 bps if 24–72 hours before, full 10000 bps if under 24 hours. Use ceil rounding — what tier are they in and what do they owe?"}],"resultDescription":"Returns the name of the applicable penalty tier, the deadline instants (start and end) for that tier in UTC, the computed penalty in minor currency units (capped at the booking amount, rounded per the requested mode), the instant when the next stricter tier begins, and a pass/fail check if a claimed penalty amount was supplied.","failureModes":["Missing required fields (startAt, changeAt, amountMinor, tiers) return a 400 validation error","Invalid datetime format or timezone string causes a parse error","Tiers with neither hoursBefore nor daysBefore, or both, are rejected as invalid policy","Both penaltyBps and penaltyMinor specified on a single tier returns a conflict error","changeAt after startAt triggers noShowTier logic or defaults to most severe tier","Timezone not recognized or DST ambiguity may cause a 422 error","amountMinor of zero results in zero penalty regardless of tier"],"whenToPreferThis":"Use this endpoint when you need to apply a custom, caller-defined cancellation or change penalty policy — not a fixed airline, hotel, or marketplace policy — and require DST-correct local calendar day deadline resolution, basis-point or fixed minor-unit penalties, deterministic rounding, and optional penalty assertion checking. Prefer this over manual calculation when policies mix hours-based and local-time-based tiers.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:37:43.239Z","isFirstParty":false,"canonicalSlug":"writerslogic-booking-change-penalty-calculator-81e34343"}