> 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

Learn how to 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="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FI35ebBeEEIlqvWBCr1UO%2FCreate%20webhook.png?alt=media&amp;token=ec489a1d-8c61-4c84-ac4d-ce6dca0b9989" alt="" data-size="original">&#x20;
3. Set up the **OAuth Integration** and select **OAuth** as the authentication method. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FrGW2wpcSXgubWRla4gJF%2FOAuth%20integration%202.png?alt=media&amp;token=73b84903-9413-4568-87ff-c9c70a0e4446" 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="/salesforce-lightning/salesforce-lightning-b2b-commerce-api-1.0.1/integrate-the-salesforce-lightning-app/step-10-set-up-integration-between-salesforce-and-digital-river.md">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="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FbK1FN1tVWfMTlLT2eYsw%2FOAuth%20integration%203.png?alt=media&amp;token=825259ef-2747-4635-9e87-aa333348cf6f" alt=""></div>

<div align="left"><img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F7J45VyW7hqcbU10QLr6P%2FOAuth%20integration%204.png?alt=media&amp;token=f706217d-40b7-4ed4-baae-11d0118e4174" 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="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FzMdNcevyVogS0F7Jl6CK%2FWebhook%205.png?alt=media&amp;token=927c7952-90b4-4821-81e3-17dcefe623c3" alt=""></div>

<div align="left"><img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F8gfA0dNbdlSLSqYmlhEJ%2FWebhook%204.png?alt=media&amp;token=416a449b-9ebe-430c-ac26-1b9393f9a3af" alt=""></div>
