A webhook is an HTTP POST request that occurs when something happens. In other words, it’s a simple event notification via HTTP POST. Ecwid uses webhooks to notify your application in real time about events in the merchant store.
How to use webhooks
This is how your application can use webhooks:
- Get notified every time a new product is created or an existing product is changed; then synchronize store catalog with your local database
- Get notified about every new order in the store; then send a custom email or text message, generate a custom receipt, or subscribe the customer to your newsletter
- and so on
Don’t use webhooks as actionable items – please see the Processing webhooks notes below for details on working with webhooks.
How webhooks work
Webhooks in Ecwid work this way:
- Ecwid will use the
Webhook URL
from your application details to send any available webhooks to that single URL - When a merchant installs your application, the webhooks for this store are automatically enabled
- Each supported event in the store (e.g. new order is placed) triggers an HTTP POST request to the URL your specified
- Your application receives the requests and replies with
200 OK
to identify that it's received - Then your app processes the webhook request and performs further steps to handle the event
What entities are supported
You can receive webhooks about these store entities:
- Abandoned sale (created, updated, deleted)
- Order (created, updated, deleted)
- Product (created, updated, deleted)
- Category (created, updated, deleted)
- Customer (created, updated, deleted)
- Store profile (updated, subscription plan updated)
- Discount coupons (created, updated, deleted)
- Application (installed, subscription status updated, uninstalled)
- Invoices (created, deleted)
- Customer/store owner personal data request (export/removal request)
Each webhook type requires
read_*
access scope for its entity. For example, to get anyproduct.*
related webhook, your app must haveread_catalog
access scope.