Events
Introduction
All events are sent as a POST
request to the webhook url. The message is sent as a JSON object in the body of the request. The content type of the request is application/json
. All event data is built around the detail-type
field.
The detail-type
field is used to identify the type of event. The data for the event is stored in the detail
field. The detail
field is an object, and its structure varies based on the type of event. As a JSON object, its structure depends on the specified detail-type
.
The definitions of each events data could be found in the specific event documentation pages, each event data structure is defined in a JSON schema
.
Event structure
All events are sent as a JSON object in the body of the request. With a envelope structure that are the same for all events. The envelope contains metadata for the event e.i id
, detail-type
, timestamp
, and the event data. The event data is stored in the detail
field.
Envelope
Field | Type | Description |
---|---|---|
id | string | The ID field is a unique identifier for the event. The ID field is a unique identifier for the event. This is useful for tracking the event and for debugging purposes and checking for duplicates. |
detail-type | string | Detail-type is used to identify the type of event. The data for the event is stored in the detail field. This field is an object, and its structure varies based on the type of event. As a JSON object, its structure depends on the specified detail-type . |
detail | object | The data for the event. See sub-pages for the specific event data structure. |
timestamp | string | The time the event was generated. The time is in RFC 3339 format. |
Detail-types
The detail-type
field is used to identify the type of event. The data for the event is stored in the detail
field. The detail
field is an object, and its structure varies based on the type of event. As a JSON object, its structure depends on the specified detail-type
.
The following detail-types
are available:
Detail-type | Description | Page |
---|---|---|
BookingCancelledV1 | Event triggered when a booking is cancelled. | Booking Cancelled V1 |
BookingCreatedV1 | Event triggered when a booking is created. | Booking Created V1 |
BookingMovedV1 | Event triggered when a booking is moved. | Booking Moved V1 |
CustomerCreatedV1 | Event triggered when a customer is created at facility. | Customer Created V1 |
CustomerDeletedV1 | Event triggered when a customer is deleted at facility. | Customer Deleted V1 |
CustomerUpdatedV1 | Event triggered when a customer is updated at facility. | Customer Updated V1 |
Event Data
The event data is stored in the detail
field. The structure of the detail
field varies based on the type of event. The structure of the detail
field is defined in a JSON schema.
For more information about each of the events data structure, visit the specific event documentation page.
JSON Schema for Events
All Matchi Webhook events are based on a JSON schema. The JSON schema defines the structure of the event data. The JSON schema ensures that the event data is consistent and valid. Our JSON schemas follow the 2020-12 specification.
Note: The JSON schema for each event could be found at the top of the event documentation.
For more information about JSON Schema, visit the official JSON Schema website.