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.
Paramètres
Paramètres de requête
property_id[]string (uuid)[]obligatoireProperties 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 à 100 éléments
fromstring (date)obligatoireFirst date, inclusive.
tostring (date)obligatoireLast date, inclusive; at most 366 days from
from.
Réponses
200The Restrictions, per Property and date.
application/jsonRestrictionList
dataPropertyRestrictions[]obligatoireOne entry per requested Property, in request order; a repeated id is answered once.
Afficher 3 attributs enfantsMasquer les attributs enfants
property_idstring (uuid)obligatoirecurrencystringobligatoireISO 4217 code of the rates of the Property.
daysRestrictionDay[]obligatoireOne entry per date of the requested range, in order.
Afficher 8 attributs enfantsMasquer les attributs enfants
datestring (date)obligatoireNight, in the time zone of the Property.
in_calendarbooleanobligatoirefalsewhen ZenHost holds no Restriction for this date (beyond the calendar horizon, or a Property without a rate plan): every value is thennull.ratenumber | nullobligatoireBase nightly rate, decimal, in the currency of the Property; Property Pricing Modifiers apply on top per Sales Channel.
nullwhen unset.min_stayinteger | nullobligatoireMinimum stay in nights;
nullwhen unset.closed_to_arrivalboolean | nullobligatoireclosed_to_departureboolean | nullobligatoireavailabilityboolean | nullobligatoireWhether the host opened the night for sale. A booked night stays
true: read the Bookings for occupancy.unwritable_fieldsUnwritableField[]obligatoireAfficher 2 attributs enfantsMasquer les attributs enfants
fieldstringobligatoireParmi :
ratemin_stayclosed_to_arrivalclosed_to_departureavailabilityreasonstringobligatoiremanual_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.Parmi :
manual_overridemanaged_by_another_pricing_toolblocked_by_linked_property
401Error code: unauthorized, connection_revoked.
Codes d’erreur
unauthorizedLe 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_revokedLe 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_blockedL’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_suspendedZenHost a suspendu votre App, ou ne l’autorise plus sur ce compte. Cessez les appels et contactez ZenHost.forbidden_permissionVotre App n’a pas reçu la permission que cet endpoint exige.
422Error code: validation_failed, property_out_of_scope.
Codes d’erreur
validation_failedLa requête, les en-têtes ou le corps sont invalides ;details.issuesdésigne chaque problème (path,message, etmaximumquand une valeur ou une liste est trop grande).property_out_of_scopeUn logement demandé est hors du périmètre de connexion ;details.property_idsles 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_limitedTrop d’appels sur cette connexion d’App. Attendez le nombre de secondes indiqué dansRetry-After.
500Error code: internal_error.
Codes d’erreur
internal_errorZenHost n’a pas pu répondre. Réessayez plus tard avec un délai croissant.