Booking API course · updated 2026-10-05
Lesson 4: GET /availability, closed days and the service area
A good date picker never offers a day the company cannot deliver. This lesson gives you the closed days (holidays, blackout dates, weekly days off, past days) and explains the service area rule so the customer learns early, not at the card step.
Before you start
- Lesson 3
- ## GET /availability?from=YYYY-MM-DD&to=YYYY-MM-DD
Defaults: from = today in the company's timezone, to = from plus 59 days. At most 120 days per call. Response data: today, min_date (today), from, to, max_days, closed [ { date, reason } ] where reason is past, holiday_or_blackout or non_working_day. Grey out every date in closed; everything else is open. The hosted page asks for tomorrow onward; the server accepts today onward, so you may offer today if the company handles same-day deliveries by phone. - ## Where the rules come from
Holidays (US or Canadian, by the company's country) with one switch, custom blackout dates and weekly days off are set by the company in Online Booking, Holidays and Appearance. The API reflects them live. The same rules are enforced again by the server at POST /intents, so a stale picker cannot create an order on a closed day. - ## Service area
```
GET /company returns booking.service_area { zip, max_miles } when the company set a delivery radius: the straight-line distance between the company's ZIP and the delivery ZIP must be at or under max_miles. Validate early with POST /check (lesson 5) and show a clear message with the company's phone when the address is outside. If service_area is null, every address is accepted.
```
What happens next
- Re-fetch availability when the customer navigates to a month beyond the loaded range.
Troubleshooting
A day shows open in my picker but /intents answers date_closed.
Your availability data is older than a settings change, or your picker ignored the timezone. Re-fetch /availability and compare dates as plain YYYY-MM-DD strings, never through the browser's local Date.
Related guides
© 2026 Dumpster Controls. All rights reserved. Made in the USA.