Vanilo Cloud Webhooks

In the Admin area it is possible to define Notifications.

Webhook is one type of notification, besides SMS and E-mail.

A webhook is in fact an HTTP call that will be triggered when a certain event happens in the E-commerce system.

To configure a webhook, the following parameters can be set.

Sender

Is currently not used for webhooks, leave it empty:

{}

Recipients

{
  "url": "https://endpoint.com/path",
  "method": "get|post"
}

No variable substitution occurs.

Content

{
  "headers": {
    "Auth": "12345",
    "Accept": "application/json"
  },
  "form": {
    "field1": ""
  },
  "payload": {
    "order_id": "",
    "order_number": "",
    "status": ""
  },
  "query": {
    "order_number": ""
  }
}
  • headers: HTTP headers to be sent along with the request. Works both with POST and GET
  • form: if this field is present, then the request will be sent as form ('application/x-www-form-urlencoded), and the fields will be taken from the values of form. Only works with POST gets ignored with GET
  • payload: The fields to send as JSON. Only with POST
  • query: Optional query fields for GET requests.

Variables

Variables can set in {{ order.number }} format. Whitespaces are ignored, so {{order.number}} works as well.

Order Variables

  • order.id
  • order.number
  • order.email (the billpayer's email)
  • order.name (the billpayer's name)
  • order.first_name (the billpayer's first name if stored)
  • order.last_name (the billpayer's last name if stored)
  • order.total (along with the price eg. 29.9 €)
  • order.currency
  • order.status
  • order.notes
  • order.created_at*
  • order.ordered_at*

Shipping Address Variables

If the order has a shipping address, the following fields are also available:

  • order.shippingAddress.name
  • order.shippingAddress.lastname
  • order.shippingAddress.firstname
  • order.shippingAddress.company_name
  • order.shippingAddress.country (the ISO 3166-1 alpha-2 code)
  • order.shippingAddress.postalcode
  • order.shippingAddress.city
  • order.shippingAddress.address
  • order.shippingAddress.address2
  • order.shippingAddress.email (it may differ from the billpayer's email)
  • order.shippingAddress.phone
  • order.shippingAddress.registration_nr
  • order.shippingAddress.tax_nr
  • order.shippingAddress.access_code
  • order.shippingAddress.province_code
  • order.shippingAddress.province_name

Invoice Variables

If the event contains an invoice, the following fields are also available:

  • invoice.id
  • invoice.number
  • invoice.hash
  • invoice.emitted_on*
  • invoice.total
  • invoice.currency
  • invoice.pdf_url
  • invoice.pdf_base64
  • invoice.operator
  • invoice.remote_id

*: Datetime fields accept an optional format parameter like: {{ order.ordered_at|'j.n.Y H.i' }} which renders to 1.2.2023 16.03. The format string can be anything from here: https://www.php.net/manual/en/datetime.format.php#refsect1-datetime.format-parameters