Verify Lemon Squeezy webhook signatures
Webhook routes should reject forged events before they touch billing state.
Open the free generatorRead the raw body
Compute the HMAC from the exact raw request bytes, not from a parsed and reserialized JSON object.
Compare signatures safely
Use a timing-safe compare in server runtimes where it is available, and reject missing or malformed signatures.
Test failure paths
Keep fixtures for valid, invalid, missing, and stale webhook signatures so CI catches accidental verification bypasses.
FAQ
Which algorithm is used?
Lemon Squeezy webhook signing uses HMAC SHA-256.
Where should verification happen?
At the first line of your webhook route, before parsing business-specific event fields.
Use the free sample before wiring production checkout
Download a public sample pack with fake Lemon Squeezy fixtures, signature tests, contract checks, duplicate replay tests, and CI skeletons. The Pro Kit preview shows the full paid package structure without exposing the private archive.