General Webhooks
General Webhooks provide a streamlined way to receive event notifications about various Mews entities. Each Webhook message corresponds to a specific enterprise integration, identifiable via the EnterpriseId
and IntegrationId
fields in the request body. These identifiers allow you to track events across all enterprises or properties connected to your integration.
Key features
Unified event delivery – Each message encapsulates all events related to the entities you’ve subscribed to that occur simultaneously. For example, subscribing to Service Order events (which include reservations as a subtype) may result in a Webhook containing multiple
ServiceOrderUpdated
events, each corresponding to a different reservation.Event structure – Each event within a message specifies the event type and includes the unique identifier of the associated entity, e.g.
CustomerAdded
events include aCustomerId
. To retrieve detailed information about an entity, use the relevant API Operation along with the entity’s unique identifier. For instance, for aCustomerAdded
event, call Get all customers with the providedCustomerId
.Efficient integration - Receive notifications for all subscribed enterprises or properties in a single payload, minimizing the need for multiple requests or real-time polling. Leverage
EnterpriseId
andIntegrationId
to manage and filter event data effectively.
Implementation
To implement General Webhooks:
Define the entities and event types you are interested in via your Webhook subscription.
Use
EnterpriseId
andIntegrationId
to differentiate messages across multiple enterprises or properties.Fetch additional details about entities as needed by using the appropriate API Operations.
Supported events
Entity
Event
Description
Service Order
ServiceOrderUpdated
Event triggered when a service order is updated
Resource
ResourceUpdated
Event triggered when a resource is updated
Message
MessageAdded
Event triggered when a new message is added
Resource block
ResourceBlockUpdated
Event triggered when a resource block is updated
Customer
CustomerAdded
Event triggered when a customer is added
Customer
CustomerUpdated
Event triggered when a customer is updated
TerminologyA Service Order is an order made against a Service. A Service Order made against a Bookable Service is called a Reservation. In fact only Reservations are currently supported, however this may be extended in future. A Resource can be a bookable space, an object or even the services of a person. Resource normally implies a space, but again this may be extended in future. For a full description of all the terms used, see the Mews Glossary for Open API users.
Added vs Updated events
In the context of General Webhooks, the terms Added and Updated describe different types of changes to an entity:
Updated – This indicates any change to an entity, including modifications to its fields or properties; it also encompasses the creation of a new entity, as creating an entity is considered a change to its lifecycle state.
Added – This specifically refers to the initial creation of an entity at the start of its lifecycle; it represents a subset of Updated events, as every Added event is inherently also an Updated event.
Important considerations
When you subscribe to events for entities like Customers, a newly created entity generates both a CustomerAdded
event and a CustomerUpdated
event. These events will have the same CustomerId
and will often appear within the same Webhook message. To avoid redundant API calls, ensure that you process each entity only once. For example, when you receive both a CustomerAdded
and a CustomerUpdated
event for the same CustomerId
, call Get all customers only once to retrieve the entity details.
Request body
EnterpriseId
string
required
IntegrationId
string
required
Events
required
The set of events that have occurred.
Event
Discriminator
required
The type of event.
Value
object
required
Event discriminator
ServiceOrderUpdated
ResourceUpdated
MessageAdded
ResourceBlockUpdated
CustomerAdded
CustomerUpdated
Entity updated data
Id
string
required
Last updated