Configure webhooks to fire on events such as when a product is updated, an order is made, or a discount is deleted.

You can read more about webhooks here.

Go to Developer > Webhooks to create your first webhook.

Selecting events

You can choose one or multiple events to fire a webhook. See the full list of available webhook events here.

Define a callback URL

Your callback URL must be on the public internet and are typically something like:

https://mystore.com/chec/webhook

Verify the webhook with a signing key

Webhooks will have a signing key configured during setup. Webhook payloads that are sent to their configured endpoints will include a signature as part of the payload. This signature is an HMAC hash using SHA256 of the webhook payload without the signature, using the signing key that was provided during configuration of the webhook. You can verify the payload was provided by Chec (and not a third party) by confirming the signature matches your own HMAC of the payload. For example;

// Get the request body/payload and separate the signature
const { signature, ...payload } = JSON.parse(Buffer.concat(chunks));

// Verify the signature
const expectedSignature = crypto.createHmac('sha256', signingKey)
.update(JSON.stringify(payload))
.digest('hex');

if (expectedSignature !== signature) {
console.error('Signature mismatch');
}

View delivery history for specific webhooks

You may have multiple webhooks configured in your account. To view the delivery history of a specific webhook, click View Details.

You can now view the delivery history of that webhook specifically, send test requests and edit your webhook.

Did this answer your question?