Verify the signature before parsing or processing the JSON. JSON parsing and re-encoding can change whitespace or escaping and produce a different digest.
Signature verification proves the body was signed with your endpoint secret. It does not make delivery exactly once.Store the envelope id in a table with a unique constraint before applying side effects. If the same ID arrives again, return 2xx without repeating the work.