Menu/bookings

List the bookings of the Connection Scope

GET/api/v1/bookings
Nécessite bookings.read

Bookings 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_since of your previous listing.

  • cursorstring

    next_cursor of the previous page.

  • limitinteger

    Page size.

    min 1 · max 500 · par défaut 100

Réponses

200One page of bookings.

application/jsonBookingList

  • dataBooking[]obligatoire
    Afficher 12 attributs enfants
    • idstring (uuid)obligatoire
    • property_idstring (uuid)obligatoire
    • statusstringobligatoire

      A cancelled booking stays listed with this status. Version 1 may add values.

      Parmi : confirmed cancelled

    • arrival_datestring (date)obligatoire

      First night, YYYY-MM-DD in the property time zone.

    • departure_datestring (date)obligatoire

      Check-out day (not a night), YYYY-MM-DD.

    • sales_channelobjectobligatoire

      Where the booking was made.

      Afficher 2 attributs enfants
      • codestringobligatoire

        direct (entered by the host), website (direct website), other, or the Sales Channel shortcode (e.g. ABB for Airbnb, BDC for Booking.com).

      • namestringobligatoire
    • channel_referencestring | nullobligatoire

      Confirmation code of the booking on its Sales Channel.

    • occupancyobjectobligatoire
      Afficher 3 attributs enfants
      • adultsinteger | nullobligatoire
      • childreninteger | nullobligatoire
      • infantsinteger | nullobligatoire
    • created_atstring (date-time)obligatoire

      When 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)obligatoire

      Last change of the booking, its status, amounts or guest details.

    • guestBookingGuest | null
      Afficher 4 attributs enfants
      • first_namestring | nullobligatoire
      • last_namestring | nullobligatoire
      • emailstring | nullobligatoire
      • phonestring | nullobligatoire
    • amountsBookingAmounts

      Booking amounts. Present only with the prices.read Permission.

      Afficher 4 attributs enfants
      • currencystringobligatoire

        ISO 4217 code of the amounts below.

      • totalnumberobligatoire

        Sum of the lines not included in another line, in decimal units of currency.

      • commissionnumberobligatoire

        Commission kept by the Sales Channel (0 when none is known, or when no line counts toward total).

      • linesBookingAmountLine[]obligatoire

        The amount lines of the booking.

        Afficher 5 attributs enfants
        • typestringobligatoire

          nights accommodation, discount (negative), cleaning, city_tax, tax another tax, linen, extra an extra service sold to the guest, fee another fee, other. Version 1 may add values.

          Parmi : nights discount cleaning city_tax tax linen extra fee other

        • labelstringobligatoire

          Name of the line, as the Sales Channel or the host wrote it.

        • amountnumberobligatoire

          Amount of the line, in currency.

        • withheld_by_channelbooleanobligatoire

          Whether 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_pricebooleanobligatoire

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

    Pass it as cursor, with the same filters, to read the next page; null on the last page.

  • next_updated_sincestring (date-time)obligatoire

    Once the last page is read, pass it as updated_since to receive every booking changed since this listing began. Some bookings may come again: upsert them by id.

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: property_out_of_scope, validation_failed.

Codes d’erreur

  • property_out_of_scope Un logement demandé est hors du périmètre de connexion ; details.property_ids les liste.
  • 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).
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