Ometria's webhooks support Jinja logic, including:
Conditional content
Loops (
{% for %})Formatting functions (e.g.,
strftime())Dynamic JSON construction
This allows payloads to scale dynamically based on:
Number of products in a basket
Customer data
With Jinja support, webhook payloads become more flexible and efficient.
See also: Jinja's documentation site
Example:
The following webhook payload was implemented in an Ometria automation for Movable Ink.
It demonstrates:
A hardcoded event type
Formatting timestamps
Looping through all products in a basket
Sending product data dynamically
Including customer profile attributes
This pattern can be adapted for any downstream system.
{
"event_type": "abandoned_basket",
"event_timestamp": "{{ now | strftime('%Y-%m-%d %H:%M:%S') }}",
"basket_url": "{{ basket.url }}",
"customer": {
"profile_hash": "{{ profile.hash }}",
"number_of_orders": "{{ profile.number_of_orders }}"
},
"products": [
{% for product in basket.products %}
{
"id": "{{ product.id }}",
"title": "{{ product.title }}",
"image_url": "{{ product.image_url }}",
"url": "{{ product.url }}"
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}
Comments
0 comments
Article is closed for comments.