Skip to main content

Webhooks

Webhooks are used to send updates of events from Stratech Booking. The data of the events will be in the body of the request as a JSON object.

All events will be posted to the same webhook. With the eventType property a distinction can be made between events. The eventData property contains specific data for that event. See below for more information about the events.

Events:

Authorization

When a Stratech Booking User connects a Partner, Stratech Booking will post an Authorization event to the webhook. The body of this event will look like this:

Example of a Authorization.code.created event
{
"eventType": "Authorization.code.created",
"eventData": {
"organizationReference": "org_12345",
"code": "authorizationCode",
"redirectUri": "https://example.stratechbooking.nl/login-client-callback"
}
}

When a Stratech Booking User revokes the connection, Stratech Booking will post an Authorization revoked event to the webhook. The body of this event will look like this:

Example of a Authorization.revoked event
{
"eventType": "Authorization.revoked",
"eventData": {
"organizationReference": "org_12345"
}
}

The code can be used to retrieve a refresh token (see Authentication).

User authorization flow sequence This diagram shows the webhook flow for the authorization_code from Stratech Booking user to the partner.

PriceAvailability

When the PriceAvailability is calculated a PriceAvailabilityLos event will be posted to the webhook. The body of this event will look like this:

Example of a PriceAvailability.los.created event
{
"eventType": "PriceAvailability.los.created",
"eventData": {
"organizationReference": "org_12345",
"resortReference": "rst_54321",
"channelReference": "dc_jdy39",
"key": "losKey"
}
}

The key and channelReference can be used to retrieve the price availability data (see Price-Availability).

los sequence
This diagram shows the sequence for the LOS webhook.

PriceAvailability availability updated

For each change that is made in the availability of a organisation a partial LOS dataset event will be created that consist of the effected units available. This new partial LOS dataset will contain a losKey that references to its corresponding LOS dataset. The new partial LOS dataset will contain the current available units for that period.

Example of a changed period (the complete JSON body of the event is show below)
"losPriceAvailability": [
{
"arrivalDate": "2022-04-01T00:00:00+02:00",
"lengthOfStay": 1,
"unitsAvailable": 15
}
]

With the arrivalDate and lengthOfStay the corresponding period can be found in the LOS dataset.

Every time a change is made a new partial LOS dataset will be send to the webhook. The (complete body) of an update looks like this:

Example of a PriceAvailability.los.updated event
{
"eventType": "PriceAvailability.los.updated",
"eventData": {
"losKey": "losKey",
"organizationReference": "organizationReference",
"resortReference": "resortReference",
"channelReference": "channelReference",
"products": [
{
"losPriceAvailability": [
{
"arrivalDate": "2022-04-01T00:00:00+02:00",
"lengthOfStay": 1,
"unitsAvailable": 15
},
{
"arrivalDate": "2022-04-01T00:00:00+02:00",
"lengthOfStay": 2,
"unitsAvailable": 15
},
{
"arrivalDate": "2022-04-02T00:00:00+02:00",
"lengthOfStay": 1,
"unitsAvailable": 15
}
],
"productId": "prod_46fphyv"
}
]
}
}