---
title: "Open times"
method: POST
path: "/v1/availability"
tags: ["Booking"]
---

# Open times

`POST /v1/availability`

## Request

- Base URL: `https://api.nogpets.com`
- URL: `https://api.nogpets.com/v1/availability`
- Auth: none required

Open start times over a date range (at most 31 days; default the next 7), from the same engine as the app. Same inputs as the quote.

## Request body

- TimesRequest
  - `category` string, required: A service line id: grooming, walking or sitting.
  - `address` string
  - `lat` number
  - `lng` number
  - `postalCode` string
  - `addressId` string
  - `pets` PetLine[], required
    - `petId` string
    - `name` string
    - `type` 'DOG' | 'CAT'
    - `weightKg` number
    - `coat` 'SHORT' | 'MEDIUM' | 'LONG'
    - `serviceIds` string[], required: Service ids from list_services; exactly one PRIMARY plus any EXTRAs of the same line. A package id (a line's `packages`) stands for its main service and extras.
    - `packageId` string: A package from list_services (same as putting it in serviceIds).
  - `from` string: A local date, YYYY-MM-DD.
  - `to` string: A local date, YYYY-MM-DD.
  - `windowStart` string: A local time of day, HH:MM.
  - `windowEnd` string: A local time of day, HH:MM.
  - `stay` Stay: An overnight stay. One booking a night, from the evening visit to the next morning's check.
    - `startDate` string, required: A local date, YYYY-MM-DD.
    - `nights` integer, required
    - `eveningWindow` string: A window id from `windows.evening` (or "17:00-19:00"). Default the first.
    - `morningWindow` string: A window id from `windows.morning`. Default the first.
    - `notes` string: Keys, feeding, meds.
  - `visits` Visits: Visits over several days. One booking a visit, at the first free time in its window.
    - `startDate` string, required: A local date, YYYY-MM-DD.
    - `days` integer, required
    - `perDay` integer
    - `windows` string[]: A window id from `windows.visit` per visit of the day, in order.
    - `notes` string
  - `promoCode` string: A promo code (e.g. WELCOME30). Leave it out to apply a code the person claimed on nogpets.com (matched by their mobile); send "" for none.

## Response `200`

Days and their open slots

- Times
  - `error` 'NO_AVAILABILITY'
  - `reason` 'OUTSIDE_HOURS' | 'CLOSED_DAY' | 'FULLY_BOOKED': NO_AVAILABILITY: why nothing is open then. OUTSIDE_HOURS: the service can't fit inside working hours or the window asked; CLOSED_DAY: nobody works that day; FULLY_BOOKED: it fits but every time is taken.
  - `alternatives` object[]: NO_AVAILABILITY: the next open times (up to 5, within 14 days). Offer these; book with start and resourceId unchanged.
    - `label` string
    - `date` string: A local date, YYYY-MM-DD.
    - `start` string, date-time
    - `resourceId` string
  - `next` string: NO_AVAILABILITY: what to do next.
  - `leadId` string, nullable: NO_AVAILABILITY with no alternatives: the request is kept so our team or a partner can come back to the person.
  - `message` string: NO_AVAILABILITY: what to tell the person: the real reason and the next open times, or (none in 14 days) that we'll find someone.
  - `durationMin` integer, required
  - `quote` Quote, required
    - `category` string, required
    - `durationMin` integer, required
    - `pets` object[], required
      - `petId` string
      - `name` string, required
      - `items` Item[], required
        - `serviceId` string, required
        - `name` string, required
        - `kind` 'PRIMARY' | 'EXTRA', required
        - `priceCents` integer, required
        - `durationMin` integer, required
      - `package` object: The package chosen; items are its parts at list price and savingCents comes off.
        - `id` string
        - `name` string
        - `savingCents` integer
    - `subtotalCents` integer, required
    - `cardFeeCents` integer, required
    - `cardTotalCents` integer, required
    - `cashTotalCents` integer, nullable: Null when cash isn't taken. After the discount.
    - `discount` Discount
      - `code` string, required
      - `amountCents` integer, required: What came off the price (never the card fee).
      - `auto` boolean
    - `discountError` 'UNKNOWN' | 'INACTIVE' | 'NOT_STARTED' | 'EXPIRED' | 'USED_UP' | 'NOT_APPLICABLE' | 'NOT_FIRST' | 'LIMIT_REACHED' | 'MIN_SUBTOTAL' | 'null', nullable: Why promoCode can't be used. The quote is then without it.
    - `acceptsCash` boolean, required
    - `group` object, nullable: A group walk: {serviceId, size, dogs}.
    - `summary` string, required
  - `days` Day[], required
    - `date` string, required: A local date, YYYY-MM-DD.
    - `label` string, required
    - `slots` Slot[], required
      - `start` string, date-time, required
      - `time` string, required: Local HH:MM.
      - `resourceId` string, required
  - `mode` 'SLOT' | 'STAY': STAY: an overnight service; book it with `stay`, not a start time.
  - `multiDay` boolean: The service can also be booked as visits over several days (`visits`).
  - `windows` object, nullable: The windows to offer: STAY {evening, morning}, multiDay {visit}; each [{id, label, start, end, text}].
  - `plan` Plan
    - `mode` 'STAY' | 'MULTI_VISIT', required
    - `label` string, required
    - `ok` boolean, required: Every night or visit has a free sitter.
    - `spans` object[], required
      - `date` string: A local date, YYYY-MM-DD.
      - `start` string, date-time, nullable
      - `end` string, date-time, nullable
      - `window` string
      - `free` boolean

## Other responses

- `400`: The input is wrong (`INVALID_ARGUMENT`, or a pricing code such as `ONE_PRIMARY`, `PET_TYPE`, `UNKNOWN_SERVICE`).
- `401`: No token, or it's expired or revoked. The `WWW-Authenticate` header points at the resource metadata.
- `409`: A rule said no: `NO_COVERAGE`, `NO_AVAILABILITY`, `SLOT_TAKEN`, `TOO_LATE`, `CONFIRM_REQUIRED` (with `details.summary`), `NOTHING_TO_PAY`, `SHOP_OFF`, `STOCK`, `SHIPPING`, `DISCOUNT`, `CASH`, `FAILED_PRECONDITION`; business sign-up: `UNDER_REVIEW`, `APPROVED`, `NOT_READY`, `TOO_MANY`, `LISTING_TAKEN`, `PAYFAST_ZA_ONLY`. `NO_COVERAGE` carries `details.leadId`, `details.message` (tell the person) and `details.next`.
- `429`: Too many requests (`RATE_LIMIT`). `Retry-After` says when to try again.

---

[API](https://skmtc.dev/nogpets/apis/nogpets-api.md) · [All operations](https://skmtc.dev/nogpets/apis/nogpets-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nogpets/apis/nogpets-api/revisions/a202c1012173?raw)
