# Search availability

Find the availability of multiple products for a given date range. Filter by occupancy and attribute options.

## Body

`interval` `required` `{ start: string, end: string } | null`

The interval to search for availability in. If not provided, search will check each product for a match with the other parameters.

`occupancy` `required` `Record<uuid, integer>`

Filter search results by occupancy.

`option_ids` `required` `Array<uuid>`

Filter search results by attribute_options.

`product_ids` `Array<uuid>`

Filter search results by product IDs.

`show_booked_as` `required` `ShowBookedAs`

How to interpret booked events. Defaults to `unavailable`

`show_closed_as` `required` `ShowClosedAs`

How to interpret closed events. Defaults to `unavailable`

`show_pending_as` `required` `"CONFIRMED" | "TENTATIVE" | "CANCELLED"`

How to interpret pending events. Defaults to `TENTATIVE`

## Responses

`200`

Search results

TypeScript

```
Array<{
  availability: "available" | "booked" | "closed" | "pending" | "unavailable" | null;
  match: boolean;
  occupancyMatches: boolean;
  optionsMatch: boolean;
  price: {
    max: number;
    min: number;
  } | null;
  productId: uuid;
}>
```

`POST /search`

```
curl -X POST "https://api.bookingmood.com/v1/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

Example response

JSON

```
[
  {
    "availability": "unavailable",
    "match": false,
    "occupancyMatches": true,
    "optionsMatch": true,
    "price": {
      "min": 100,
      "max": 200
    },
    "productId": "00000000-0000-0000-0000-000000000000"
  }
]
```
