Webhooks

Setting up webhooks :nut-and-bolt:

Webhooks can be configured in the admin UI for managing Booking Experts Apps.

You can subscribe to various events that happen in Booking Experts. Think of events like reservation:checked_in, reservation:checked_out, reservation:created, category:updated etc.

See the API Reference for a complete list.


Requirements

In order to receive webhook events for a resource, the following conditions apply:

  • You must have read permissions for the given resource. Ensure you have properly set the permissions in your App configuration;
  • In case the resource belongs to a specific administration, the status of the administration must be 'Test' or 'Production'.
  • Please select the permissions you need rather than selecting all of them by default.

Target URL

When an event is triggered in Booking Experts, the target URL you specified will be called. When you have configured the webhook to wait for confirmation, the target URL will be called until a 200 Success response is returned by your server.


Payload

The webhook payload contains the following attributes:

  • event - The name of the event
  • subscription_id - The subscription_id to which this even applies
  • record - The subject to which the event applies. For example, when reservation:checked_in is triggered, you will receive a Reservation resource as documented by the Reservation schema.
  • context - An event occurs always occurs within a certain context. Possible values are 'administration', 'organization' or 'global'.
  • context_id - When an event occurs within an Administration or Organization, the context_id will contain the Administration ID or Organization ID, respectively.
  • event_metadata - Optional. Contains extra metadata like a list of attribute changes. See the next section for more info.

Event Metadata

Event metadata may be passed for certain events:

  • updated events
    • changes
    • Every key in the changes object is an attribute name and its value is an array [old_value, new_value].
      for example, when you receive the channel|updated event, you might receive the following changes: "changes": { "name": ["HomeAway", "Vrbo"] }.
  • category|prices_updated or category|availability_updated
    • date_ranges
    • An array of [start_date, end_date] arrays (exclusive end_date). It yields to which date ranges the price or availability update applies. When not specified, it applies to every current or future date.
    • original_event
    • Mostly for debugging purposes. It hints on the origin of the change.
  • category|prices_updated
    • pricing_types
    • An array listing to which pricing types the change applies. Possible values are los_prices and night_prices.