Search…
API Reference
Resources
List all webhooks
How to fetch a collection of webhooks via API
To fetch a collection of webhooks, send a GET request to the /api/webhooks endpoint.

Request

GET https://yourdomain.commercelayer.io/api/webhooks

Example

Request
Response
The following request fetches a collection of webhooks:
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/webhooks/' \
3
-H 'Accept: application/vnd.api+json' \
4
-H 'Authorization: Bearer your-access-token'
Copied!
On success, the API responds with a 200 OK status code, returning a paginated collection of resource objects:
1
{
2
"data": [
3
{
4
"id": "xYZkjABcde",
5
"type": "webhooks",
6
"links": {
7
"self": "https://yourdomain.commercelayer.io/api/webhooks/xYZkjABcde"
8
},
9
"attributes": {
10
"name": "myorg-orders.place",
11
"topic": "orders.place",
12
"callback_url": "https://yourapp.com/webhooks",
13
"include_resources": [
14
"customer",
15
"shipping_address",
16
"billing_address"
17
],
18
"circuit_state": "closed",
19
"circuit_failure_count": 5,
20
"created_at": "2018-01-01T12:00:00.000Z",
21
"updated_at": "2018-01-01T12:00:00.000Z",
22
"reference": "ANY-EXTERNAL-REFEFERNCE",
23
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
24
"metadata": {
25
"foo": "bar"
26
}
27
},
28
"relationships": {
29
"last_event_callbacks": {
30
"links": {
31
"self": "https://yourdomain.commercelayer.io/api/webhooks/xYZkjABcde/relationships/last_event_callbacks",
32
"related": "https://yourdomain.commercelayer.io/api/webhooks/xYZkjABcde/last_event_callbacks"
33
}
34
}
35
},
36
"meta": {
37
"mode": "test"
38
}
39
},
40
{
41
"other": "... 9 webhooks (first page)"
42
}
43
],
44
"meta": {
45
"record_count": 140,
46
"page_count": 14
47
},
48
"links": {
49
"first": "https://yourdomain.commercelayer.io/api/webhooks?page[number]=1&page[size]=10",
50
"next": "https://yourdomain.commercelayer.io/api/webhooks?page[number]=2&page[size]=10",
51
"last": "https://yourdomain.commercelayer.io/api/webhooks?page[number]=14&page[size]=10"
52
}
53
}
Copied!

Sortable attributes

The list of webhooks can be sorted by the following attributes:
  • id
  • created_at
  • updated_at
  • reference
  • reference_origin
Last modified 2mo ago