Webhooks

You can configure webhook endpoints via the API to be notified about events that happen in Smake.


Available Events

There are currently four events you can listen to:

  • order.shipped
  • shipping-rate.calculated
  • variant.designed
  • id-tag.updated

List

{primary.fa-paper-plane} Request

GET /webhooks HTTP/1.1

{success} Response

HTTP/1.1 200 OK

{
    "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

{primary.fa-paper-plane} Request

GET /webhooks/1 HTTP/1.1

{success} Response

HTTP/1.1 200 OK

{
    "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

{primary.fa-paper-plane} Request

POST /webhooks HTTP/1.1

{
    "url": "https://requestb.in/1hd29kc1",
    "token": "my-secret-token",
    "event_types": [
        {
            "name": "order.shipped"
        }
    ]
}

{success} Response

HTTP/1.1 201 Created

{
    "id": 2,
    "is_test": true,
    "url": "https://requestb.in/1hd29kc1",
    "event_types": [
        {
            "id": 1,
            "name": "order.shipped"
        }
    ]
}

Update

{primary.fa-paper-plane} Request

PUT /webhooks/1 HTTP/1.1

{
    "url": "http://example.com"
}

{success} Response

HTTP/1.1 200 OK

{
    "id": 1,
    "is_test": true,
    "url": "http://example.com",
    "event_types": [
        {
            "id": 1,
            "name": "order.shipped"
        }
    ]
}

Delete

{primary.fa-paper-plane} Request

DELETE /webhooks/1 HTTP/1.1

{success} Response

HTTP/1.1 204 No Content