Webhooks

Getting Started

Webhooks can be enabled and modified through the API key section of the Skio dashboard. To setup a webhook, enter a URL that you would like SKio to send webhooks to and hit save.

This will then save the webhook and generate a token that can be used to verify webhook calls made.

Every webhook is a JSON payload with the following fields:

{
	"domain": string; // The domain of the shop.
	"subscriptionId": string; // The Skio subscription ID that this event affects.
	"eventType": string; // The type of event in this webhook (see below for a full list of event types).
	"eventData": json; // A JSON blob containing details about the event (see below for a full specification).
	"skioWebhookToken": string; // The webhook token from above.
}<br>

To ensure that you aren't receiving spoofed webhooks from a source that is not Skio, it is important to check that the token in the webhook matches the token in the console above for every webhook received.

Event Details

A full JSON schema specification of all possible events are below.
{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
        "AuditEventType": {
            "enum": [
                "Discount code applied",
                "Subscription activated",
                "Subscription cancelled",
                "Subscription interval/date update",
                "orderPlaced",
                "productsUpdated"
            ],
            "type": "string"
        },
        "SellingPlanInterval": {
            "description": "Represents valid selling plan interval.",
            "enum": [
                "DAY",
                "MONTH",
                "WEEK",
                "YEAR"
            ],
            "type": "string"
        },
        "UserType": {
            "enum": [
                "DashboardUser",
                "Skio",
                "StorefrontUser"
            ],
            "type": "string"
        }
    },
    "properties": {
        "domain": {
            "type": "string"
        },
        "eventData": {
            "anyOf": [
                {
                    "properties": {
                        "shopifyOrderId": {
                            "type": "string"
                        },
                        "shopifyOrderName": {
                            "type": "string"
                        },
                        "subscriptionId": {
                            "type": "string"
                        },
                        "timestamp": {
                            "type": "string"
                        },
                        "userCognitoUsername": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userEmail": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userType": {
                            "$ref": "#/definitions/UserType"
                        }
                    },
                    "type": "object"
                },
                {
                    "properties": {
                        "subscriptionId": {
                            "type": "string"
                        },
                        "timestamp": {
                            "type": "string"
                        },
                        "userCognitoUsername": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userEmail": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userType": {
                            "$ref": "#/definitions/UserType"
                        }
                    },
                    "type": "object"
                },
                {
                    "properties": {
                        "subscriptionId": {
                            "type": "string"
                        },
                        "timestamp": {
                            "type": "string"
                        },
                        "userCognitoUsername": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userEmail": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userType": {
                            "$ref": "#/definitions/UserType"
                        }
                    },
                    "type": "object"
                },
                {
                    "properties": {
                        "newProducts": {
                            "items": {
                                "properties": {
                                    "price": {
                                        "type": "number"
                                    },
                                    "productTitle": {
                                        "type": "string"
                                    },
                                    "productVariantId": {
                                        "type": "string"
                                    },
                                    "productVariantTitle": {
                                        "type": "string"
                                    },
                                    "quantity": {
                                        "type": "number"
                                    }
                                },
                                "type": "object"
                            },
                            "type": "array"
                        },
                        "oldProducts": {
                            "items": {
                                "properties": {
                                    "price": {
                                        "type": "number"
                                    },
                                    "productTitle": {
                                        "type": "string"
                                    },
                                    "productVariantId": {
                                        "type": "string"
                                    },
                                    "productVariantTitle": {
                                        "type": "string"
                                    },
                                    "quantity": {
                                        "type": "number"
                                    }
                                },
                                "type": "object"
                            },
                            "type": "array"
                        },
                        "subscriptionId": {
                            "type": "string"
                        },
                        "timestamp": {
                            "type": "string"
                        },
                        "userCognitoUsername": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userEmail": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userType": {
                            "$ref": "#/definitions/UserType"
                        }
                    },
                    "type": "object"
                },
                {
                    "properties": {
                        "newIntervalAndDate": {
                            "properties": {
                                "billingDate": {
                                    "type": "string"
                                },
                                "interval": {
                                    "$ref": "#/definitions/SellingPlanInterval"
                                },
                                "intervalCount": {
                                    "type": "number"
                                }
                            },
                            "type": "object"
                        },
                        "oldIntervalAndDate": {
                            "properties": {
                                "billingDate": {
                                    "type": "string"
                                },
                                "interval": {
                                    "$ref": "#/definitions/SellingPlanInterval"
                                },
                                "intervalCount": {
                                    "type": "number"
                                }
                            },
                            "type": "object"
                        },
                        "skipped": {
                            "type": "boolean"
                        },
                        "subscriptionId": {
                            "type": "string"
                        },
                        "timestamp": {
                            "type": "string"
                        },
                        "userEmail": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userType": {
                            "$ref": "#/definitions/UserType"
                        }
                    },
                    "type": "object"
                },
                {
                    "properties": {
                        "amount": {
                            "type": "number"
                        },
                        "codePlatformId": {
                            "type": "string"
                        },
                        "method": {
                            "enum": [
                                "FIXED_VALUE",
                                "PERCENTAGE"
                            ],
                            "type": "string"
                        },
                        "redeemCode": {
                            "type": "string"
                        },
                        "subscriptionId": {
                            "type": "string"
                        },
                        "timestamp": {
                            "type": "string"
                        },
                        "type": {
                            "anyOf": [
                                {
                                    "enum": [
                                        "CANCEL_DISCOUNT",
                                        "DISCOUNT_CODE",
                                        "FREE_SHIPPING",
                                        "GROUP_SUBSCRIPTION",
                                        "MANUAL_DISCOUNT",
                                        "PREPAID_DISCOUNT",
                                        "VOLUME_DISCOUNT"
                                    ],
                                    "type": "string"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "userCognitoUsername": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userEmail": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "userType": {
                            "$ref": "#/definitions/UserType"
                        }
                    },
                    "type": "object"
                }
            ]
        },
        "eventType": {
            "$ref": "#/definitions/AuditEventType"
        },
        "subscriptionId": {
            "type": "string"
        }
    },
    "type": "object"
}

<br>
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact us Contact us