# Webhook signature (HMAC) – how to verify it – Sortyra

> A webhook signature (HMAC-SHA256) proves a message came from the real sender and was not changed on the way. How to verify the signature step by step.

Source: <https://sortyra.com/glossary/webhook-signature-hmac>

---

[Sortyra](https://sortyra.com/) [Glossary](https://sortyra.com/glossary) [U – X](https://sortyra.com/glossary/u-x)

# Webhook signature (HMAC)

Sortyra team · November 11, 2026 · 2 min read

[Glossary](https://sortyra.com/glossary)

[A – D](https://sortyra.com/glossary/a-d) [E – H](https://sortyra.com/glossary/e-h) [I – L](https://sortyra.com/glossary/i-l) [M – P](https://sortyra.com/glossary/m-p) [Q – T](https://sortyra.com/glossary/q-t) [U – X](https://sortyra.com/glossary/u-x)

- [Unmatched offer](https://sortyra.com/glossary/unmatched-offer-comparison-site)
- [URL](https://sortyra.com/glossary/what-is-a-url)
- [UTF-8 encoding](https://sortyra.com/glossary/utf-8-encoding-in-feed)
- [UTM parameters](https://sortyra.com/glossary/utm-parameters-in-links)
- [Value mapping table](https://sortyra.com/glossary/value-mapping-table-feed)
- [VAT in the feed](https://sortyra.com/glossary/vat-in-feed-price-and-rate)
- [Webhook](https://sortyra.com/glossary/what-is-a-webhook)
- [Wholesale](https://sortyra.com/glossary/wholesale-b2b-feed)
- [XLSX](https://sortyra.com/glossary/what-is-an-xlsx-file)
- [XML](https://sortyra.com/glossary/what-is-an-xml-file)
- [XML attribute](https://sortyra.com/glossary/xml-attribute-in-feed)
- [XML element](https://sortyra.com/glossary/xml-element)

Anyone who knows a webhook address can call it. An HMAC signature therefore adds a check code to every message, calculated from the message content and a secret key. The receiving system recalculates it and processes the message only if the codes match.

**In this article**

1. What is a webhook signature
2. Why a timestamp
3. How to verify the signature
4. What to watch out for
5. How Sortyra helps
6. Related terms
7. Frequently asked questions

## What is a webhook signature

A [webhook](https://sortyra.com/glossary/what-is-a-webhook) is a message one system sends to another when an event happens – for example a new order from a marketplace. So that the recipient knows the message is genuine, the sender **signs** it:

1. The sender and the recipient share a **secret signing key**.
2. From the message content and the key, the sender calculates an **HMAC** (_Hash-based Message Authentication Code_), most often with the **SHA-256** algorithm.
3. It sends the signature in a header together with the message.
4. The recipient calculates the signature again from the received message and its own key and compares it with the header.

If the signatures differ, someone has forged or altered the message – and it is not processed.

## Why a timestamp

A **timestamp** (the time of sending) is added to the signature. The string that is signed is "timestamp.body". This lets the recipient reject old messages that someone might have intercepted and sent again (a _replay attack_) – for example anything older than 5 minutes.

## How to verify the signature

Messages from Sortyra come with:

- the `x-sortyra-timestamp` header – the timestamp in seconds,
- the `x-sortyra-signature` header – the signature in the form `sha256=<hex>`.

How to verify:

1. Take the **raw body** of the message exactly as it arrived (before any JSON processing).
2. Join it into the string `timestamp.body`.
3. Calculate HMAC-SHA256 with the signing key and write the result in hexadecimal with the prefix `sha256=`.
4. Compare it with the header using a constant-time comparison function.
5. Check that the timestamp is not too old.

## What to watch out for

- **The key is secret.** Do not store it in public code or send it by email.
- **Sign the raw body.** If you parse the JSON and serialise it again, the order or whitespace changes and the signature will not match.
- **Use https only.**

## How Sortyra helps

Sortyra signs alert webhooks as well as marketplace orders sent to the **Shop URL for orders**. The signing key is shown only once, when it is created – pass it on to whoever manages your shop. See [Marketplaces: connection, offers, orders](https://sortyra.com/knowledge-base/marketplaces-connection-offers-orders) and [Alerts](https://sortyra.com/knowledge-base/feed-alerts-email-slack-telegram-webhook).

## Related terms

- [Webhook](https://sortyra.com/glossary/what-is-a-webhook)
- [API](https://sortyra.com/glossary/what-is-an-api)
- [JSON](https://sortyra.com/glossary/what-is-json-format)
- [Sandbox](https://sortyra.com/glossary/what-is-a-sandbox-test-environment)

## Frequently asked questions

### What if I lose the signing key?

The key is shown only once and we cannot show it again. For alert webhooks, add a new channel, which gets a new key; for marketplace orders, write to us via the [contact page](https://sortyra.com/contact).

### Isn't a secret webhook address enough?

No. The address can turn up in logs or in a browser. The signature verifies the content of every message and also protects it against tampering.

[← Previous article **Webhook**](https://sortyra.com/glossary/what-is-a-webhook) [Next article → **Wholesale**](https://sortyra.com/glossary/wholesale-b2b-feed)

## Try it on your own feed

[Try it free](https://app.sortyra.com/registracia?lang=en) [Book a 15-min call](https://sortyra.com/contact)
