Using webhooks
Webhooks allow you to be automatically notified when an object’s status changes (order, registration, refund, etc.). By following its life cycle, you are able to react by triggering new events, calls, etc.
For security reasons, the webhook is reduced to its simplest form that is unusable without an authenticated access to the API. This is a POST request with the following body:
{"order":"dd5e4c4c-2c07-4af8-ae30-15f4c6d5b5e5"}
When you receive this webhook, it is up to you to interrogate the object in question via the corresponding resource provided to you, and find out the new status.
Example:
GET https://secure.lyra.com/orders/dd5e4c4c-2c07-4af8-ae30-15f4c6d5b5e5)
Usually, the webhook reaches the marketplace server a few seconds after the status change. If an error occurs when it is sent (e.g. network unavailable), it can be resent up to two additional times, i.e. three times in total, at 15-minute intervals.
The webhook is not resent if there is an error once it is received (for example: if your server returns a 400, 404, 500 status, etc.). To avoid the most common errors, a dispatch and receipt check is carried out when the webhook is registered.
- Define one (or more) access points
- Access the available webhooks, and those currently defined on your marketplace
- Register, modify and delete your webhooks.