Skip to content

How to read and write rates, availability, and restrictions via API (rate calendar)

How it worksVerified on 4 min read

Explains how the rate calendar endpoints of the public v2 API work (GET /rate-calendar, POST /rate-calendar/bulk, GET /rate-calendar/rms-data): available fields, meaning of availability, stop_sell, CTA/CTD, asynchronous write processing, and how to verify if a night is truly for sale. Includes FAQs on dedicated availability endpoints and the calendar opening horizon.

You are in the right place if…6 cases
  • “How do I close a date for sale via API?”
  • “I sent prices via API but they haven't changed on the calendar”
  • “The night appears closed even if stop sell is zero”
  • “How do I update availability and minimum stay via API?”
  • “I closed the rate via API but the room is still bookable on Booking”
  • “How do I know via API if a date is truly bookable?”

This guide is intended for those developing an integration with the SmartPMS public v2 API who need to manage prices, availability, and night restrictions. To obtain credentials and authenticate calls, first consult the guide "How to request and obtain access to the SmartPMS API".

The Rate Calendar endpoints

All management of prices, availability, and restrictions goes through the Rate Calendar group. There are no separate endpoints for availability, inventory, restrictions, or stop sell: paths like /availability, /inventory, or /stop-sell are not part of the API and will return a 404.

  • GET /rate-calendar reads the nights of a range (from, to are mandatory; optional filters for property_id, room_type_id, unit_category_id, rate_plan_id, guests; pagination with limit up to 500 and offset).
  • POST /rate-calendar/bulk creates or updates the nights of a period.
  • GET /rate-calendar/rms-data returns the same data in raw form, designed for integrations with revenue management systems.

For each night, the documentation includes these fields: room_type_id, date, amount, availability, min_stay, max_stay, cta, ctd, stop_sell, cut_off.

What each field means

  • amount: the price of the night.
  • availability: the number of units available for that night. A night with availability = 0 is not sellable.
  • stop_sell (0/1): with a value of 1, the night is closed to sale even if it has availability.
  • cta / ctd (0/1): closed to arrival and closed to departure on that date.
  • min_stay / max_stay: minimum and maximum stay in nights (from 1 to 999).
  • cut_off: release period, i.e., how long before arrival the night stops being bookable.

A night is for sale only if it has availability greater than 0 and stop_sell at 0. Either condition is enough to close it: this is why a night can appear closed even with stop_sell = 0 if its availability is 0. Conversely, setting stop_sell = 0 does not reopen a night that has 0 availability.

How to write with POST /rate-calendar/bulk

Each element of the request must indicate room_type_id, start_date, and end_date (format Y-m-d; start_date cannot be in the past and end_date must be equal to or later). All other fields are optional: amount, availability, min_stay, max_stay, cta, ctd, stop_sell, auto_availability, weekdays (1 = Monday … 7 = Sunday), modification (default 6, bulk update), and price_variation (1 = exact value, 2 = increase, 3 = percentage). The cta, ctd, stop_sell, and auto_availability flags only accept 0 or 1.

Example of closing to sale from April 1 to April 7, 2027: [{"room_type_id": 20952, "start_date": "2027-04-01", "end_date": "2027-04-07", "stop_sell": 1}]

Important: writing is asynchronous. The request is queued and the 200 response returns the body you sent: it confirms that the request has been accepted, not that the changes have already been applied. To verify the result, re-read the nights with GET /rate-calendar after a few moments.

The auto_availability field indicates whether availability is managed automatically by the PMS (1) or set manually (0).

How to verify if a night is truly bookable

In addition to re-reading the calendar, you can check the result from a sales perspective with GET /booking-engine/offers (arrival, departure): a rate appears only if all nights of the stay are sellable, and under nightly[].restrictions you will find the restrictions for each night, including CTA and CTD. With skip_restrictions=true, the filter on CTA, CTD, and stop sell is ignored, while availability remains mandatory: this is a quick way to understand if a night is closed due to a restriction or exhausted availability.

GET /booking-engine/availability is also available, which returns availability, closed_to_arrival, closed_to_departure, stop_sell, and sold_out for each day. The endpoint is experimental and read-only: the response format may change without notice, so please coordinate with the SmartPMS team before using it in production.

Frequently asked questions

7
Is there a dedicated endpoint to open or close dates for sale?

No. Availability, stop sell, and restrictions are all written using POST /rate-calendar/bulk. The only endpoints dedicated to availability (GET /booking-engine/availability and GET /booking-engine/offers) are read-only and are used to verify what is actually bookable.

I received a 200 response but when re-reading the calendar I don't see the changes: why?

Writing via POST /rate-calendar/bulk is processed in a queue: the 200 response indicates that the request was accepted and returns its content, not that it has already been applied. Wait a few moments and re-read with GET /rate-calendar. Also, verify that start_date is not in the past and that the flags only have values 0 or 1.

If the value remains unchanged after re-reading, open a support ticket indicating: date and time of the call, body sent, response received, and the result of the re-read for the same night.

A night appears closed even if stop_sell is 0: is this normal?

Yes. A night is sellable only if it has availability greater than 0 and stop sell at 0. If availability is 0, the night is closed regardless of the stop sell, and setting stop_sell = 0 is not enough to reopen it.

Can I modify via API until the calendar is open for sale?

No. The public API does not offer an endpoint to modify Rate plan settings: GET /rate-plans/paginated and GET /rate-plans/{id} are read-only and report, among other things, the automatic opening and closing parameters of the Rate plan (autoopen_days, autoclose_days, autoclose_time). To modify these, contact SmartPMS support.

CTA and CTD are accepted in writing: how do I check that they are applied?

A few moments after writing (which is asynchronous), re-read the nights with GET /rate-calendar and check the cta and ctd fields; the same values are also returned by GET /rate-calendar/rms-data. To verify the effect on sales, use GET /booking-engine/offers: the restrictions for each night, including CTA and CTD, appear under nightly[].restrictions. If after re-reading the fields do not appear or do not show the sent value, report it to support by indicating the exact call and an example of the received response.

I activated stop_sell on a rate but the room is still bookable on another rate or on an OTA: why?

Because stop_sell only acts on the single room_type (i.e., the single Rate plan) on which it is written, not on the room as a whole. If your unit has multiple linked rates (for example, a "Standard" and a "Non-Refundable" derived from it), closing the stop sell only on the Non-Refundable still leaves the room bookable via the Standard, both from your Booking Engine and from the connected OTA channels.

This is actually the correct behavior when you want to close only a specific rate on certain dates (e.g., you do not want to sell the non-refundable in a certain period, but it is fine to sell the standard).

If, on the other hand, the goal is to ensure that a date is not sellable by any rate or channel, the only two reliable ways are:

  • set availability to 0 on the room_types linked to that room (at least on the parent/master rate: derived rates follow the master's availability unless explicitly written);
  • or create a BLOCK type reservation via POST /reservations with type = 3. A block reservation actually occupies the inventory exactly like a real reservation: it reduces the units available for that room on those dates, consistently across all channels.
Can I have SmartPMS calculate availability automatically instead of having to send it with every call?

Yes, via the auto_availability (0/1) field in the body of POST /rate-calendar/bulk. If you set it to 1 and do not send the availability field in the same call, SmartPMS calculates the real availability of the night by itself: it starts from the total number of units in the category and subtracts the reservations and blocks already present on that date. Therefore, you do not need to calculate and track a number of free units yourself.

This is convenient if you only update prices via API and want availability to always remain consistent with real reservations, without having to manage a separate counter on your system side: just add auto_availability: 1 to the same call that writes the amount for that night.

Two important things to keep in mind:

  • if you also send availability with an explicit value in the same call, that value takes precedence and overwrites the automatic calculation;
  • the resulting availability value (calculated or explicit) is what is synchronized to the OTAs connected via the Channel Manager. An auto_availability set by mistake, or an incorrect explicit availability, is reflected directly on external sellability, not just on the panel.