Webhooks provide a way to configure your Solatech-DOS account to make requests to another service whenever certain events occur in your account. A webhook consists of:
- A type of trigger: This is the entity that the webhooks applies to.
- One or more events: The specific action on the entity that you want to track.
- A URL – the endpoint where you want Solatech-DOS to send the event payloads when a matching event happens.
There are two parts to getting a webhook to work: creating the webhook and triggering the webhook. After you create a webhook for an event, every time that event occurs, Solatech-DOS sends a payload request that describes the event to the specified URL. Thus, you can think of webhooks as a kind of notification system.
Use webhooks to integrate applications with Solatech-DOS, for example:
- Every time a customer is created, you may want the customer details added to your CRM.
- Every time a payment is added to a sale, you may want to notify your accountant.
Without webhooks, if you want to detect when events occur in Solatech-DOS, you need to poll the API. However, polling the API is inconvenient, inefficient, and error-prone. Consider how SMS messages work on mobile phones. You don't have to check your messages every 5 minutes to see if you have a text because your phone sends you a notification. In the same way, webhooks work like the notification so that the API does not have to check for the same activity every minute.
You can create webhooks by navigating to the Webhooks website, by clicking a link from with your Solatech-DOS site. Once you're on the Webhooks site you can create, view and manage your webhooks.
When an event associated with a webhook occurs, Solatech-DOS sends a request to the webhook URL containing the event payload.
You can create webhooks for the following events:
- Account administration
- Customers
- Quotes
- Sales
- Purchase Orders
All event payload requests have the following HTTP headers:
The action that triggers the webhook (for example, customer:created).
The unique id of the webhook that an event triggers.
The number of times Solatech-DOS attempted to send the payload. After the first request, Solatech-DOS tries to send the payload two more times if the previous attempts fail.