MGR’s notification Webhook will notify a URL of your choice via HTTP/HTTPS POST with information about events that occur as MGR processes your data. Notifications can be configured to send webhooks to your server when important events occur within the MGR system. These webhooks allow you to trigger different behaviours in your server depending on the status of the notifications you send.
Webhooks are sent as
POST requests with a JSON body. You configure the request body payload in the content section.
So how do you set up webhooks in the notifications?
- Please go to the Notifications section in the shop settings.
- Click on the EDIT icon next to the notification you want to send it to your server.
- From the popup please provide the following 4 pieces of information.
- Webhook URL – URL of the endpoint
- Username – If applicable
- Password – If applicable
- Payload – JSON Required
- The payload is where you define what format the data should be in. Please note that you can change everything to suit your needs, you can use the TAGS for the values where needed. Your data will look like the following example. Please note that the following example is only for illustration purposes.
|Authorization||Basic: username: password|
|mgr-event-id||the type of event that triggered the webhook.|
You can add additional headers by clicking on the “Add Headers” button. Please enter the headers in the below JSON format.
We expect your server to respond to webhook requests with a 2XX status code within ten seconds. Non-2XX responses, or responses that take more than two seconds, will be considered failures. Your server should return the repose as soon as it gets the request and then do whatever needs to be done with the data afterwards.
- If your server fails to reply with a 2xx status code, we will retry the webhook request up to five times – every 300 seconds. Please note that you can always retry the failed ones from the webhook queue.
- If your server fails to reply within two seconds, we will consider it as a request timeout. In this case, it is possible that your server may have already processed the request and we will still retry up to five times – every 300 seconds. So we recommend you send a unique identity within the payload that you could test if your server has already processed and only process it if it was not already done.
- After 24 hours all the failed ones will be deleted automatically so there will not be further retries.