Search…
API Reference
Resources
Retrieve a webhook
How to fetch a specific webhook via API
To fetch a single webhook, send a GET request to the /api/webhooks/:id endpoint, where id is the ID of the resource that you want to retrieve.

Request

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

Example

Request
Response
The following request fetches the webhook identified by the id "xYZkjABcde":
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/webhooks/xYZkjABcde' \
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 single resource object:
1
{
2
"data": {
3
"id": "xYZkjABcde",
4
"type": "webhooks",
5
"links": {
6
"self": "https://yourdomain.commercelayer.io/api/webhooks/xYZkjABcde"
7
},
8
"attributes": {
9
"name": "myorg-orders.place",
10
"topic": "orders.place",
11
"callback_url": "https://yourapp.com/webhooks",
12
"include_resources": [
13
"customer",
14
"shipping_address",
15
"billing_address"
16
],
17
"circuit_state": "closed",
18
"circuit_failure_count": 5,
19
"created_at": "2018-01-01T12:00:00.000Z",
20
"updated_at": "2018-01-01T12:00:00.000Z",
21
"reference": "ANY-EXTERNAL-REFEFERNCE",
22
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
23
"metadata": {
24
"foo": "bar"
25
}
26
},
27
"relationships": {
28
"last_event_callbacks": {
29
"links": {
30
"self": "https://yourdomain.commercelayer.io/api/webhooks/xYZkjABcde/relationships/last_event_callbacks",
31
"related": "https://yourdomain.commercelayer.io/api/webhooks/xYZkjABcde/last_event_callbacks"
32
}
33
}
34
},
35
"meta": {
36
"mode": "test"
37
}
38
}
39
}
Copied!
Last modified 2mo ago
Copy link