Webhook anatomy

Webhooks are always sent to your application's endpoint URL as a POST request.

Webhook headers

In addition to a JSON payload, webhooks include a number of HTTP headers containing additional information.

X-Evance-Account
Identifies the Evance Account by its evance.me domain. For example, my-account.evance.me.
X-Evance-API-Version
The API version used to serialize the webhook's payload.
X-Evance-Client
The API Client used to sign the webhook. Note, this is omitted if the Webhook was created through Evance's admin panel. 
X-Evance-Event
The event string consists of a topic and action. For example, products/created.
X-Evance-Signature
Evance includes a HMAC SHA256 signature of the payload, allowing you to verify the webhooks authenticity.
X-Evance-Webhook-Id
The unique ID for the webhook event.
X-Evance-Webhook-Attempt
The attempt number for the webhook identified by X-Evance-Webhook-Id.


Webhook payloads

Some, but not all information within the HTTP headers is duplicated within the payload. This allows you to choose how you consume data from Evance, but also helps in verifying the authenticity of the request.

account
Identifies the Evance Account by its evance.me domain. For example, my-account.evance.me.
apiVersion
The API version used to serialize the webhook's payload.
createdOn
The date & time the event was triggered (not when the webhook was sent) in ISO-8601 format. 
data
The data property contains the subject of the event serialized to the API version associate with the webhook.
For example, the data property contains a Product Object for a products/created event.
event
The event string consists of a topic and action. For example, products/created .
eventId
The unique ID for the webhook event.
metadata
Any additional meta data requested to be sent to your endpoint when creating your webhook (see the Webhook Object). 


Payload example

{
    "account": "my-store.evance.me",
    "event": "products/created",
    "eventId": 18946374,
    "createdOn": "2022-01-06T21:19:28+00:00",
    "apiVersion": "v2",
    "data": {
        ... excluded for brevity ...
    },
    "metadata": {
        "integration-key": "afacc52a-8513-11ec-a8a3-0242ac120002"
    }
}