{"uid":"cap_P0hiqtKX0yNtgbfsxuPAV","slug":"writerslogic-shelf-life-check-e94c5f73","name":"WritersLogic Shelf Life Check","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/shelf-life-check?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_mqa3-l19KLntO6QnnIHkK","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"Incoming shipment expiry audit","prompt":"We just received a pharma shipment on 2025-07-15. I have 5 lots: lot P1 made 2023-12-01 with a 24-month shelf life and labelled expiry 2025-12-01, lot P2 made 2024-03-15 with an 18-month shelf life, lot P3 opened 2025-05-01 with 60 days after-opening life, lot P4 made 2024-06-30 with a 12-month shelf life, and lot P5 made 2025-01-01 with a 6-month shelf life. Flag any that are expired or have fewer than 14 days remaining, and flag any whose label doesn't match the computed expiry."},{"title":"Cosmetics opened-on check","prompt":"I opened three cosmetic products at different times and want to know if they're still safe to use as of today, 2025-07-15. Product A was opened 2025-04-01 and has a 90-day after-opening life, product B was opened 2025-01-15 and has a 6-month after-opening life, and product C was opened 2025-05-20 with a 60-day after-opening life. Which ones have expired?"},{"title":"Minimum days at receipt compliance","prompt":"Our procurement policy requires at least 90 days of shelf life remaining when we receive goods. As of our receipt date 2025-07-15, can you check these three lots: lot X manufactured 2024-10-01 with a 12-month shelf life, lot Y manufactured 2025-02-28 with a 6-month shelf life, and lot Z manufactured 2023-07-01 with a 36-month shelf life? Tell me which ones fail the 90-day minimum."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:37:09.821Z","isFirstParty":false,"canonicalSlug":"writerslogic-shelf-life-check-e94c5f73"}