Webhooks
Webhooks allow the sending of information about an event that occurs in the system, such as the creation or editing of an order. The system sends an HTTP request to the URL set in the webhook for each of these events.
The URL set in the webhook is called as a POST request, with the body of the request containing a JSON that includes a list of entity identifiers from the system (e.g., orders). A detailed description is provided for each type of webhook. The body of the request also includes the name of the e-shop in Upgates.
Each webhook created in the system is tied to the API user who created it. If this user does not have rights to the endpoint, such as orders, they will not be able to create a webhook for events related to orders. The same applies to other types of webhooks. If the user has created a webhook and their permissions are changed, the webhook will be deactivated.
The POST request to the URL set in the webhook will expect a 200 OK or 204 No Content response. The timeout is set to one second. This means that the server called by the webhook should not process the data directly but should only store the data and return the appropriate status code. In case of an incorrect response, the system will resend the webhook every 5 minutes until it receives the correct response. If the system does not receive the correct response within 12 hours, the webhook will be deactivated.
Creating and Managing Webhooks in Upgates
Managing webhooks (creation, editing, deletion) is only possible through the API. More information can be found in the Webhook API documentation.