> For the complete documentation index, see [llms.txt](https://docs.digitalriver.com/salesforce-lightning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-api-1.0.1/integrate-the-salesforce-lightning-app/step-11-set-up-webhooks.md).

# Step 11: Set up webhooks

Digital River uses [webhooks](https://docs.digitalriver.com/digital-river-api/order-management/events-and-webhooks-1/webhooks) to notify the app when events occur. &#x20;

### 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**.\
   &#x20;<img src="/files/DDnK5YqNxHz7iZSdBUge" alt="" data-size="original">&#x20;
3. Set up the **OAuth Integration** and select **OAuth** as the authentication method. \ <img src="/files/HCbTjJ1ATDChjnX4GEmd" alt="" data-size="original">&#x20;
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="/pages/5bYB0H4mjMlTVWJLfmtQ">previous step</a></p> |
| Client Secret  | Client Secret of the Connected App "Salesforce DigitalRiver Integration"                                                                                                        |
| Username       | Integration User's username                                                                                                                                                     |
| Password       | <\<IntegrationUserPassword>><\<IntegrationUserSecurityToken>>                                                                                                                   |

<div align="left"><img src="/files/cyI7I6Y77TIeqW98nw7U" alt=""></div>

<div align="left"><img src="/files/qMhLvoyg3y6fVRLIuOEO" alt=""></div>

{% 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.&#x20;
{% 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.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#event-types) section located in the Digital River [Dashboard's webhook section](https://docs.digitalriver.com/digital-river-api/administration/dashboard/developers/webhooks).

<div align="left"><img src="/files/2F1LPkfWCABjGojn2fOF" alt=""></div>

<div align="left"><img src="/files/WkhB4w5nZdS19nep8BKl" alt=""></div>
