Overview

You can use Webhooks to subscribe to near real-time updates from Violet.

We use the phrase near real time to describe the fact that under normal conditions, a violet webhook will be generated within seconds of an update within an ecom platform. However, this is not guaranteed; Shopify for example says they can take up to 10 minutes to send us the update webhook. Then on top of that, depending on our own system load, we can take a number of minutes to process it on our side before ending with sending out our own webhook to you. So while normally you will see updates coming through fairly quickly there are definitely known scenarios where it can take 10-15 minutes before the webhook ends up going out. Please note that is not a hard upper bound, just and example of how long it could take when our systems are under load.

Therefore, Violet webhooks are not strictly real time, and instead have a small but variable time delay between an update in an e-commerce platform and the webhook delivery to your servers.

See our API Reference for a full description of each of the below calls.

Creating Webhooks

Webhooks can be created through the REST API by performing the following request.

Curl
curl -X POST https://sandbox-api.violet.io/v1/events/webhooks \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json" \
-d '{"event": "ORDER_SHIPPED", "remote_endpoint": "https://example.com/events/order_shipped"}'

Retrieving a List of Webhooks

A list of your apps existing webhooks can be obtained through the REST API by performing the following request.

Curl
curl GET https://sandbox-api.violet.io/v1/events/webhooks \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json"

Retrieve a Single Webhook

A single webhook that belongs to your app can be obtained through the REST API by performing the following request.

Curl
curl GET https://sandbox-api.violet.io/v1/events/webhooks/{webhook_id} \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json"

Modifying Webhooks

Webhooks can be modified through the REST API by performing the following request.

Curl
curl -X PUT https://sandbox-api.violet.io/v1/events/webhooks/{webhook_id} \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json" \
-d '{"event": "ORDER_SHIPPED", "remote_endpoint": "https://example.com/events/order_shipped", "status": "ACTIVE"}'

Updating All Webhooks Status

Webhooks Status can be modified through the REST API by performing the following request.

Curl
curl -X PUT https://sandbox-api.violet.io/v1/events/webhooks/status/{status} \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json"

Removing Webhooks

Webhooks can be removed through the REST API by performing the following request.

Curl
curl -X DELETE https://sandbox-api.violet.io/v1/events/webhooks/{webhook_id} \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json"