Webhooks (Admin)
To start receiving commerce service webhooks in your application, you must first create some webhook configuration inside your company.
Basically, that configurations defines what is the endpoint that commerce service should call when some event happens and it defines also the signature key that the endpoint should use to validate the request.
Service Methods
Creates a new Webhook Configuration inside a company
Rest API reference:
Creates a new company webhooks configuration
https://w3block.io/webhooks/test
5
Example: 5
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
POST /admin/companies/{companyId}/webhooks-configurations HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 64
{
"webhookUrl": "https://w3block.io/webhooks/test",
"maxRetries": 5
}
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"companyId": "123e4567-e89b-12d3-a456-426614174000",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"name": "text"
},
"webhookUrl": "https://mydomain.hook.me",
"signatureKey": "text",
"maxRetries": 5,
"disabled": false
}
Lists all webhook configurations from some company
Rest API reference:
Lists all company webhooks configurations
1
10
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
GET /admin/companies/{companyId}/webhooks-configurations HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
"items": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"companyId": "123e4567-e89b-12d3-a456-426614174000",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"name": "text"
},
"webhookUrl": "https://mydomain.hook.me",
"signatureKey": "text",
"maxRetries": 5,
"disabled": false
}
],
"meta": {
"itemCount": 1,
"totalItems": 1,
"itemsPerPage": 1,
"totalPages": 1,
"currentPage": 1
},
"links": {
"first": "http://example.com?page=1",
"prev": "http://example.com?page=1",
"next": "http://example.com?page=2",
"last": "http://example.com?page=3"
}
}
Gets some webhook configuration of a company by ID
Rest API reference:
Gets some company webhooks configuration
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
GET /admin/companies/{companyId}/webhooks-configurations/{configurationId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"companyId": "123e4567-e89b-12d3-a456-426614174000",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"name": "text"
},
"webhookUrl": "https://mydomain.hook.me",
"signatureKey": "text",
"maxRetries": 5,
"disabled": false
}
Updates some company webhook configuration
Rest API reference:
Updates some company webhooks configuration
https://w3block.io/webhooks/test
5
Example: 5
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
PATCH /admin/companies/{companyId}/webhooks-configurations/{configurationId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 64
{
"webhookUrl": "https://w3block.io/webhooks/test",
"maxRetries": 5
}
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"companyId": "123e4567-e89b-12d3-a456-426614174000",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"name": "text"
},
"webhookUrl": "https://mydomain.hook.me",
"signatureKey": "text",
"maxRetries": 5,
"disabled": false
}
Enables some disabled company webhook configuration
Rest API reference:
Enables some company webhooks configuration
No content
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
PATCH /admin/companies/{companyId}/webhooks-configurations/{configurationId}/enable HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
No content
Disabled some enabled company webhook configuration
Rest API reference:
Disables some company webhooks configuration
No content
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
PATCH /admin/companies/{companyId}/webhooks-configurations/{configurationId}/disable HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
No content
Lists all events sent by some webhook configuration
Rest API reference:
Lists all webhooks sent using some webhooks configuration of company
1
10
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
GET /admin/companies/{companyId}/webhooks-configurations/{configurationId}/webhooks HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
"items": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"companyId": "123e4567-e89b-12d3-a456-426614174000",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"name": "text"
},
"configurationId": "123e4567-e89b-12d3-a456-426614174000",
"configuration": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"companyId": "123e4567-e89b-12d3-a456-426614174000",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"name": "text"
},
"webhookUrl": "https://mydomain.hook.me",
"signatureKey": "text",
"maxRetries": 5,
"disabled": false
},
"status": "concluded",
"errors": 0,
"data": false,
"lastResult": null,
"usePatch": false,
"updateWithSystemHeaders": false,
"addCreatedAtToBody": false
}
],
"meta": {
"itemCount": 1,
"totalItems": 1,
"itemsPerPage": 1,
"totalPages": 1,
"currentPage": 1
},
"links": {
"first": "http://example.com?page=1",
"prev": "http://example.com?page=1",
"next": "http://example.com?page=2",
"last": "http://example.com?page=3"
}
}
Gets some webhook event sent by some webhook configuration by ID
Rest API reference:
Gets some company webhooks configuration sent webhook
User doesn't have any of the expected roles: administrator, admin, superAdmin, integration
GET /admin/companies/{companyId}/webhooks-configurations/{configurationId}/webhooks/{webhookId} HTTP/1.1
Host: commerce.w3block.io
Authorization: Bearer JWT
Accept: */*
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"companyId": "123e4567-e89b-12d3-a456-426614174000",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"name": "text"
},
"configurationId": "123e4567-e89b-12d3-a456-426614174000",
"configuration": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"companyId": "123e4567-e89b-12d3-a456-426614174000",
"company": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"name": "text"
},
"webhookUrl": "https://mydomain.hook.me",
"signatureKey": "text",
"maxRetries": 5,
"disabled": false
},
"status": "concluded",
"errors": 0,
"data": false,
"lastResult": null,
"usePatch": false,
"updateWithSystemHeaders": false,
"addCreatedAtToBody": false
}
Last updated