# Webhooks

Discord and JSON webhooks allow you to receive notifications for events happening on your PayNow store. This can be useful for various things, like keeping track of activity.

{% hint style="info" %}
*If you wish to use JSON webhooks, please read our documentation on webhooks* [*here*](https://docs.paynow.gg/api/webhook-introduction)
{% endhint %}

### How do I create a Discord webhook and connect it to my PayNow store?

1. Visit the [Webhooks](https://dashboard.paynow.gg/webhooks) page located on your dashboard sidebar

<figure><img src="https://2548055575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEfAasB0XXVFpgzmjUh8U%2Fuploads%2FINmv5jfd9f90JpklRwjc%2Ff416a29ad7fe70d49b0efff055f76931.png?alt=media&#x26;token=c75c1c13-97b2-4926-b517-0cef4e487329" alt=""><figcaption></figcaption></figure>

2. Press the "New webhook" button on the top right

<figure><img src="https://2548055575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEfAasB0XXVFpgzmjUh8U%2Fuploads%2FTJ5wBij3OcNpa7ICSjSx%2F4d5b49f4de0be3746c372e78b030240d.png?alt=media&#x26;token=02feebe6-919e-4efe-b80b-4a4f5e13428f" alt=""><figcaption></figcaption></figure>

3. Select the type of webhook you wish to use, either Discord or JSON. If you use a Discord URL it will autofill to the Discord option

<figure><img src="https://2548055575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEfAasB0XXVFpgzmjUh8U%2Fuploads%2FEXP84X57m37c7iVdPVOI%2F6d420d041381b05dcf19855c1bbc2b50.png?alt=media&#x26;token=3e40b4d4-3325-4bc0-8336-7d6b4d691b20" alt=""><figcaption></figcaption></figure>

4. If you choose to use Discord, on the endpoint URL simply put the Discord webhook URL you get after creating a webhook in your Discord. If you don't know how to create a Discord webhook, follow this [guide](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks)
5. For Discord webhooks it's best to create one webhook entry per event if you wish to show Completed Orders, Refunds & Chargeback embeds. To do this let's start with the `Order Completed` event. Subscribe to the `Order Completed` event inside the `Subscribed To` field

<figure><img src="https://2548055575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEfAasB0XXVFpgzmjUh8U%2Fuploads%2FZnPwHUF6O3sw1zJOckRK%2Fbe2b9a37520c016cd6a655381a5a2861.png?alt=media&#x26;token=e0aa2625-4634-462c-bb11-9ccfa7dac593" alt=""><figcaption></figcaption></figure>

6. Next you can edit the embed as you wish. All available variables for each event can be found by hovering over `Discord Embed Template` or by looking at [this page](https://guides.paynow.gg/integration/webhooks/discord-placeholders).  Once you have the embed you wish you press update. This will make the event all set up for an `Order Completed` event. See the image below for a completed setup of the `Order Completed` event with some example variables.&#x20;

<figure><img src="https://2548055575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEfAasB0XXVFpgzmjUh8U%2Fuploads%2FS0dSr2pSJSuYNpxErj6S%2F6024a4e3a0c572cd1a3b221c6819a4bc.png?alt=media&#x26;token=92291b2a-b5b8-4c6d-8632-51a0160d3b2f" alt=""><figcaption></figcaption></figure>

7. Now the event is fully set up for the `Order Completed` event. To set up other events, like Refunds, Chargebacks, or Subscriptions, repeat steps 2-6 for each one. Make sure to adjust the variables for each event, as they may differ.
