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

# Availability push

> Saoma pushes a venue's available slots to your endpoint every time they change.

Saoma **calls your API** to keep your inventory in sync: whenever something
changes the availability of a connected venue, Saoma sends every available
slot of the affected days, for each of your products mapped to a Saoma
treatment. You replace those days on your side.

This page describes the request Saoma sends. You implement the endpoint.

## Setup

1. **You** give Saoma your base URL (one per environment, e.g. staging and
   production) and a **bearer token** per environment.
2. **The venue** enables the integration in Saoma (*Venue › Integrations*) and
   enters **its venue id on your platform** (e.g. its Staycation hotel ID).
3. **The venue** maps each of your products to one Saoma treatment variant.
   A product = one treatment at one duration (e.g. *Body massage 60 min*).

As soon as a venue is enabled or a mapping changes, Saoma pushes the next 62
days for that venue.

## Request

```http theme={null}
POST {base_url}/saoma/{venue_id}/experiences/{product_id}/inventory
Authorization: Bearer {your_token}
Content-Type: application/json
```

One request per product. A request carries one or several days.

### Path parameters

**venue\_id** `string` *required*

The venue's id on your platform, as entered by the venue in its Saoma
integration settings.

**product\_id** `string` *required*

Your product id (e.g. Staycation experience id), as mapped by the venue.

### Body

**dates** `InventoryDate[]` *required*

The days being replaced.

**InventoryDate**

**date** `string (YYYY-MM-DD)` *required*

Day in the venue's **local** calendar.

**slots** `InventorySlot[]` *required*

**Every** available slot of the day for this product. An empty array
means nothing can be booked that day (fully booked, blocked or closed).

**InventorySlot**

**startTime** `string (HH:MM)` *required*

Start time in the venue's **local time**. No timezone, no UTC
conversion.

**endTime** `string (HH:MM)` *required*

`startTime` + the treatment duration, in local time. A slot that ends
after midnight (`23:30` → `00:30`) belongs to the day it **starts**
on.

**stock** `integer` *required*

How many units of the product can still be booked at this start time
(always ≥ 1). A duo product counts as one unit and uses two places.

## How to apply it

* **Replace each day you receive**: delete every slot you hold for that product
  on that date, then store the slots of the request. A slot absent from the
  request is no longer available.
* Days not in the request are unchanged.
* Times are the venue's **local wall-clock time**. Use the venue's timezone if
  you need an absolute instant.
* Out-of-hours slots (sold with a surcharge in Saoma) are never sent.
* Saoma may send the same day several times: applying a request twice gives the
  same result.

## When Saoma pushes

| Event | Days sent |
| - | - |
| Booking created, moved or cancelled (any channel) | The day(s) of the booking |
| Therapist assigned to a booking | The day of the booking |
| Slot or treatment room blocked or reopened | The blocked day, or all days for a recurring block |
| Therapist schedule or absence changed | The changed days |
| Integration enabled, mapping added or removed | Next 62 days |
| Nightly full resync (02:00 UTC) or *Resync* button | Next 62 days |

Changes are sent **within about a minute**. Several changes on the same day are
merged into one push. The horizon is **62 days**, today included.

## Responses and retries

Reply with any **2xx** status to acknowledge. Saoma waits **10 seconds** for
your response.

Any other status, a timeout or a network error is retried with an increasing
delay (1, 2, 4, 8… minutes, capped at 1 hour), up to 10 attempts. After that
the day is dropped until the next nightly resync. Every call, inbound or
outbound, is logged on the Saoma side for debugging.

## Example

```bash Request theme={null}
curl -X POST https://api.partner.example/saoma/4242/experiences/77/inventory \
  -H "Authorization: Bearer $PARTNER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "dates": [
      {
        "date": "2026-11-05",
        "slots": [
          { "startTime": "10:00", "endTime": "11:00", "stock": 2 },
          { "startTime": "10:30", "endTime": "11:30", "stock": 1 },
          { "startTime": "14:00", "endTime": "15:00", "stock": 3 }
        ]
      },
      { "date": "2026-11-06", "slots": [] }
    ]
  }'
```

```json 200 theme={null}
{}
```


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