Webhooks in Sleekshop
Webhooks allow your application to receive real-time notifications about specific events in your Sleekshop instance. This guide will help you understand the available webhook types, how to manage them, and best practices for implementation.
Available Webhook Types
Sleekshop offers the following types of webhooks:
ORDER_CREATE
ORDER_DELIVERY_CHANGE
ORDER_PAYMENT_CHANGE
SEND_MESSAGE_TO_USER
SEND_NEW_PASSWD_TO_USER
WEBHOOK_CONTENT_UPDATE
WEBHOOK_CATEGORY_UPDATE
When naming your webhooks, use only uppercase letters, numbers, and underscores.
Webhook Details
Here's a detailed breakdown of each webhook type:
Webhook Name | Type | Method | Parameters |
---|---|---|---|
ORDER_CREATE | delayed | GET | id_order |
ORDER_DELIVERY_CHANGE | instant | GET | id_order, state1, state2 |
ORDER_PAYMENT_CHANGE | delayed | GET | id_order, state1, state2 |
SEND_MESSAGE_TO_USER | instant | POST | email, message |
SEND_NEW_PASSWD_TO_USER | instant | POST | email, passwd |
WEBHOOK_CONTENT_UPDATE | delayed | GET | id_shopobject, language |
WEBHOOK_CATEGORY_UPDATE | delayed | GET | id_category, language |
Managing Webhooks
You can manage your webhooks in the Sleekshop backend:
- Navigate to Administration > Settings > Webhooks
- Here you can:
- Edit existing webhooks
- Monitor the health of webhooks
- Create new webhooks for any of the available events
Webhook Processing
- A webhook is considered healthy as long as it returns a 200 status code with the exact response:
WEBHOOK_EXECUTED
- If a webhook fails, it will be marked as unhealthy and will not run again until reactivated.
- To reactivate an unhealthy webhook, simply click on "Save" in the webhook settings.
API Routes
You can also manage webhooks programmatically using the API routes available.
Best Practices
- Ensure your webhook endpoint can handle the expected load.
- Implement proper error handling and logging for your webhook receivers.
- Use HTTPS for secure communication.
- Implement authentication for your webhook endpoints to ensure the requests are coming from Sleekshop.
- Process webhook data asynchronously on your end to avoid timeouts.