Webhooks
Please note that webhooks in Ecommerce API are deprecated. Please use the general webhooks API instead to create new webhooks.
Summary of webhook endpoints
- GET /admin/api/ecommerce/v1/webhooks - list all webhooks.
- POST /admin/api/ecommerce/v1/webhooks - create a new webhook.
- GET /admin/api/ecommerce/v1/webhooks/1 - list attributes of a webhook.
- PUT /admin/api/ecommerce/v1/webhooks/1 - update attributes of a webhook.
- DELETE /admin/api/ecommerce/v1/webhooks/1 - remove a webhook.
List all webhooks for the current site
Get list of webhooks.
GET /admin/api/ecommerce/v1/webhooks
Example response:
Status: 200 OK
[
{
"id": 1,
"enabled": true,
"target": "order",
"event": "create",
"url": "http://my.endpoint/order_created",
"created_at": "2020-04-15T15:48:05.000Z",
"updated_at": "2020-04-20T16:27:01.000Z"
}
]
Filter attributes
Read more about filters.
- Object
webhookattributes:id,enabled,target,event,url,created_at,updated_at.
List attributes of a webhook
GET /admin/api/ecommerce/v1/webhooks/1
Example request:
GET http://helloworld.voog.com/admin/api/ecommerce/v1/webhooks/1
Example response:
Status: 200 OK
{
"id": 1,
"enabled": true,
"target": "order",
"event": "create",
"url": "http://my.endpoint/order_created",
"created_at": "2020-04-15T15:48:05.000Z",
"updated_at": "2020-04-20T16:27:01.000Z"
}
Create a new webhook for the current site
POST /admin/api/ecommerce/v1/webhooks
Example data:
{
"target": "order",
"event": "create",
"url": "http://my.endpoint/order_created"
}
Example response:
Status: 201 Created
{
"id": 1,
"enabled": true,
"target": "order",
"event": "create",
"url": "http://my.endpoint/order_created",
"created_at": "2020-04-15T15:48:05.000Z",
"updated_at": "2020-04-20T16:27:01.000Z"
}
Parameters
enabled— Flag switching the webhook on or off,trueby default.target— Webhook target object, currently onlyorderis supported.event— Event triggering the webhook, one ofcreate,update,delete.url— A valid HTTP(S) endpoint.
Update attributes of a webhook
PUT /admin/api/ecommerce/v1/webhooks/1
This request updates the webhook with the provided attributes.
Example request:
PUT http://helloworld.voog.com/admin/api/ecommerce/v1/webhooks/1
Example data:
{
"target": "order",
"event": "create"
}
Example response:
Status: 200 OK
{
"id": 1,
"enabled": true,
"target": "order",
"event": "create",
"url": "http://my.endpoint/order_created",
"created_at": "2020-04-15T15:48:05.000Z",
"updated_at": "2020-04-20T16:27:01.000Z"
}
Parameters
enabled— Flag switching the webhook on or off,trueby default.target— Webhook target object, currently onlyorderis supported.event— Event triggering the webhook, one ofcreate,update,delete.url— A valid HTTP(S) endpoint.
Remove a webhook
DELETE /admin/api/ecommerce/v1/webhooks/1
This request deletes the given webhook.
Example request:
DELETE http://helloworld.voog.com/admin/api/ecommerce/v1/webhooks/1
Example response:
Status: 204 No Content