> For the complete documentation index, see [llms.txt](https://buycoins.youngest.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://buycoins.youngest.dev/webhook.md).

# Webhook

The webhook is generally responsible for verifying requests sent to your webhook URL. Requests sent from a source other than BuyCoins is regarded as malicious.

The webhook class is instantiated with three arguments:

* `body`: request body
* `token`: webhook token from BuyCoins account
* `header-signature`: request header signature defaulting to "X-Webhook-Signature"

### verify\_request()

This method, when called, verifies the legitimacy of the arguments passed when instantiating the class. The method returns a boolean:

* True: if the request originated from BuyCoins
* False: if the request didn't originate from BuyCoins

#### Example

```python
from buycoins import Webhook

request = Webhook(body=sample_body, token=token_from_buycoins)

isValid = print(request.verify_request())

print(isValid) # True or False
```

\
For a more detailed explanation of BuyCoins' webhook, refer to [BuyCoins' documentation](https://developers.buycoins.africa/webhooks/introduction).
