---
title: "Working days in a date range: weekends and public holidays applied, next working day"
method: POST
path: "/v1/answers/working-days"
tags: ["Answers"]
---

# Working days in a date range: weekends and public holidays applied, next working day

`POST /v1/answers/working-days`

## Request

- Base URL: `https://asiaref.dev`
- URL: `https://asiaref.dev/v1/answers/working-days`
- Auth: one of:
  - API key in header `PAYMENT-SIGNATURE`
  - API key in header `X-PAYMENT`
  - API key in header `X-API-Key`

## Headers

- `X-Free-Trial` '1'

## Request body

- object
  - `country` 'ae' | 'bd' | 'bh' | 'cn' | 'hk' | 'id' | 'il' | 'in' | 'iq' | 'jo' | 'jp' | 'kr' | 'kw' | 'kz' | 'lk' | 'my' | 'np' | 'om' | 'ph' | 'pk' | 'qa' | 'sa' | 'sg' | 'th' | 'tr' | 'tw' | 'uz' | 'vn', required
  - `from` string, date, required
  - `to` string, date, required: Max 366 days after from
  - `subdivision` string: Optional ISO 3166-2 code (e.g. 'DE-BY'). Computes the count on that region's statutory calendar — (national minus the region's exclusions) plus the region's own days — instead of national-only. Omit for national. Which countries offer regions, and the valid codes, are on GET /v1/{country}/public-holidays under `subdivisions`. An unrecognised code is refused FREE (422) with `available_subdivisions` listed; we never fall back to national, because that would silently return the wrong count.
  - `receipt` boolean: Optional. Default false. When true, a paid HTTP 200 embeds an Ed25519-signed receipt (kind answer_receipt) the caller can file and later verify at /certified/public-key. Included in this answer's existing price — no extra charge. The field is omitted on unpaid 402 and on free 4xx refusals. This is not a series certified extract: GET /v1/certified/{country}/{series} is a different artifact, with its own price.

## Response `200`

Counts, holidays hit, next working day, country weekend convention (Egypt Fri–Sat). Optional property receipt (schema AnswerReceipt, kind answer_receipt) is present only when the request set receipt:true and this response is a paid HTTP 200. Unpaid 402 and free 4xx refusals do not include receipt. Not a series certified extract (GET /v1/certified/{country}/{series}).

- object: Route-specific answer fields (verdict, workings, citations). receipt is optional and does not replace them. confidence_label, coverage_label and label_basis are on every answer an engine produced (rules: /label-rules).
  - `receipt` AnswerReceipt: Signed record of one paid answer computation. Present only on HTTP 200 when the request body set receipt:true. kind is answer_receipt. This object is not a series certified extract: GET /v1/certified/{country}/{series} returns a different artifact (value, citation, archived-source fingerprint, verification chain) at its own price. An answer receipt is included in the answer's existing price — no extra charge. It is not legal advice. It only covers the computation over the cited series as of each series' last_confirmed. Signing: build the object without signature, set receipt_id from the sha256 of that canonical JSON (first 24 hex chars, same pattern as extract_id), re-canonicalize including receipt_id, then sign. Verify with the free key at /certified/public-key — the same key and the same canonicalization rule as series certified extracts, not a second key.
    - `kind` 'answer_receipt', required
    - `receipt_id` string, required: First 24 hex characters of sha256 over the canonical JSON of this object before signature is attached. Same pattern as certified extract_id. The signature covers the object including receipt_id.
    - `answer` string, required: Route or tool name of the paid answer, e.g. vat, wage-check, working-days, settlement-date, income-tax, statutory-interest, payroll, employment-cost.
    - `request` object, required: Sanitized inputs echoed from the request. Properties are route-specific.
    - `result` object, required: Compact summary of the answer status and workings already returned on this 200. Properties are route-specific.
    - `cited_series` object[], required: Series the computation cited. Empty only when the answer cited none.
      - `country` string, required
      - `series_id` string, required
      - `value` union, required: Cited series value as held. Number, string, or null.
        - number
        - string
      - `last_confirmed` string, date, nullable, required: ISO date the cited series was last confirmed, or null.
      - `source_url` string, nullable, required
      - `source_sha256` string, nullable, required: Hex fingerprint from provenance when available, otherwise null.
    - `issued_at` string, date-time, required: ISO8601 timestamp when the receipt was issued.
    - `limitations` string[], required: Always populated. States that this receipt is not a series certified extract and is not legal advice, and that it only covers the computation over the cited series as of each series' last_confirmed.
    - `signature` object, required: Ed25519 signature over the canonical JSON of this receipt with the signature field omitted. Same key_id and same canonicalization rule as series certified extracts, published at /certified/public-key. Not a second production key.
      - `alg` 'Ed25519', required
      - `key_id` string, required: Same key_id as GET /certified/public-key and as series certified extracts.
      - `public_key` string, required: Absolute URL of GET /certified/public-key.
      - `signed_payload` string, required: canonical JSON of answer_receipt: keys sorted recursively, no whitespace (see /certified/public-key)
      - `value` string, required: Base64 Ed25519 signature.
  - `confidence_label` 'high' | 'medium' | 'low': Derived from source type, verification age, stale. Rules: /label-rules
  - `coverage_label` 'ready' | 'partial' | 'gap': ready=complete, partial=limited, gap=no number. Rules: /label-rules
  - `label_basis` object: Inputs and rule ids behind both labels

## Other responses

- `400`: Invalid body (free). No receipt.
- `402`: Payment Required. No receipt object is returned on 402.
- `404`: Unknown country. No receipt.
- `422`: Refused FREE, never charged. Three cases: `calendar_coverage_exhausted` — the range falls outside the years we hold, returned with the exact covered period, because extrapolating would silently count that year's public holidays as working days; `calendar_not_publishable_in_advance` (with `permanent: true`) — the horizon is structural rather than a backlog, for calendars whose dates depend on moon-sighting confirmation or an annual religious-calendar gazette, returned naming the specific blocking holidays, so do not queue a retry expecting the year to appear; and unknown `subdivision`, returned with `available_subdivisions`. No receipt.

---

[API](https://skmtc.dev/asiaref/apis/asiaref-asian-government-reference-data.md) · [All operations](https://skmtc.dev/asiaref/apis/asiaref-asian-government-reference-data/llms.txt) · [OpenAPI document](https://skmtc.dev/asiaref/apis/asiaref-asian-government-reference-data/revisions/5f44dcf21e74?raw)
