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"