Skip to main content
Skip to Content
Cresora Commerce
Security

Webhook Identity Verification

How to verify that webhook deliveries genuinely come from Cresora.

Every webhook delivery from Cresora includes an HMAC-SHA256 signature. Verifying this signature confirms the delivery is from Cresora and hasn't been tampered with.

Why this matters

Without signature verification, any party who knows your webhook endpoint URL could send fake events and trigger unintended actions (e.g., fake transaction.captured events to trigger order fulfillment).

Verification steps

  1. Read the X-Cresora-Signature header: v1=<hex>
  2. Read the X-Cresora-Timestamp header: Unix timestamp
  3. Reject if timestamp > 5 minutes old (prevents replay attacks)
  4. Build the signing payload: <timestamp>.<raw_body>
  5. Compute the HMAC-SHA256 of that payload, keyed with your signing_secret, as lowercase hex
  6. Compare it to the hex after the v1= prefix of X-Cresora-Signature, using constant-time comparison

See Signature Verification → for complete code examples in Node.js and Python.

The signing secret

Your endpoint's signing secret is generated when you register the endpoint. It is:

  • Unique per endpoint (different endpoints have different secrets)
  • Displayed only once — save it to your secrets manager immediately
  • Rotatable in the Partner Portal or through the API. Rotation generates the new secret and Cresora starts signing with it at once, though deliveries signed with the old secret can still arrive for up to about 5 minutes. Read Rotating your signing secret before you rotate, especially if the old secret may be exposed

Source IP allowlisting (optional)

For defense-in-depth, you can allowlist Cresora's webhook source IP ranges. Contact your Cresora account manager for the current IP list.

⚠Warning

IP allowlisting alone is not sufficient — always verify the signature. IP addresses can be spoofed. The signature is the authoritative proof of identity.

Handling signature failures

If signature verification fails:

  1. Log the failure with the raw headers (not the body — it may be malicious)
  2. Return 500, not 400 or 401. A 500 is retried, but Cresora never retries a 400 or 401 automatically and raises no notification for them, so a genuine delivery you could not verify (during a secret rotation, for example) would wait for you to redeliver it by hand (see Retry handling)
  3. Do not process the event
  4. Alert your security team if failures persist — it may indicate an active attack