Menu/restrictions

Read the Restrictions of Properties over a date range

GET/api/v1/restrictions
Requires restrictions.read

For 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)[]required

    Properties to read (repeat the parameter, 1 to 100). To read more, page through GET /properties and call once per page. One outside the Connection Scope answers property_out_of_scope.

    1 to 100 items

  • fromstring (date)required

    First date, inclusive.

  • tostring (date)required

    Last date, inclusive; at most 366 days from from.

Responses

200The Restrictions, per Property and date.

application/jsonRestrictionList

  • dataPropertyRestrictions[]required

    One entry per requested Property, in request order; a repeated id is answered once.

    Show 3 child attributes
    • property_idstring (uuid)required
    • currencystringrequired

      ISO 4217 code of the rates of the Property.

    • daysRestrictionDay[]required

      One entry per date of the requested range, in order.

      Show 8 child attributes
      • datestring (date)required

        Night, in the time zone of the Property.

      • in_calendarbooleanrequired

        false when ZenHost holds no Restriction for this date (beyond the calendar horizon, or a Property without a rate plan): every value is then null.

      • ratenumber | nullrequired

        Base nightly rate, decimal, in the currency of the Property; Property Pricing Modifiers apply on top per Sales Channel. null when unset.

      • min_stayinteger | nullrequired

        Minimum stay in nights; null when unset.

      • closed_to_arrivalboolean | nullrequired
      • closed_to_departureboolean | nullrequired
      • availabilityboolean | nullrequired

        Whether the host opened the night for sale. A booked night stays true: read the Bookings for occupancy.

      • unwritable_fieldsUnwritableField[]required
        Show 2 child attributes
        • fieldstringrequired

          One of: rate min_stay closed_to_arrival closed_to_departure availability

        • reasonstringrequired

          manual_override: the host froze this field on this date. managed_by_another_pricing_tool: the Property is priced by another pricing tool, which owns rate, min_stay, closed_to_arrival and closed_to_departure; availability stays 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; availability is not writable. New reasons may be added.

          One of: manual_override managed_by_another_pricing_tool blocked_by_linked_property

401Error code: unauthorized, connection_revoked.

Error codes

  • unauthorized The 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_revoked The 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_blocked The 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_suspended ZenHost suspended your App, or no longer allows it on this account. Stop calling and contact ZenHost.
  • forbidden_permission Your App was not granted the Permission this endpoint requires.
422Error code: validation_failed, property_out_of_scope.

Error codes

  • validation_failed The query, headers or body are invalid; details.issues points at each problem (path, message, and maximum when a value or list is too big).
  • property_out_of_scope A requested Property is outside the Connection Scope; details.property_ids lists 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_limited Too many calls on this App Connection. Wait for the number of seconds in Retry-After.
500Error code: internal_error.

Error codes

  • internal_error ZenHost failed to answer. Retry later with a back-off.

Every error code and what to do