JDay

GET /v1/add-business-days

Add or subtract business days from a starting date.

Parameters

NameTypeRequiredDescription
datestringYesStarting date in YYYY-MM-DD format. Must be within supported range.
countrystringYesISO 3166-1 alpha-2 country code. Case-insensitive.
daysintegerYesBusiness days to add. Positive = forward, negative = backward, zero = no-op. Must be a base-10 integer within signed 32-bit range.
regionstringNoISO 3166-2 subdivision suffix. Requires paid plan.

Request

curl -X GET "https://jday-api.jday.workers.dev/v1/add-business-days?date=2026-04-01&country=DE&days=10" \
  -H "Authorization: Bearer jday_live_xxx" \
  -H "Accept: application/json"

Response

{
  "start_date": "2026-04-01",
  "business_days_added": 10,
  "end_date": "2026-04-16",
  "country": "DE",
  "region": null,
  "holidays_skipped": [
    {
      "date": "2026-04-03",
      "official_date": null,
      "name": "Good Friday",
      "local_name": null,
      "type": "public",
      "date_accuracy": "exact"
    },
    {
      "date": "2026-04-06",
      "official_date": null,
      "name": "Easter Monday",
      "local_name": null,
      "type": "public",
      "date_accuracy": "exact"
    }
  ],
  "weekends_skipped": 4,
  "calendar_days_elapsed": 15
}

Response Fields

FieldTypeDescription
start_datestringThe input date.
business_days_addedintegerEchoes the signed input value.
end_datestringThe computed result date.
countrystringNormalized country code.
regionstring | nullRegion code if provided, otherwise null.
holidays_skippedarrayHoliday records on traversed non-weekend dates. Sorted chronologically.
weekends_skippedintegerAbsolute count of traversed weekend dates. Always non-negative.
calendar_days_elapsedintegerSigned. Positive forward, negative backward, zero for days=0.

Counting Rule

  • The start date is never counted.
  • Computation moves one calendar day at a time in the sign direction of days.
  • Only business days count toward the target.

days = 0

Returns the input date unchanged:

  • holidays_skipped: []
  • weekends_skipped: 0
  • calendar_days_elapsed: 0

Overlap Rule

When a holiday falls on a weekend:

  • The weekend date counts toward weekends_skipped
  • holidays_skipped includes only holidays on traversed non-weekend dates
  • Multiple holidays on the same non-weekend date all appear in holidays_skipped

days Validation

  • Missing → 400 missing_parameter
  • Must be a base-10 integer string
  • No decimals, no scientific notation
  • Must fit signed 32-bit integer range
  • Invalid → 400 invalid_days

Boundary Behavior

If the computed end_date would fall outside the supported range (2025-01-01 to 2027-12-31), the API returns 400 date_out_of_range before performing expensive traversal.

Error Cases

ConditionError
Missing date, country, or days400 missing_parameter
Malformed date400 invalid_date
Invalid days value400 invalid_days
Date outside range400 date_out_of_range
Computed result outside range400 date_out_of_range
Unknown country400 invalid_country
Invalid region400 invalid_region
Region on Free plan403 plan_upgrade_required

On this page