> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keebai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /v1/scheduling/resources/stays/availability

> Quote a stay: for a check-in and check-out date, every night resource of a branch with whether it fits, its check-in and check-out windows, its price and the room left each night.

A stay on a `night` resource runs from a **check-in day** to a **check-out day**. The nights are the days in between: check-in Thursday 3 and check-out Saturday 5 is two nights (Thursday and Friday).

This endpoint quotes that stay on every active night resource of the branch at once, sorted by the order the business set. Each resource says whether it fits, and when it does not, why. Reading a quote does not hold anything: book with [POST booking/resource-bookings](https://docs.keebai.com/dev/endpoints/scheduling-resource-booking-create.md).

## Endpoint

```
GET https://api.keebai.com/v1/scheduling/resources/stays/availability
```

## Required scope

`scheduling:availability:read`

## Query params

```json theme={"system"}
{
  "branch_id": "665f00000000000000000b01",
  "check_in": "2026-12-03",
  "check_out": "2026-12-05",
  "party_size": 1,
  "resource_id": "665f00000000000000000a01",
  "exclude_booking_id": "665f00000000000000000c01"
}
```

* `branch_id`, `check_in`, `check_out`: required. Days are `YYYY-MM-DD` in the branch timezone. `check_out` must be after `check_in`, and a stay is at most 92 nights.
* `party_size`: how many guests the stay must fit each night. Defaults to 1.
* `resource_id`: only quote that resource. It must be a night resource of the branch. An inactive resource returns an empty `resources` array.
* `exclude_booking_id`: the booking you are moving. Its nights do not count, so it can be quoted on new dates without colliding with itself.

## Example request

```bash curl theme={"system"}
curl -G https://api.keebai.com/v1/scheduling/resources/stays/availability \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  --data-urlencode "branch_id=665f00000000000000000b01" \
  --data-urlencode "check_in=2026-12-03" \
  --data-urlencode "check_out=2026-12-05"
```

## Response

### 200 OK

```json theme={"system"}
{
  "check_in": "2026-12-03",
  "check_out": "2026-12-05",
  "nights": 2,
  "party_size": 1,
  "resources": [
    {
      "resource_id": "665f00000000000000000a01",
      "name": "Suite canina · Mediana",
      "available": true,
      "reason": null,
      "check_in_window": { "from": "10:00", "to": "16:30" },
      "check_out_window": { "from": "10:00", "to": "14:30" },
      "price": 40000,
      "prepayment": 16000,
      "currency": "CLP",
      "nights": [
        { "date": "2026-12-03", "remaining": 3 },
        { "date": "2026-12-04", "remaining": 4 }
      ]
    },
    {
      "resource_id": "665f00000000000000000a02",
      "name": "Suite canina · Grande",
      "available": false,
      "reason": "FULL:2026-12-04",
      "nights": [
        { "date": "2026-12-03", "remaining": 1 },
        { "date": "2026-12-04", "remaining": 0 }
      ]
    }
  ]
}
```

* `price`: price of the whole stay: nights × the amount of the resource's only pricing tier, times `party_size` when `pricing.mode` is `per_person`. There is no per-night field; divide by `nights` if you need it.
* `prepayment`: amount the customer pays up front when the resource asks for one. `0` when it does not.
* `check_in_window` and `check_out_window`: local times the guest can arrive on the check-in day and leave on the check-out day. Send a `check_in_time` inside the first one when booking; leave it out and the stay starts when the window opens.
* `nights[].remaining`: room left that night, before this stay.
* A resource that does not fit carries no windows, price or prepayment.

`reason` is `null` when the resource fits, or one of:

```json theme={"system"}
[
  "FULL:2026-12-04",
  "CLOSED_CHECK_IN",
  "CLOSED_CHECK_OUT",
  "MIN_NIGHTS",
  "MAX_NIGHTS",
  "PARTY_SIZE",
  "TOO_SOON",
  "TOO_FAR"
]
```

* `FULL:<date>`: the first night without room.
* `CLOSED_CHECK_IN` / `CLOSED_CHECK_OUT`: the resource takes no check-ins, or no check-outs, that day (closed day, holiday).
* `MIN_NIGHTS` / `MAX_NIGHTS`: the stay is shorter or longer than the resource's `stay` allows.
* `PARTY_SIZE`: the party does not fit one booking of the resource.
* `TOO_SOON` / `TOO_FAR`: the check-in is before the minimum notice, or past how far ahead the business takes bookings.

### 400 Bad Request

```json theme={"system"}
{
  "error": {
    "code": "STAY_INVALID_RANGE",
    "message": "El retiro debe ser posterior al ingreso y la estadía de hasta 92 noches",
    "details": { "max_nights": 92 }
  }
}
```

`RESOURCE_BOOKING_UNIT_MISMATCH` when `resource_id` is a block resource.

### 404 Not Found

`BRANCH_NOT_FOUND`, or `RESOURCE_NOT_FOUND` when `resource_id` does not exist or belongs to another branch.

### 401 Unauthorized · 403 Forbidden

Same semantics as the rest of the public API.


## OpenAPI

````yaml GET /v1/scheduling/resources/stays/availability
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/scheduling/resources/stays/availability:
    get:
      tags:
        - scheduling-resources
      summary: Quote a stay on night resources
      description: >-
        For a check-in and check-out date, every active night resource of the
        branch with whether it fits, why not, its check-in and check-out
        windows, its price and the room left each night.
      operationId: PublicResourcesController_stayAvailability
      parameters:
        - name: branch_id
          required: true
          in: query
          schema:
            type: string
        - name: check_in
          required: true
          in: query
          schema:
            type: string
            example: '2026-12-03'
        - name: check_out
          required: true
          in: query
          schema:
            example: '2026-12-05'
            type: string
        - name: party_size
          required: false
          in: query
          schema:
            type: number
            minimum: 1
            default: 1
        - name: resource_id
          required: false
          in: query
          description: Only quote this resource.
          schema:
            type: string
        - name: exclude_booking_id
          required: false
          in: query
          description: >-
            Booking (or legacy resource appointment) being moved: it does not
            count.
          schema:
            type: string
      responses:
        '200':
          description: ''
      security:
        - PAT: []
components:
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.