Verify that the request came from the provider

Use the provider’s documented signature method. Verify the signature over the exact request body and protect the signing secret. Do not trust a source IP address as the only proof.

Compare timestamps when the provider includes them. Reject messages outside an agreed time window and protect against replayed requests.

Expect retries and duplicate events

Providers can retry delivery when a response is delayed. Store an event identifier and make processing safe to repeat. Return a response quickly, then handle longer work in a queue.

Set limits for body size and processing time. Reject malformed content before it reaches business logic.

Protect the endpoint and its logs

Use HTTPS and keep the signing secret out of source code. Rotate the secret through a documented process if it is exposed.

Log event identifiers and processing results without storing private payload data unnecessarily. Test invalid signatures, old timestamps and duplicate events.