Conditional Webhooks
Importance of Rules
Webhooks Targeting
Use Cases
General Standards in Attributes
=,!=,AND,OR
etc in such a manner: payment_method = YOUR_PAYMENT_METHOD
or in combination payment_method = mada OR price < 50
. That adds more capability to filter the response based on conditionalities. In the following section, you can look up more into how you can construct your own rules using real-world examples.Write Your First Rule
{
"name": "Salla Order Created Event",
"event": "order.created",
"url": "https://webhook.site/a61ca376-dd98-4053-b2c4-8ba9cca470fc",
"version": 2,
"rule": "total > 100",
"headers": [
{
"key": "Authorization",
"value": "Your Secret token"
},
{
"key": "Accept-Language",
"value": "AR"
}
]
}
Examples
Special Offer Webhook Request
Customer Webhook Request
{
"name": "Salla Special Offer Created Event",
"event": "specialoffer.created",
"url": "https://webhook.site/a61ca376-dd98-4053-b2c4-8ba9cca470fc",
"version": 2,
"rule": "status = `active` OR applied_to = `first_order`",
"headers": [
{
"key": "Authorization",
"value": "Your Secret token"
},
{
"key": "Accept-Language",
"value": "AR"
}
]
}
specialoffer.created
. In the rule section, we added OR
that means, when one of the conditions are
true
, this wil trigger the webhook. In our example, the webhook will be triggered whenever there is a status
equaling to active
, or the the special offer created is applied to order
.Attributes
Category
event, use in the rule
section one or more of the following:id |
name |
parent_id |
status |
sort_order |
Order
Events
Properties
The supported events are the following:
Event Name |
---|
order.created |
order.updated |
order.status.updated |
order.cancelled |
order.refunded |
order.deleted |
order.products.updated |
order.payment.updated |
order.coupon.updated |
order.total.price.updated |
order.shipment.creating |
order.shipment.created |
order.shipment.cancelled |
order.shipment.return.creating |
order.shipment.return.created |
order.shipment.return.cancelled |
order.shipping.address.updated |
Product
Events
Properties
The supported events are the following:
Event Name |
---|
product.created |
product.updated |
product.deleted |
product.available |
product.quantity.low |
Customer
Events
Properties
The supported events are the following:
Event Name |
---|
customer.created |
customer.updated |
customer.login |
customer.otp.request |
Special Offers
Events
Properties
The supported events are the following:
Event Name |
---|
specialoffer.created |
specialoffer.updated |
Category
Events
Properties
The supported events are the following:
Event Name |
---|
category.created |
category.updated |
Brand
Events
Properties
The supported events are the following:
Event Name |
---|
brand.created |
brand.updated |
brand.deleted |
Cart
Events
Properties
The supported event is the following:
Event Name |
---|
abandoned.cart |
Miscellaneous
Events
Properties
The supported event is the following:
Event Name |
---|
review.added |
Modified at 2024-12-19 08:37:15