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:

  1. ORDER_CREATE
  2. ORDER_DELIVERY_CHANGE
  3. ORDER_PAYMENT_CHANGE
  4. SEND_MESSAGE_TO_USER
  5. SEND_NEW_PASSWD_TO_USER
  6. WEBHOOK_CONTENT_UPDATE
  7. WEBHOOK_CATEGORY_UPDATE

Webhook Details

Here's a detailed breakdown of each webhook type:

Webhook NameTypeMethodParameters
ORDER_CREATEdelayedGETid_order
ORDER_DELIVERY_CHANGEinstantGETid_order, state1, state2
ORDER_PAYMENT_CHANGEdelayedGETid_order, state1, state2
SEND_MESSAGE_TO_USERinstantPOSTemail, message
SEND_NEW_PASSWD_TO_USERinstantPOSTemail, passwd
WEBHOOK_CONTENT_UPDATEdelayedGETid_shopobject, language
WEBHOOK_CATEGORY_UPDATEdelayedGETid_category, language

Managing Webhooks

You can manage your webhooks in the Sleekshop backend:

  1. Navigate to Administration > Settings > Webhooks
  2. 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

  1. Ensure your webhook endpoint can handle the expected load.
  2. Implement proper error handling and logging for your webhook receivers.
  3. Use HTTPS for secure communication.
  4. Implement authentication for your webhook endpoints to ensure the requests are coming from Sleekshop.
  5. Process webhook data asynchronously on your end to avoid timeouts.

Was this page helpful?