Storage, demurrage or detention charge: free-time end date, chargeable days and tiered amount

$0.005 USDC per call · Business, finance and compliance · POST /api/v1/storage-charge-clock · Id storage-charge-clock

Counts days between a received date and a released date for storage, demurrage, detention or parking charges: you state whether the receipt day and the release day count, how free days are counted (calendar or business days on a named or caller calendar), and a tiered per-day rate schedule by chargeable day number; returns the last free day, chargeable days, a per-tier breakdown and the total in minor units, and checks an asserted total. It applies exactly the counting you declare and does not know any carrier's or warehouse's tariff, grace periods or caps; amounts are integer minor units with no tax or FX.

What you get

Whether the first day counts, whether weekends are free and where the rate steps up change the invoice; stating them makes the number checkable.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/storage-charge-clock. 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/storage-charge-clock \
  -H 'content-type: application/json' \
  -d '{"receivedOn":"2026-11-02","releasedOn":"2026-11-20","receiptDayCounts":false,"releaseDayCounts":true,"freeDays":5,"freeCounting":"business","chargeCounting":"calendar","tiers":[{"fromDay":1,"rateMinor":7500},{"fromDay":6,"rateMinor":15000}],"currency":"USD","calendar":"us-federal"}'

Input

FieldTypeRequiredDescription
receivedOnstring; length 0..10yes
releasedOnstring; length 0..10yes
receiptDayCountsbooleanyesWhether the day of receipt is day 1.
releaseDayCountsbooleanyesWhether the release day is counted.
freeDaysinteger; 0..3650yes
freeCountingstring; one of "calendar", "business"yes
chargeCountingstring; one of "calendar", "business"yesWhether chargeable days skip weekends/holidays.
tiersarray<object>; max 20 itemsyes
currencystring; length 0..3yes
calendarstring; one of "us-federal", "us-federal-reserve", "nyse", "us-equities-settlement", "uk-england-and-wales", "uk-scotland", "uk-northern-ireland", "weekends-only", "caller"noNamed holiday calendar with a source and supported date range (outside it the answer is unsupported), weekends-only (Saturday/Sunday only), or caller (only the holidays you list).
holidaysarray<string; length 0..10>; max 400 itemsnoExtra non-business dates YYYY-MM-DD (company closures, a calendar we do not carry).
weekendarray<integer; 0..6>; max 6 itemsnoNon-business weekdays, 0=Sunday..6=Saturday. Default [0, 6]; use [5, 6] for a Friday/Saturday weekend.
claimedChargeMinorinteger; 0..9007199254740991no

Example request body

{
  "receivedOn": "2026-11-02",
  "releasedOn": "2026-11-20",
  "receiptDayCounts": false,
  "releaseDayCounts": true,
  "freeDays": 5,
  "freeCounting": "business",
  "chargeCounting": "calendar",
  "tiers": [
    {
      "fromDay": 1,
      "rateMinor": 7500
    },
    {
      "fromDay": 6,
      "rateMinor": 15000
    }
  ],
  "currency": "USD",
  "calendar": "us-federal"
}

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.
lastFreeDaystringno
countedDaysintegerno
chargeableDaysintegerno
breakdownarray<object>no
totalMinorintegerno
currencystringno
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