Menu/restrictions

Read the Restrictions of Properties over a date range

GET/api/v1/restrictions
Nécessite 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.

Paramètres

Paramètres de requête

  • property_id[]string (uuid)[]obligatoire

    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 à 100 éléments

  • fromstring (date)obligatoire

    First date, inclusive.

  • tostring (date)obligatoire

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

Réponses

200The Restrictions, per Property and date.

application/jsonRestrictionList

  • dataPropertyRestrictions[]obligatoire

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

    Afficher 3 attributs enfants
    • property_idstring (uuid)obligatoire
    • currencystringobligatoire

      ISO 4217 code of the rates of the Property.

    • daysRestrictionDay[]obligatoire

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

      Afficher 8 attributs enfants
      • datestring (date)obligatoire

        Night, in the time zone of the Property.

      • in_calendarbooleanobligatoire

        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 | nullobligatoire

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

      • min_stayinteger | nullobligatoire

        Minimum stay in nights; null when unset.

      • closed_to_arrivalboolean | nullobligatoire
      • closed_to_departureboolean | nullobligatoire
      • availabilityboolean | nullobligatoire

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

      • unwritable_fieldsUnwritableField[]obligatoire
        Afficher 2 attributs enfants
        • fieldstringobligatoire

          Parmi : rate min_stay closed_to_arrival closed_to_departure availability

        • reasonstringobligatoire

          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.

          Parmi : manual_override managed_by_another_pricing_tool blocked_by_linked_property

401Error code: unauthorized, connection_revoked.

Codes d’erreur

  • unauthorized Le jeton d’accès est absent, inconnu, expiré ou révoqué, ou a été émis avant que le compte ne reconnecte l’App. Rafraîchissez-le ; si le rafraîchissement échoue, demandez au propriétaire de reconnecter l’App.
  • connection_revoked Le propriétaire a révoqué la connexion d’App (ou votre App a révoqué son propre jeton de rafraîchissement). Cessez les appels pour ce compte et supprimez ses jetons.
402Error code: subscription_blocked.

Codes d’erreur

  • subscription_blocked L’abonnement ZenHost du compte est bloqué (impayé, résilié…). La connexion est conservée : prévenez votre client, les appels refonctionnent dès que l’abonnement est rétabli.
403Error code: app_suspended, forbidden_permission.

Codes d’erreur

  • app_suspended ZenHost a suspendu votre App, ou ne l’autorise plus sur ce compte. Cessez les appels et contactez ZenHost.
  • forbidden_permission Votre App n’a pas reçu la permission que cet endpoint exige.
422Error code: validation_failed, property_out_of_scope.

Codes d’erreur

  • validation_failed La requête, les en-têtes ou le corps sont invalides ; details.issues désigne chaque problème (path, message, et maximum quand une valeur ou une liste est trop grande).
  • property_out_of_scope Un logement demandé est hors du périmètre de connexion ; details.property_ids les liste.
429Error code: rate_limited.

En-tête 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.

Codes d’erreur

  • rate_limited Trop d’appels sur cette connexion d’App. Attendez le nombre de secondes indiqué dans Retry-After.
500Error code: internal_error.

Codes d’erreur

  • internal_error ZenHost n’a pas pu répondre. Réessayez plus tard avec un délai croissant.

Tous les codes d’erreur et la conduite à tenir