Managing Webhooks

Creating Webhooks

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

curl -X POST https://sandbox-api.violet.io/v1/apps/{app_id}/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 GET https://sandbox-api.violet.io/v1/apps/{app_id}/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 GET https://sandbox-api.violet.io/v1/apps/{app_id}/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 -X PUT https://sandbox-api.violet.io/v1/apps/{app_id}/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 '{"remote_endpoint": "https://example.com/events/order_shipped"}'

Removing Webhooks

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

curl -X DELETE https://sandbox-api.violet.io/v1/apps/{app_id}/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"

📘

Dashboard Webhook Management

Webhook creation and management through the Violet dashboard is on our near term roadmap. We will notify all developers when this functionality becomes available.