You can configure webhook endpoints via the API to be notified about events that happen in Smake.
You can create up to 10 webhooks per event.
#Available Events
Currently, these are all events you can listen to:
-
order.shipped
-
order.cancelled
-
shipping-rate.calculated
-
variant.designed
-
id-tag.updated
#List
GET /webhooks HTTP/1.1
{
"data": [
{
"id": 1,
"is_test": true,
"url": "https://requestb.in/xjggz4xj",
"event_types": [
{
"id": 1,
"name": "order.shipped"
}
]
},
{
"id": 2,
"is_test": true,
"url": "https://requestb.in/1hd29kc1",
"event_types": [
{
"id": 1,
"name": "order.shipped"
}
]
}
],
"links": {
"first": "https://api.smake.io/v2/webhooks?page=1",
"last": "https://api.smake.io/v2/webhooks?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"path": "https://api.smake.io/v2/webhooks",
"per_page": 25,
"to": 2,
}
}
#Get
GET /webhooks/1 HTTP/1.1
{
"id": 1,
"is_test": true,
"url": "https://requestb.in/xjggz4xj",
"event_types": [
{
"id": 1,
"name": "order.shipped"
}
]
}
#Create
#Attributes
Field |
Type |
Description |
Required |
url |
string |
The URL to listen for incoming POST notification containing event information. |
yes |
token |
string |
A token to secure your url |
|
event_types |
array |
An array of Event-Type Objects |
yes |
#Event-Type Object
Back to Attributes
Field |
Type |
Description |
Required |
name |
string |
name |
yes |
POST /webhooks HTTP/1.1
{
"url": "https://requestb.in/1hd29kc1",
"token": "my-secret-token",
"event_types": [
{
"name": "order.shipped"
}
]
}
{
"id": 2,
"is_test": true,
"url": "https://requestb.in/1hd29kc1",
"event_types": [
{
"id": 1,
"name": "order.shipped"
}
]
}
#Update
PUT /webhooks/1 HTTP/1.1
{
"url": "http://example.com"
}
{
"id": 1,
"is_test": true,
"url": "http://example.com",
"event_types": [
{
"id": 1,
"name": "order.shipped"
}
]
}
#Delete
DELETE /webhooks/1 HTTP/1.1