Copy the snippets in order and you have a number that answers. Every guide ends with a working webhook handler.
The reference has every endpoint, the webhook guide has every event.