Webhooks
Webhooks allow you to receive real-time notifications when certain events occur within EasyOrders API. You can configure webhooks to send data to a specific URL whenever an event is triggered.
Creating a Webhook
To create a webhook:
- Log in to your seller dashboard.
- Go to the Public API section.
- Navigate to Webhooks.
- Click on Create Webhook.
- Enter the endpoint URL where you want to receive webhook notifications.
- Save the webhook configuration.
After creating the webhook, a secret key will be generated.
Secret example
curl -X POST \
-H "Content-Type: application/json" \
-H "secret: GENERATED_SECRET" \
https://your-webhook-url.com/receive
fetch('https://your-webhook-url.com/receive', {
method: 'POST',
headers: {
'Content-Type': 'application',
'secret': 'GENERATED SECRET',
},
body: orderPayload,
});
Webhook Payload
When an event is triggered, EasyOrders will send a POST request to the specified webhook URL. The request will include a JSON payload containing relevant information about the event. Here's an example payload: