List the bookings of the Connection Scope
/api/v1/bookingsbookings.readBookings of the Properties in the Connection Scope, cancelled ones included, ordered by id and paged with next_cursor. A page never repeats nor skips a booking, even while bookings change.
Without more Permissions a booking carries no guest name, email or phone and no amount: guests.read adds the guest block, prices.read adds the amounts block.
Incremental sync: read every page, keep next_updated_since, and pass it as updated_since next time. A change to a booking, its status, its amounts or its guest details brings it back. Poll without from/to, or a booking whose dates leave the range is never reported. A booking removed from ZenHost (for instance when a Sales Channel is disconnected from a Property, or a Property is deleted) is not reported, and sends no App Event: list the stay range again to reconcile. The booking.created, booking.updated and booking.cancelled App Events announce a change to what this endpoint returns, only to the connections that see it (a guest change needs guests.read, an amount change prices.read). A booking that arrives already cancelled sends only booking.created.
Paramètres
Paramètres de requête
property_id[]string (uuid)[]Only these Properties (repeat the parameter, at most 100). Each must be in the Connection Scope. Leave it out to list the whole Connection Scope, page by page.
au plus 100 éléments
fromstring (date)Only stays with a night on or after this day (
departure_date>from).tostring (date)Only stays with a night on or before this day (
arrival_date<=to).updated_sincestring (date-time)Only bookings created or changed at or after this instant, cancellations included. Use
next_updated_sinceof your previous listing.cursorstringnext_cursorof the previous page.limitintegerPage size.
min 1 · max 500 · par défaut 100
Réponses
200One page of bookings.
application/jsonBookingList
dataBooking[]obligatoireAfficher 12 attributs enfantsMasquer les attributs enfants
idstring (uuid)obligatoireproperty_idstring (uuid)obligatoirestatusstringobligatoireA cancelled booking stays listed with this status. Version 1 may add values.
Parmi :
confirmedcancelledarrival_datestring (date)obligatoireFirst night,
YYYY-MM-DDin the property time zone.departure_datestring (date)obligatoireCheck-out day (not a night),
YYYY-MM-DD.sales_channelobjectobligatoireWhere the booking was made.
Afficher 2 attributs enfantsMasquer les attributs enfants
codestringobligatoiredirect(entered by the host),website(direct website),other, or the Sales Channel shortcode (e.g.ABBfor Airbnb,BDCfor Booking.com).namestringobligatoire
channel_referencestring | nullobligatoireConfirmation code of the booking on its Sales Channel.
occupancyobjectobligatoireAfficher 3 attributs enfantsMasquer les attributs enfants
adultsinteger | nullobligatoirechildreninteger | nullobligatoireinfantsinteger | nullobligatoire
created_atstring (date-time)obligatoireWhen the booking was made: on its Sales Channel, or in ZenHost for a direct booking. For a booking made before its Property was synchronized with ZenHost, when it was synchronized.
updated_atstring (date-time)obligatoireLast change of the booking, its status, amounts or guest details.
guestBookingGuest | nullAfficher 4 attributs enfantsMasquer les attributs enfants
first_namestring | nullobligatoirelast_namestring | nullobligatoireemailstring | nullobligatoirephonestring | nullobligatoire
amountsBookingAmountsBooking amounts. Present only with the
prices.readPermission.Afficher 4 attributs enfantsMasquer les attributs enfants
currencystringobligatoireISO 4217 code of the amounts below.
totalnumberobligatoireSum of the
linesnot included in another line, in decimal units ofcurrency.commissionnumberobligatoireCommission kept by the Sales Channel (0 when none is known, or when no line counts toward
total).linesBookingAmountLine[]obligatoireThe amount lines of the booking.
Afficher 5 attributs enfantsMasquer les attributs enfants
typestringobligatoirenightsaccommodation,discount(negative),cleaning,city_tax,taxanother tax,linen,extraan extra service sold to the guest,feeanother fee,other. Version 1 may add values.Parmi :
nightsdiscountcleaningcity_taxtaxlinenextrafeeotherlabelstringobligatoireName of the line, as the Sales Channel or the host wrote it.
amountnumberobligatoireAmount of the line, in
currency.withheld_by_channelbooleanobligatoireWhether the Sales Channel withholds this amount from what it pays the host, such as a city tax Airbnb pays the city itself; the host never receives it.
included_in_pricebooleanobligatoireWhether the amount is already part of another line's price, such as VAT or a fee the Sales Channel folded into the nights; it is then left out of
total.
next_cursorstring | nullobligatoirePass it as
cursor, with the same filters, to read the next page;nullon the last page.next_updated_sincestring (date-time)obligatoireOnce the last page is read, pass it as
updated_sinceto receive every booking changed since this listing began. Some bookings may come again: upsert them byid.
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: property_out_of_scope, validation_failed.
Codes d’erreur
property_out_of_scopeUn logement demandé est hors du périmètre de connexion ;details.property_idsles liste.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).
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.