Skillnad mellan versioner av "Templating:Webhooks"
Från Vendre Help
(Skapade sidan med 'Web design is no cakewalk and must be done by a professional. Creativity may be one thing but putting it together in the form of a professional web design is another. Hence you m...') |
Johan (Diskussion | bidrag) (Skapade sidan med 'This page documents the Twig template variables available when formatting webhook payloads and URLs. ==Twig variables== ===Context variables=== These variables are passed gl...') |
||
| Rad 1: | Rad 1: | ||
| − | + | This page documents the Twig template variables available when formatting webhook payloads and URLs. | |
| − | + | ==Twig variables== | |
| − | + | ===Context variables=== | |
| + | These variables are passed globally into the Twig context when a webhook event is triggered. | ||
| − | + | {|class="wikitable" | |
| + | !variable | ||
| + | !description | ||
| + | |- | ||
| + | |payload | ||
| + | |The primary data payload object containing the event-specific details. | ||
| + | |- | ||
| + | |data | ||
| + | |An alias for <tt>payload</tt>. | ||
| + | |- | ||
| + | |order | ||
| + | |An alias for <tt>payload</tt> (provided for convenience when dealing with order-specific events). | ||
| + | |- | ||
| + | |trigger | ||
| + | |The decoded configuration or structural data that initiated the webhook trigger. | ||
| + | |- | ||
| + | |webhook_event | ||
| + | |The exact name of the event that fired the webhook (e.g., <tt>order.created</tt>). | ||
| + | |- | ||
| + | |webhook | ||
| + | |An array containing metadata about the configured webhook itself. See the table below for sub-properties. | ||
| + | |- | ||
| + | |now | ||
| + | |The current system timestamp at execution time, formatted as an ISO 8601 string. | ||
| + | |} | ||
| − | + | ===Webhook metadata properties=== | |
| + | These properties are accessible nested inside the <tt>webhook</tt> array variable. | ||
| − | + | {|class="wikitable" | |
| − | + | !variable | |
| − | + | !description | |
| − | + | |- | |
| − | + | |webhook.id | |
| − | + | |The database ID of the specific webhook URL configuration. | |
| − | + | |- | |
| − | + | |webhook.url | |
| − | + | |The target destination URL where the payload is dispatched. | |
| − | + | |- | |
| − | + | |webhook.type | |
| − | + | |The integration type classification assigned to this webhook. | |
| − | + | |- | |
| − | + | |webhook.method | |
| − | + | |The HTTP request method used for the payload delivery (e.g., <tt>POST</tt>, <tt>GET</tt>, <tt>PUT</tt>). | |
| − | + | |- | |
| − | + | |webhook.data_format | |
| − | + | |The format structure expected by the payload (e.g., <tt>json</tt>, <tt>xml</tt>). | |
| + | |- | ||
| + | |webhook.data_filter | ||
| + | |The filter rule configuration string or logic applied to this webhook. | ||
| + | |} | ||
Nuvarande version från 3 juni 2026 kl. 12.53
This page documents the Twig template variables available when formatting webhook payloads and URLs.
Twig variables
Context variables
These variables are passed globally into the Twig context when a webhook event is triggered.
| variable | description |
|---|---|
| payload | The primary data payload object containing the event-specific details. |
| data | An alias for payload. |
| order | An alias for payload (provided for convenience when dealing with order-specific events). |
| trigger | The decoded configuration or structural data that initiated the webhook trigger. |
| webhook_event | The exact name of the event that fired the webhook (e.g., order.created). |
| webhook | An array containing metadata about the configured webhook itself. See the table below for sub-properties. |
| now | The current system timestamp at execution time, formatted as an ISO 8601 string. |
Webhook metadata properties
These properties are accessible nested inside the webhook array variable.
| variable | description |
|---|---|
| webhook.id | The database ID of the specific webhook URL configuration. |
| webhook.url | The target destination URL where the payload is dispatched. |
| webhook.type | The integration type classification assigned to this webhook. |
| webhook.method | The HTTP request method used for the payload delivery (e.g., POST, GET, PUT). |
| webhook.data_format | The format structure expected by the payload (e.g., json, xml). |
| webhook.data_filter | The filter rule configuration string or logic applied to this webhook. |