Create subscriptions
Let's get started with creating a new subscription.
You must ensure that you have a hotel level access token to authenticate requests related to subscriptions. More information about hotel access tokens.
Creating a subscription
You must provide a valid endpoint when creating a subscription. The endpoint will be sent a POST healthcheck that will pass if a valid 2xx response status code is sent.
A topic is an enum that defines the types of queries that the endpoint is subscribed to. The values for topic can be found in the API reference. The following table indicates the queries that are related to a specific topic.
| Query | Topic | Action |
|---|---|---|
| createSpace | Space | new-space |
| updateSpace | Space | update-space |
| deleteSpace | Space | delete-space |
| createPricelist | Space | new-pricelist |
| updatePricelist | Space | update-pricelist |
| deletePricelist | Space | delete-pricelist |
| createOrder | Space | new-order |
| updateOrder | Space | update-order |
| createBooking | Space | new-booking |
| UpdateBooking | Space | update-booking |
mutation createMarketplaceAppSubscription {
createMarketplaceAppSubscription(
endpoint: "https://api.your-app.com/xxxxx"
topics: [Booking, Order, Space]
) {
id
endpoint
topics
}
}
Reponse
{
"data": {
"createMarketplaceAppSubscription": {
"id": "69ba68fa-a480-4fd4-bf25-049e5182155f",
"endpoint": "https://api.your-app.com/xxxxx",
"topics": ["Booking", "Order", "Space"]
}
}
}