Which cancellation or change tier applies at this moment, and what does it cost?

$0.005 USDC per call · Business, finance and compliance · POST /api/v1/booking-change-penalty · Id booking-change-penalty

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

FieldTypeRequiredDescription
startAtstring; length 0..36yes
changeAtstring; length 0..36yesThe moment of cancellation/change; never read from the clock.
amountMinorinteger; 0..1000000000000yes
currencystring; length 0..3yes
timeZonestring; length 0..64noNeeded for daysBefore tiers.
tiersarray<object>; max 12 itemsyes
roundingstring; one of "half-up", "floor", "ceil"yesApplied to percentage penalties.
noShowTierstring; length 0..64noTier name charged when changeAt is after startAt; default the most severe tier.
claimedPenaltyMinorinteger; 0..1000000000000no

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.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: 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.
tierstringno
freebooleanno
penaltyMinorintegerno
cappedAtAmountbooleanno
currencystringno
deadlinesarray<object>no
nextTierAtUtcstringno
afterStartbooleanno
reasonstringno
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways 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