# WritersLogic Shelf Life Check

> WritersLogic Shelf Life Check is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Computes expiry dates for up to 100 inventory lots from manufacture date + shelf life and/or opened date + after-opening life, then checks whether each lot is expired or meets a minimum remaining-days requirement as of a given date.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/shelf-life-check?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-shelf-life-check-e94c5f73
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_P0hiqtKX0yNtgbfsxuPAV

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-shelf-life-check-e94c5f73 -d '<json body>'
```

Example prompt: We received a shipment today (2025-07-15) with two lots: lot A was manufactured on 2024-01-10 with a 24-month shelf life, and lot B was opened on 2025-06-01 with a 90-day after-opening life — can you check whether both lots are still usable and whether they have at least 30 days remaining?

## When to prefer this

Use this endpoint when you need deterministic, arithmetic-only expiry computation and validation for one or many lots without needing product-specific regulatory rules, storage-condition derating, or clock access. Prefer it over general-purpose LLM date reasoning when you need auditable, consistent month-end clamping behavior and batch processing of up to 100 lots in a single call. It is well-suited for supply chain, pharmaceutical, food safety, or cosmetics compliance workflows where you supply the reference date explicitly.

## Known failure modes

- Missing required asOf date returns a validation error
- Lot array exceeds 100 items returns a 400 error
- Invalid date format (non-YYYY-MM-DD) returns a pattern validation error
- A lot with neither madeOn+shelfLife nor openedOn+afterOpening provided may return an error or be skipped
- shelf life value out of range (>36500 or <0) returns a validation error
- Ambiguous month-end arithmetic is handled by clamping to the last day of the target month

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

For each lot, the agent receives the computed expiry date (derived from manufacture/fill date plus shelf life and/or opened date plus after-opening life, taking the earlier), the number of days remaining as of the asOf date, a boolean indicating whether the lot is expired, a pass/fail flag for the minimum remaining days requirement if supplied, and a flag if the labelled expiry disagrees with the computed expiry.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "asOf": {
   "type": "string",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
   "maxLength": 10
  },
  "items": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "maxLength": 64
     },
     "madeOn": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "maxLength": 10
     },
     "openedOn": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "maxLength": 10
     },
     "shelfLife": {
      "type": "object",
      "required": [
       "value",
       "unit"
      ],
      "properties": {
       "unit": {
        "enum": [
         "days",
         "weeks",
         "months",
         "years"
        ],
        "type": "string"
       },
       "value": {
        "type": "integer",
        "maximum": 36500,
        "minimum": 0
       }
      }
     },
     "afterOpening": {
      "type": "object",
      "required": [
       "value",
       "unit"
      ],
      "properties": {
       "unit": {
        "enum": [
         "days",
         "weeks",
         "months",
         "years"
        ],
        "type": "string"
       },
       "value": {
        "type": "integer",
        "maximum": 36500,
        "minimum": 0
       }
      }
     },
     "labelledExpiry": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "maxLength": 10
     },
     "minRemainingDays": {
      "type": "integer",
      "maximum": 36500,
      "minimum": 0
     }
    }
   },
   "maxItems": 100,
   "minItems": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-shelf-life-check-e94c5f73/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
