# Date Math Pay Dates

> Date Math Pay Dates is a paid API for AI agents from date-math.datemath.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-21).

Generates upcoming pay or billing dates for monthly, semi-monthly, biweekly, or weekly schedules, adjusting for weekends and public holidays.

## Facts

- Endpoint: POST https://date-math.datemath.workers.dev/v1/pay_dates?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/date-math-pay-dates-d9918b8a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FxIKRS1aErK2a7FnazB_I

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 date-math-pay-dates-d9918b8a -d '<json body>'
```

Example prompt: Generate the next 12 semi-monthly pay dates for a US company starting from 2026-11-01, paying on the 15th and last day of each month, and move any dates that fall on weekends or US public holidays to the previous business day.

## When to prefer this

Use this endpoint when you need to generate sequences of future pay or billing dates on standard payroll schedules (monthly, semi-monthly, biweekly, weekly) with automatic adjustment for weekends and public holidays across 207 countries. Prefer it over generic date arithmetic endpoints when the use case involves payroll calendars, invoice due dates, or recurring billing cycles that must respect business-day constraints and country-specific holidays.

## Known failure modes

- Invalid date format returns a validation error (dates must match YYYY-MM-DD pattern)
- Requesting more than 24 dates returns a validation error
- Providing more than 2 days for monthly/semi-monthly schedule returns an error
- Invalid country code returns an error or falls back to no holiday exclusion
- Specifying 0 workdays or an invalid workday value returns a validation error
- Providing conflicting anchor and from dates may produce unexpected results

## How this service works

Date Math: Upcoming pay or billing dates for monthly, semi-monthly (e.g. 15th and last day), biweekly or weekly schedules, moved off weekends and public holidays (to the previous, next or nearest business day). Use for payroll calendars, invoice due dates and recurring billing.

## Output

Returns a JSON object containing the count of dates returned, the schedule type, the adjustment rule applied, and an array of pay date objects each with the scheduled date, the (possibly adjusted) pay date, the weekday name, and a flag indicating whether the date was adjusted from the original.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "days": {
   "type": "array",
   "items": {
    "oneOf": [
     {
      "type": "integer",
      "maximum": 31,
      "minimum": 1
     },
     {
      "enum": [
       "last"
      ],
      "type": "string"
     }
    ]
   },
   "maxItems": 2,
   "minItems": 1,
   "description": "monthly: 1 day, semi_monthly: 2 days of the month (1–31 or \"last\"; 31 clamps to month end). Defaults: [\"last\"] and [15, \"last\"]"
  },
  "from": {
   "type": "string",
   "example": "2026-11-07",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
  },
  "count": {
   "type": "integer",
   "default": 6,
   "maximum": 24,
   "minimum": 1,
   "description": "How many pay dates to return"
  },
  "adjust": {
   "enum": [
    "previous",
    "next",
    "nearest",
    "none"
   ],
   "type": "string",
   "default": "previous",
   "description": "Where to move a pay date that falls on a weekend or holiday"
  },
  "anchor": {
   "type": "string",
   "example": "2026-11-07",
   "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
  },
  "country": {
   "type": "string",
   "example": "US",
   "pattern": "^[A-Za-z]{2}$",
   "description": "ISO 3166-1 alpha-2 country code (207 countries); its public holidays (2000–2050) are excluded from business days"
  },
  "holidays": {
   "type": "array",
   "items": {
    "type": "string",
    "example": "2026-11-07",
    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
   },
   "maxItems": 1000,
   "description": "Extra dates excluded from business-day counts (rest days from workdays are always excluded)"
  },
  "schedule": {
   "enum": [
    "monthly",
    "semi_monthly",
    "biweekly",
    "weekly"
   ],
   "type": "string"
  },
  "workdays": {
   "type": "array",
   "items": {
    "type": "integer",
    "maximum": 6,
    "minimum": 0
   },
   "example": [
    1,
    2,
    3,
    4,
    5
   ],
   "maxItems": 7,
   "minItems": 1,
   "description": "Working days of the week, 0 = Sunday. Default [1,2,3,4,5] (Mon–Fri); e.g. [0,1,2,3,4] for Sun–Thu or [1,2,3,4,5,6] for Mon–Sat"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 4,
  "adjust": "previous",
  "schedule": "semi_monthly",
  "pay_dates": [
   {
    "weekday": "Tuesday",
    "adjusted": false,
    "pay_date": "2026-12-15",
    "scheduled": "2026-12-15"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/date-math-pay-dates-d9918b8a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from date-math.datemath.workers.dev](https://www.zero.xyz/host/date-math.datemath.workers.dev/llms.txt)
