Webhook Payload Validation
Pronunciation: WEB-hook PAY-lohd val-ih-DAY-shun
Also known as: Webhook Schema Validation, Callback Payload Validation
Definition
Webhook payload validation checks that an incoming event has the expected authenticated origin, structure and allowed values before the receiving application acts on it.
Overview
What it means and why it exists
Webhook payload validation checks that an incoming event has the expected authenticated origin, structure and allowed values before the receiving application acts on it.
How it works
The handler first authenticates the raw request under the provider's signature scheme or other specified mechanism. It then parses the documented payload schema and validates required fields, identifiers, event types, value ranges and any expected relationship to local records. Unknown or incompatible versions are handled safely.
Technical details worth understanding
Cryptographic verification and schema validation solve different problems: a valid signature proves integrity and source under a secret, while schema validation guards against malformed or surprising data. Business validation additionally checks that the reported merchant, invoice, amount and asset correspond to a known record. Systems should log rejected events without exposing signing secrets.
What can go wrong
Trusting a JSON field that says paid without authenticating the source can enable fake order fulfillment. Permissive numeric parsing can turn a malformed amount into zero or an oversized value. Webhook bodies must not be deserialized into dangerous application objects without bounds and checks.
Practical checks
Verify raw-body signatures using the provider's exact method, then validate schema and merchant-specific identifiers. Apply bounded parsing and clear handling of unknown event versions. For a paid event, independently compare expected asset, invoice and amount; never let a signed event about someone else's order release your product.
Related concepts
Payment Status API, Webhook, API Key.
Further reading
Example
An attacker sends an unsigned POST containing status='paid' for an expensive order. The handler rejects it. A legitimate signed event for another merchant is also rejected for that local order because the invoice identifiers do not match.
Comparison
Signature verification establishes origin and integrity; schema validation establishes acceptable data shape; payment reconciliation establishes correspondence with the merchant's obligations. All three may be needed.
Key Takeaway
Cryptographic verification and schema validation solve different problems: a valid signature proves integrity and source under a secret, while schema validation guards against malformed or surprising data.
Sources
- OpenAPI Specification — OpenAPI Initiative (2026-08-03)
- JSON Schema Core Specification 2020-12 — JSON Schema (2026-08-03)
- JSON Schema Validation Specification 2020-12 — JSON Schema (2026-08-03)