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

Request

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

Example

Request
Response
The following request fetches the event callback identified by the id "xYZkjABcde":
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/event_callbacks/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": "event_callbacks",
5
"links": {
6
"self": "https://yourdomain.commercelayer.io/api/event_callbacks/xYZkjABcde"
7
},
8
"attributes": {
9
"callback_url": "https://yourapp.com/webhooks",
10
"payload": {
11
"data": {
12
"attributes": {
13
"id": "PYWehaoXJj",
14
"type": "orders"
15
}
16
}
17
},
18
"response_code": "200",
19
"response_message": "OK",
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
"webhook": {
30
"links": {
31
"self": "https://yourdomain.commercelayer.io/api/event_callbacks/xYZkjABcde/relationships/webhook",
32
"related": "https://yourdomain.commercelayer.io/api/event_callbacks/xYZkjABcde/webhook"
33
}
34
}
35
},
36
"meta": {
37
"mode": "test"
38
}
39
}
40
}
Copied!
Last modified 2mo ago
Copy link