Read the Restrictions of Properties over a date range
/api/v1/restrictionsrestrictions.readFor each requested Property and each date from from to to (at most 366 days): base rate, minimum stay, closed to arrival, closed to departure, availability, and the fields a Restriction Batch will not write (unwritable_fields). Every date of the range is returned; a date ZenHost holds no Restriction for has in_calendar: false and null values. Dates are nights in the time zone of the Property; rates are decimals in its currency.
Parameters
Query parameters
property_id[]string (uuid)[]requiredProperties to read (repeat the parameter, 1 to 100). To read more, page through
GET /propertiesand call once per page. One outside the Connection Scope answersproperty_out_of_scope.1 to 100 items
fromstring (date)requiredFirst date, inclusive.
tostring (date)requiredLast date, inclusive; at most 366 days from
from.
Responses
200The Restrictions, per Property and date.
application/jsonRestrictionList
dataPropertyRestrictions[]requiredOne entry per requested Property, in request order; a repeated id is answered once.
Show 3 child attributesHide child attributes
property_idstring (uuid)requiredcurrencystringrequiredISO 4217 code of the rates of the Property.
daysRestrictionDay[]requiredOne entry per date of the requested range, in order.
Show 8 child attributesHide child attributes
datestring (date)requiredNight, in the time zone of the Property.
in_calendarbooleanrequiredfalsewhen ZenHost holds no Restriction for this date (beyond the calendar horizon, or a Property without a rate plan): every value is thennull.ratenumber | nullrequiredBase nightly rate, decimal, in the currency of the Property; Property Pricing Modifiers apply on top per Sales Channel.
nullwhen unset.min_stayinteger | nullrequiredMinimum stay in nights;
nullwhen unset.closed_to_arrivalboolean | nullrequiredclosed_to_departureboolean | nullrequiredavailabilityboolean | nullrequiredWhether the host opened the night for sale. A booked night stays
true: read the Bookings for occupancy.unwritable_fieldsUnwritableField[]requiredShow 2 child attributesHide child attributes
fieldstringrequiredOne of:
ratemin_stayclosed_to_arrivalclosed_to_departureavailabilityreasonstringrequiredmanual_override: the host froze this field on this date.managed_by_another_pricing_tool: the Property is priced by another pricing tool, which ownsrate,min_stay,closed_to_arrivalandclosed_to_departure;availabilitystays writable.blocked_by_linked_property: the night is closed because a linked Property (for example the whole house this room belongs to) is booked or closed;availabilityis not writable. New reasons may be added.One of:
manual_overridemanaged_by_another_pricing_toolblocked_by_linked_property
401Error code: unauthorized, connection_revoked.
Error codes
unauthorizedThe access token is missing, unknown, expired or revoked, or was issued before the account connected the App again. Refresh it; if refreshing fails, ask the owner to connect again.connection_revokedThe owner revoked the App Connection (or your App revoked its own refresh token). Stop calling for this account and drop its tokens.
402Error code: subscription_blocked.
Error codes
subscription_blockedThe ZenHost subscription of the account is blocked (unpaid, cancelled…). The connection is kept: tell your customer, calls work again once the subscription is restored.
403Error code: app_suspended, forbidden_permission.
Error codes
app_suspendedZenHost suspended your App, or no longer allows it on this account. Stop calling and contact ZenHost.forbidden_permissionYour App was not granted the Permission this endpoint requires.
422Error code: validation_failed, property_out_of_scope.
Error codes
validation_failedThe query, headers or body are invalid;details.issuespoints at each problem (path,message, andmaximumwhen a value or list is too big).property_out_of_scopeA requested Property is outside the Connection Scope;details.property_idslists them.
429Error code: rate_limited.
Header Retry-After — Seconds to wait before the next call is allowed. Limits per App Connection: 60 reads (GET), 10 writes (other POST) and 30 messages sent to guests per minute.
Error codes
rate_limitedToo many calls on this App Connection. Wait for the number of seconds inRetry-After.
500Error code: internal_error.
Error codes
internal_errorZenHost failed to answer. Retry later with a back-off.