# Step 11: Set up webhooks

Digital River uses [webhooks](https://docs.digitalriver.com/digital-river-api/order-management/events-and-webhooks-1/events-1) to notify the app when events occur. The following instructions explain how to register a client webhook endpoint to set up webhook integration between Salesforce and Digital River

To register the Client Webhook Endpoint:

1. Log in to the [Digital River Dashboard](https://docs.digitalriver.com/digital-river-api/administration/dashboard).
2. Go to **Webhooks** and select **Create webhook**.\
   ![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/myvtQsqrbTDyg2U6ivMG/Create%20webhook.png)
3. Set up the **OAuth Integration** and select **OAuth** as the authentication method.\
   ![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/R5WtT3GoQ9w7wPWuUGJN/OAuth%20integration%202.png)
4. Complete the following fields:

| Field name     | Description                                                                                                                                                                                                        |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Token Endpoint | https\://<\<SF\_OAuth\_Access\_Token\_Endpoint>                                                                                                                                                                    |
| Endpoint URL   | https\://<\<SF\_My\_Domain\_Name>>/services/apexrest/digitalriverv3/webhooks/                                                                                                                                      |
| Client ID      | <p>Client Id (Consumer Key) of the Connected App "Salesforce DigitalRiver Integration"<br>which was created in the <a href="step-10-set-up-integration-between-salesforce-and-digital-river">previous step</a></p> |
| Client Secret  | Client Secret of the Connected App "Salesforce DigitalRiver Integration"                                                                                                                                           |
| Username       | Integration User's username                                                                                                                                                                                        |
| Password       | <\<IntegrationUserPassword>><\<IntegrationUserSecurityToken>>                                                                                                                                                      |

![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/eI7j4bhvw1kmC9ePMilI/OAuth%20integration%203.png)

![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/CHMd5heijqMXPrmmKxZw/OAuth%20integration%204.png)

{% hint style="info" %}
The **Token Endpoint** for the **Sandbox** environment is`https://test.salesforce.com/services/oauth2/token and https://login.salesforce.com/services/oauth2/token` for the **Production** environment.
{% endhint %}

{% hint style="info" %}
The **Endpoint URL** address named **MyDomain URL** should be `https://example-domain.my.salesforce.com` and not the Lightning Force URL `https://example-domain.lightning.force.com`
{% endhint %}

## Webhook event types

The Digital River Salesforce Lightning app supports the following out of the box (OOTB) webhook events:

* `order.accepted`
* `order.cancelled`
* `order.complete`
* `order.pending_payment`
* `order.review_opened`
* `order.blocked`
* `order.credit_memo.created`
* `order.invoice.created`

Ensure that all the supported Webhook events (Event types) that need to be sent to the configured Endpoint URL are selected (and saved) in the [Event types](https://docs.digitalriver.com/digital-river-api/order-management/events-and-webhooks-1/events-1) section located in the Digital River Dashboard's [webhook](https://docs.digitalriver.com/digital-river-api/order-management/events-and-webhooks-1/webhooks) section.

![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/asqI0I3UYaDiKWILTZQs/Webhook%205.png)

![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/40kSKMKa0rXnuRBTnxvs/Webhook%204.png)


---

# 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/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-11-set-up-webhooks.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.
