Adding a webhook
In order to add a webhook, first check that the webhook address is public and returns a 200 status when an empty request is received, then execute a request
POST /marketplaces/{marketplace}/webhookswith the following body:
{ "event_type":"<event_type">, "target":"<webhook_url>" }
For example:
Request
POST https://secure.lyra.com/marketplaces/6f6b04c2-0e99-4f8d-b710-8856f5654bb8/webhooks
Body
{ "event_type":"registration", "target":"https://mymarketplace.com/mkp/webhooks/sellers.php" }
In case of an error during the test, the creation (or modification) request will return a 400 error.
Example if you have declared a non-existent page as webhook:
{"error":"Url https://mymarketplace.com/mkp/webhooks/sellers.php returned a status 404 instead of 200}
In case of success, the server returns a 200 code and the corresponding object.