Is this lot still within shelf life on a given date? (unopened and after-opening limits, minimum remaining days)

$0.005 USDC per call · Business, finance and compliance · POST /api/v1/shelf-life-check · Id shelf-life-check

For up to 100 lots, computes the expiry date from manufacture/fill date + shelf life (days, weeks, months, years; month arithmetic clamps to month end) and from opened date + after-opening life, takes the earlier, and checks it against a caller asOf date and an optional minimum remaining days at receipt; flags a labelled expiry that disagrees with the computed one. The last day of life is the expiry date itself (usable through it). It does not know product-specific rules, storage-condition derating, or whether 'best before' is advisory; it never reads the clock.

What you get

Received-with-X-days-left clauses and after-opening limits are the usual silent expiry misses.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/shelf-life-check. 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/shelf-life-check \
  -H 'content-type: application/json' \
  -d '{"asOf":"2026-11-04","items":[{"id":"lot-A","madeOn":"2026-05-04","shelfLife":{"value":6,"unit":"months"},"minRemainingDays":30},{"id":"lot-B","madeOn":"2026-01-31","shelfLife":{"value":1,"unit":"months"}}]}'

Input

FieldTypeRequiredDescription
asOfstring; length 0..10yes
itemsarray<object>; max 100 itemsyes

Example request body

{
  "asOf": "2026-11-04",
  "items": [
    {
      "id": "lot-A",
      "madeOn": "2026-05-04",
      "shelfLife": {
        "value": 6,
        "unit": "months"
      },
      "minRemainingDays": 30
    },
    {
      "id": "lot-B",
      "madeOn": "2026-01-31",
      "shelfLife": {
        "value": 1,
        "unit": "months"
      }
    }
  ]
}

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.
itemsarray<object>no
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