{"slug":"date-math-datemath-workers-dev-v1-subscription-64f574","title":"Date Math","host":"date-math.datemath.workers.dev","method":"POST","resource":"https://date-math.datemath.workers.dev/v1/subscription","category":"market","description":"Date Math: Subscription and contract date math: current billing period, next renewal, upcoming renewals, cancel-by date for a notice period, free-trial start, and day-based proration of a price. Month-end anchors stay at month end (Jan 31, Feb 28, Mar 31). Use for SaaS billing, renewals, cancellatio","price_listed":0.001,"price_asked":null,"state":"effects","state_label":"Not tested: has real-world effects","checks_7d":0,"answered_7d":0,"latency_ms_median":null,"reported_calls_30d":3,"reported_payers_30d":2,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"amount":30,"as_of":"2026-03-10","interval":"month","notice_days":7,"start":"2026-01-31"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"properties":{"amount":{"description":"Price of one billing period, for proration","minimum":0,"type":"number"},"as_of":{"example":"2026-11-07","pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},"count":{"default":3,"description":"Upcoming renewals to list","maximum":24,"minimum":1,"type":"integer"},"interval":{"default":"month","enum":["day","week","month","year"],"type":"string"},"interval_count":{"default":1,"description":"e.g. 3 with month = quarterly","maximum":365,"minimum":1,"type":"integer"},"notice_days":{"description":"Cancellation notice period before renewal","maximum":365,"minimum":0,"type":"integer"},"start":{"example":"2026-11-07","pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},"trial_days":{"description":"Free trial length; billing starts after it","maximum":730,"minimum":0,"type":"integer"}},"required":["start"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"properties":{"as_of":{"type":"string"},"billing_start":{"type":"string"},"cancel_by":{"description":"Last day to cancel before the next renewal, given notice_days","type":["string","null"]},"cancel_by_passed":{"type":["boolean","null"]},"current_period":{"properties":{"days":{"type":"integer"},"days_elapsed":{"type":"integer"},"days_remaining":{"type":"integer"},"end":{"description":"Last day of the period (inclusive)","type":"string"},"number":{"type":"integer"},"start":{"type":"string"}},"required":["number","start","end","days","days_elapsed","days_remaining"],"type":["object","null"]},"interval":{"type":"string"},"interval_count":{"type":"integer"},"next_renewal":{"type":"string"},"next_renewal_weekday":{"type":"string"},"note":{"type":"string"},"proration":{"properties":{"amount":{"type":"number"},"daily_rate":{"type":"number"},"ratio_unused":{"type":"number"},"unused":{"type":"number"},"used":{"type":"number"}},"required":["amount","daily_rate","used","unused","ratio_unused"],"type":["object","null"]},"start":{"type":"string"},"status":{"enum":["not_started","trial","active"],"type":"string"},"upcoming_renewals":{"items":{"type":"string"},"type":"array"}},"required":["start","billing_start","interval","interval_count","as_of","status","current_period","next_renewal","next_renewal_weekday","cancel_by","cancel_by_passed","upcoming_renewals","proration","note"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[],"description_full":"Date Math: Subscription and contract date math: current billing period, next renewal, upcoming renewals, cancel-by date for a notice period, free-trial start, and day-based proration of a price. Month-end anchors stay at month end (Jan 31, Feb 28, Mar 31). Use for SaaS billing, renewals, cancellation deadlines and refunds.","last_updated":"2026-11-17T16:21:15.303Z","schemes":["exact"]}