With webhooks you can be informed about certain events. If a previously defined event occurs, Billomat sends a POST request to the stored URL. The affected object is delivered there. In case of success the requested URL must respond with the HTTP status code between 200 and 299. Different status codes are interpreted as errors.
In Billomat you can store up to one URL for various events under “Settings > Webhooks”. Also the format (XML or JSON) can be set and a combination of user name and password could be entered if the called URL is password protected.
When the event occurs Billomat sends a POST request.
<!--?xml version="1.0" encoding="UTF-8"?-->
<address>Billomat GmbH & Co. KG
Deutschland</address> <discount_rate type="float">2.0</discount_rate>
<intro>We are pleased to offer you the following items into account:</intro>
<note>Thank you for your order!</note>
If an event triggers other events (example: the creation of a payment causes the creation of a comment and the invoice is marked as paid), the order of webhook requests is indeterminate. However, each request has the header field X-Billomat-Webhook-Request-ID. With this, the requests can be sorted chronologically.
With the header X-Billomat-Webhook-Event the event that triggered the Webhook request is specified. This header may have the following values:
The requested URL must respond within 10 seconds and must provide the HTTP status code 2xx returned in case of success. All other status codes are interpreted as errors. Forwarding with the status code 30x is not possible. In case of failure with a HTTP status code other than 410 the request is retried after a minute. If the the second call still fails, Billomat retries another request after a further hour and after another six hours. If all calls fail, the webhook is disabled and an e-mail informs the account owner. All requests from the same event are send in the order of their occurrence. So, for example, if several invoices are created the webhook requests are fired in the order of creation. If a request fails permanently all subsequent requests are not sent.