# Webhook Configuration

### What is a webhook?

Webhooks allow Stripe to send notifications to your website when certain events occur. For example, if a payment is refunded in Stripe, Stripe can automatically send a notification to your webhook to let your website know.

### How to setup a webhook?

To get the endpoint URL, go back to the **Setting** tab in your WordPress dashboard and you should see a field labeled `Webhook URL`. Copy the URL or click the copy icon.

<figure><img src="https://woo-docs.payaddons.com/~gitbook/image?url=https%3A%2F%2F2515576520-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG0PUsYuzKts2zzoPrZBP%252Fuploads%252FkmhVCc1oUvMVDF7Ha9iD%252Fimage.png%3Falt%3Dmedia%26token%3Dff23ed0a-16d7-4d7d-b647-529e40a342c6&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=43ef28bd&#x26;sv=1" alt=""><figcaption></figcaption></figure>

Paste the endpoint URL into the dialog box in your Stripe dashboard.

1. Open the [Webhooks](https://dashboard.stripe.com/webhooks) tab in Workbench.
2. Click **Create an event destination**.
3. Select the Your account tab.

<figure><img src="/files/NOcN4hMKazrr3FmVCn4h" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/k99EktqVnKFEAe9qUgZa" alt=""><figcaption></figcaption></figure>

Add the below events to listener

```
checkout.session.completed
checkout.session.async_payment_succeeded
checkout.session.async_payment_failed
checkout.session.expired
payment_intent.payment_failed
payment_intent.succeeded
payment_intent.amount_capturable_updated
payment_intent.requires_action
invoice.payment_succeeded
invoice.payment_failed

```

<figure><img src="/files/81CsrRDnNeh0o8WmC7vP" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/AE2RW2IiHlEMZgPOPfqj" alt=""><figcaption></figcaption></figure>

### Enable Webhook signatures (Strongly recommended)

Generating a signature for the webhook can greatly protect your endpoint from being abused by external parties.

In your Stripe dashboard, go to the webhook settings and click the `Signing secret` button to generate a signature.

<figure><img src="https://woo-docs.payaddons.com/~gitbook/image?url=https%3A%2F%2F2515576520-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG0PUsYuzKts2zzoPrZBP%252Fuploads%252FuQTWqINKNiCJjK1aIVzC%252Fimage.png%3Falt%3Dmedia%26token%3Defc177e0-6b73-450f-b341-6eafb678275d&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=ce861b73&#x26;sv=1" alt=""><figcaption></figcaption></figure>

### Webhook Connection Test

First of all, let's do some payments with our plugin under test mode, then go to the webhook URL and find any events such as a payment\_intent.succeeded. Now click the `Resend` button to trigger the event again.

<figure><img src="https://woo-docs.payaddons.com/~gitbook/image?url=https%3A%2F%2F2515576520-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG0PUsYuzKts2zzoPrZBP%252Fuploads%252Fqj1chiUpXq8sTWZztset%252Fimage.png%3Falt%3Dmedia%26token%3D22809327-d30c-4dcd-af51-dd550e504a78&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=7a38ef13&#x26;sv=1" alt=""><figcaption></figcaption></figure>

If the response is 200 (OK), our plugin will process the event and display a connected status in the Webhook URL field.

<figure><img src="https://woo-docs.payaddons.com/~gitbook/image?url=https%3A%2F%2F2515576520-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FG0PUsYuzKts2zzoPrZBP%252Fuploads%252F3zJSivOdV2XamJZjlysH%252Fimage.png%3Falt%3Dmedia%26token%3D4b43bcf5-c092-482f-8e29-80213d88b4da&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=63b8a58a&#x26;sv=1" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cf7-docs.payaddons.com/getting-started/webhook-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
