# Step 3: Create a webhook

You create webhooks to receive integration messages from Digital River. Those messages are triggered by events in Digital River’s application. When triggered, the event messaging will update the Adobe Commerce (Magento) order status (see [Exhibit B](https://docs.digitalriver.com/adobe-commerce-extension/adobe-commerce-extension-2.4.0/appendix-1#exhibit-b-sequence-diagram) in the Appendix section). &#x20;

Create a webhook to receive notifications using the following steps:

* [Step 3a: Open your firewall to trusted Digital River IP addresses](#step-3a-open-your-firewall-to-trusted-digital-river-ip-addresses)
* [Step 3b: Create a webhook endpoint](#step-3b-create-a-webhook-endpoint)
* [Step 3c: Create webhooks](#step-3c-create-webhooks)

## Step 3a: Open your firewall to trusted Digital River IP addresses

To receive webhook notifications from Digital River, you will need to open your firewall to all the IP addresses listed in the [Digital River safelist](https://docs.digitalriver.com/digital-river-api/events-and-webhooks-1/webhooks/digital-river-safelist).

## Step 3b: Create a webhook endpoint

You can send webhook data as JSON in the POST request body. The POST request body contains the complete event details, and you can use it after parsing the JSON into an [Event ](https://www.digitalriver.com/docs/digital-river-api-reference/#tag/Events)object.

Your webhook endpoint URL should be the URL to your Magento installation + `drpay/receive` \
**Example**: `https://exmage.drgc.shop/drpay/receive`

## Step 3c: Create webhooks&#x20;

When creating webhooks, you need to add endpoints from the [Dashboard](https://dashboard.digitalriver.com/):

1. From the **Webhooks** page, click **Create Webhook**.
2. Toggle **Disabled** to **Enabled**.
3. If required, select the API version you want to associate with events from the **API Version** dropdown list. By default, the confidential key version is selected.
4. Enter the URL for the endpoint in the **Endpoint URL** field.
5. Select the check box next to each event you want to associate with the endpoint or select the **Events Selected** check box to select all events. At least one event type must be selected.
6. Scroll down and click **Save**.\
   &#x20;<img src="https://1668215840-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MNZuMZbk2cjWhdeZ51z%2F-MbBkZkS3tXYd6k4GXen%2F-MbBmYBjuJwTxVvlMxVL%2FCreateWebhook.png?alt=media&#x26;token=587a628a-c04e-4bfa-ae7d-dbec06b7f674" alt="" data-size="original"> \
   Webhooks must be created for the following events:
   * `order.accepted`
   * `order.complete`
   * `order.blocked`
   * `order.review_opened`
   * `order.invoice.created`
   * `order.credit_memo.created`
   * `refund.failed`
   * `order.charge.refund.complete`
   * `order.charge.refund.failed`
   * `refund.pending_information`


---

# 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://docs.digitalriver.com/adobe-commerce-extension/adobe-commerce-extension-2.4.0/configure-the-digital-river-extension/step-3-create-a-webhook.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.
