Which cancellation or change tier applies at this moment, and what does it cost?
Given a booking start, the moment of change, the booking amount and a tiered policy whose deadlines are either elapsed hours before start ('48 hours') or local calendar days at a local time ('18:00 the day before' in the venue's zone, DST-correct), returns the applicable tier, its deadline instants, the penalty in minor units under your stated rounding, and when the next tier begins; checks an asserted penalty. A change exactly at a deadline is still on time. It carries no airline, hotel or marketplace policy: you supply the tiers. Penalties are percent of amount (basis points) or a fixed minor amount, capped at the booking amount; no tax or FX.
What you get
Cancelling at 17:59 versus 18:01 local, or 47h59 versus 48h, changes the fee; the boundary is computed rather than eyeballed.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/booking-change-penalty. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/booking-change-penalty \
-H 'content-type: application/json' \
-d '{"startAt":"2026-12-10T19:00:00Z","changeAt":"2026-12-08T18:30:00Z","amountMinor":45000,"currency":"EUR","timeZone":"Europe/Paris","rounding":"half-up","tiers":[{"name":"50% from 3 days before 18:00 local","daysBefore":3,"atLocalTime":"18:00","penaltyBps":5000},{"name":"100% within 24h","hoursBefore":24,"penaltyBps":10000}]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
startAt | string; length 0..36 | yes | |
changeAt | string; length 0..36 | yes | The moment of cancellation/change; never read from the clock. |
amountMinor | integer; 0..1000000000000 | yes | |
currency | string; length 0..3 | yes | |
timeZone | string; length 0..64 | no | Needed for daysBefore tiers. |
tiers | array<object>; max 12 items | yes | |
rounding | string; one of "half-up", "floor", "ceil" | yes | Applied to percentage penalties. |
noShowTier | string; length 0..64 | no | Tier name charged when changeAt is after startAt; default the most severe tier. |
claimedPenaltyMinor | integer; 0..1000000000000 | no |
Example request body
{
"startAt": "2026-12-10T19:00:00Z",
"changeAt": "2026-12-08T18:30:00Z",
"amountMinor": 45000,
"currency": "EUR",
"timeZone": "Europe/Paris",
"rounding": "half-up",
"tiers": [
{
"name": "50% from 3 days before 18:00 local",
"daysBefore": 3,
"atLocalTime": "18:00",
"penaltyBps": 5000
},
{
"name": "100% within 24h",
"hoursBefore": 24,
"penaltyBps": 10000
}
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
tier | string | no | |
free | boolean | no | |
penaltyMinor | integer | no | |
cappedAtAmount | boolean | no | |
currency | string | no | |
deadlines | array<object> | no | |
nextTierAtUtc | string | no | |
afterStart | boolean | no | |
reason | string | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the calendar-deadline-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent