Create a Webhook URL in Violet, selecting the ION integration when prompted to select an integration.
Copy and save the Webhook URL generated within Violet - THIS WILL ONLY DISPLAY ONCE.
In ION, navigate to the GraphQL query runner in the bottom-left corner of your ION environment:
In the ION query runner, run the following code to create a webhook receiver - replace the webhookUri with the one generated in Violet as shown in the Input block below.
Copy the Receiver ID of the Webhook receiver created by the above query.
In the ION query runner, run the query below to subscribe to all supported resource and action types, replacing the receiverId with the id of the receiver created above. If you want, you can subscribe to only some resource and action types by only running a subset of the queries.
Now, any changes and creations on the resources you’ve subscribed to will come into Violet proactively.
Known Limitations
Webhook events are not trigged when new Purchase Order Lines are created
Webhook events are not triggered in a way that Violet currently supports when property values transition from empty to populated. These properties will update correctly in Violet on the next scheduled fetch.
Certain properties, especially those linked to another ION object (for example, the shipping address on an ION Order, which references an ION location object) arrive in an unsupported format within the Webhook. In these cases, the object will update correctly in Violet on the next scheduled fetch.
For newly created objects in ION, some fields may not be fully populated in Violet until the next fetch.
# Create a receiver
mutation CreateWebhookReceiver($input: CreateWebhookReceiverInput!) {
createWebhookReceiver(input: $input) {
webhookReceiver {
id name description webhookUri sharedSecret contentType expectedResponseCode
active subscriptions { resource action id } headers { key value id }
}
}
}
# Input
{
"input": {
"name": "Violet",
"webhookUri": "Replace this with the url copied from Violet"
}
}