General Webhooks
This is a newer form of Webhook message which carries event information related to different entities in Mews.
Each General Webhook message corresponds to a single property or enterprise integration, identified by EnterpriseId
and IntegrationId
in the request body. You will receive events for all the properties you are integrated with, and can identify each one from this information.
The message encapsulates all events occurring at the same time which relate to entities to which you have subscribed. For example, if you are interested in reservations you will subscribe to Service Order events (a reservation is a type of Service Order) and you may receive multiple ServiceOrderUpdated
events in one Webhook message, each for a different Service Order / Reservation.
Each event includes the type of event and the unique identifier for the related entity, e.g. a Customer Added
event would also include the Customer ID. To obtain details about the entity, you then need to call the corresponding API operation using that identifier, e.g. in the case of Customer Added
you would call Get all customers with the Customer ID.
Supported events
Entity | Event | Description |
Service Order |
| Event triggered when a service order is updated |
Resource |
| Event triggered when a resource is updated |
Message |
| Event triggered when a new message is added |
Resource block |
| Event triggered when a resource block is updated |
Customer |
| Event triggered when a customer is added |
Customer |
| 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
'Updated' implies that some change to an entity has occurred, including changes to the fields or properties within the entity but also when the entity is created or added at the beginning of its life. 'Added' implies only that the entity is created or added at the beginning of its life. In other words, 'Added' is a subset of 'Updated'.
As a consequence of this, note that if you subscribe to Customer events, then when a new Customer is created, the system will generate both a CustomerAdded
event and a CustomerUpdated
event for the same Customer ID in the same Webhook message. Be aware you should only call Get all customers once not twice in this case.
Request body
Property | Type | Contract | Description |
---|---|---|---|
| string | required | Unique identifier of the Enterprise to which the events belong. |
| string | required | Unique identifier of the Integration to which the events belong. |
| array of Event | required | The set of events that have occurred. |
Event
Property | Type | Contract | Description |
---|---|---|---|
| string Event discriminator | required | The type of event. |
| object | required | The structure of the object depends on Event discriminator. |
Event discriminator
Discriminator | Description | Value | Fetch operation |
---|---|---|---|
| A Reservation or other Service Order was updated. | ||
| A Resource (for example a guest room or other space) was updated. | ||
| A Message was added. | ||
| A Resource block was updated. | ||
| A Customer was added. | ||
| A Customer was updated. |
Entity updated data
Property | Type | Contract | Description |
---|---|---|---|
| string | required | Unique identifier of the updated/added entity. To fetch entity data use the related operation per Event discriminator. |
Last updated