Configure Webhooks

Important

Some or all of this functionality is available as part of a preview release. The content and the functionality are subject to change.

Webhooks need to be configured for seven specific entities: UserGroups, Categories, Users,UserGroupAssignments,Addresses,AddressAssignment,Catalogs. This article walks you through the steps to configure and activate the webhooks for the Sitecore OrderCloud connector.

Step 1. Configure Webhooks on the OrderCloud portal

This step requires specifying the source for each webhook to ensure proper configuration.

  1. Go to OrderCloud Portal > API Console > Delivery Configurations > POST integrations/deliveryconfig. Fill name as WebhooksDeliveryConfig, mark enabled.

  2. Scroll down and find Event Hub. Fill name and connection string from the Eventstream OrderCloud source. Select Send. Note the Delivery Config ID.

  3. Go to Webhooks, select the lightening bolt in the top left corner and switch to Classic view.

  4. For each of the seven entities, you need to create a webhook each. For each webhook, select POST webhook endpoint and fill the name.

  5. Replace with the JSON given in the JSON for webhooks for each webhook.

  6. Fill the correct API Client ID and Delivery Config ID.

Step 2. Configure Webhooks on the connector

This step requires specifying the destination for each webhook to ensure proper configuration.

  1. Go to your Webhooks Eventstream resource.

  2. Create a new Custom App source called OrderCloud.

  3. Create a new destination each for the seven entities.

  4. Select Lakehouse as new destination.

  5. In the Destination name and Delta table fields, enter the entity name (Categories, as example).

  6. Enter the created Bronze Lakehouse name and the associated workspace name.

    The image shows settings on Eventstream webhooks.

  7. Repeat these steps for the other six entities.

  8. After creating all of the seven destinations, select Deactivate all.

Step 3. Activate the configured Webhooks

After the source and destination for the webhooks are configured, you'll need to activate them so that the Webhooks are triggered with each data update. Now, to initiate the data flow, you should trigger the webhook. For example, you can create a new category on the source side and observe it being replicated on the destination side.

  1. Go back to Eventstream source.

  2. Select the relevant wave icon for a webhook on their area (Categories, for example) and arrange filters.

  3. Repeat the steps to trigger the other six webhooks. You can see the arranged entities in the Arranged Entities section.

  4. Select Activate all. Now the Eventstream resource syncs the new operations on arranged entities.

JSON for webhooks

AddressAssignmentsWebhook
{
  "Name": "AddressAssignmentsWebhook",
  "ApiClientIDs": ["<API_CLIENT_IDS>"],
  "WebhookRoutes": [
    {
	"Route": "v1/buyers/{buyerID}/addresses/{addressID}/assignments",
	"Verb": "DELETE"
    },
    {
	"Route": "v1/buyers/{buyerID}/addresses/assignments",
	"Verb": "POST"
    }
  ],
  "DeliveryConfigID": "<DELIVERY_CONFIG_FROM_EARLIER>"
}
AddressWebhook
{
  "Name": "AddressWebhook",
  "ApiClientIDs": ["<API_CLIENT_IDS>"],
  "WebhookRoutes": [
    {
					"Route": "v1/buyers/{buyerID}/addresses",
					"Verb": "POST"
				},
				{
					"Route": "v1/buyers/{buyerID}/addresses/{addressID}",
					"Verb": "DELETE"
				},
				{
					"Route": "v1/buyers/{buyerID}/addresses/{addressID}",
					"Verb": "PATCH"
				},
				{
					"Route": "v1/buyers/{buyerID}/addresses/{addressID}",
					"Verb": "PUT"
				}
  ],
  "DeliveryConfigID": "<DELIVERY_CONFIG_FROM_EARLIER>"
}
CatalogsWebhook
{
  "Name": "CatalogsWebhook",
  "ApiClientIDs": ["<API_CLIENT_IDS>"],
  "WebhookRoutes": [
    {
					"Route": "v1/catalogs",
					"Verb": "POST"
				},
				{
					"Route": "v1/catalogs/{catalogID}",
					"Verb": "DELETE"
				},
				{
					"Route": "v1/catalogs/{catalogID}",
					"Verb": "PATCH"
				},
				{
					"Route": "v1/catalogs/{catalogID}",
					"Verb": "PUT"
				}
  ],
  "DeliveryConfigID": "<DELIVERY_CONFIG_FROM_EARLIER>"
}
CategoriesWebhook
{
  "Name": "CategoriesWebhook",
  "ApiClientIDs": ["<API_CLIENT_IDS>"],
  "WebhookRoutes": [
    {
					"Route": "v1/catalogs/{catalogID}/categories",
					"Verb": "POST"
				},
				{
					"Route": "v1/catalogs/{catalogID}/categories/{categoryID}",
					"Verb": "DELETE"
				},
				{
					"Route": "v1/catalogs/{catalogID}/categories/{categoryID}",
					"Verb": "PATCH"
				},
				{
					"Route": "v1/catalogs/{catalogID}/categories/{categoryID}",
					"Verb": "PUT"
				}
  ],
  "DeliveryConfigID": "<DELIVERY_CONFIG_FROM_EARLIER>"
}
UserGroupAssignmentsWebhook
{
  "Name": "UserGroupAssignmentsWebhook",
  "ApiClientIDs": ["<API_CLIENT_IDS>"],
  "WebhookRoutes": [
    {
					"Route": "v1/buyers/{buyerID}/usergroups/{userGroupID}",
					"Verb": "PATCH"
				},
				{
					"Route": "v1/buyers/{buyerID}/usergroups/{userGroupID}",
					"Verb": "PUT"
				},
				{
					"Route": "v1/buyers/{buyerID}/usergroups/{userGroupID}/assignments/{userID}",
					"Verb": "DELETE"
				},
				{
					"Route": "v1/buyers/{buyerID}/usergroups/assignments",
					"Verb": "POST"
				}
  ],
  "DeliveryConfigID": "<DELIVERY_CONFIG_FROM_EARLIER>"
}
UserGroupsWebhook
{
  "Name": "UserGroupsWebhook",
  "ApiClientIDs": ["<API_CLIENT_IDS>"],
  "WebhookRoutes": [
    {
					"Route": "v1/buyers/{buyerID}/usergroups",
					"Verb": "POST"
				},
				{
					"Route": "v1/buyers/{buyerID}/usergroups/{userGroupID}",
					"Verb": "DELETE"
				},
				{
					"Route": "v1/buyers/{buyerID}/usergroups/{userGroupID}",
					"Verb": "PATCH"
				},
				{
					"Route": "v1/buyers/{buyerID}/usergroups/{userGroupID}",
					"Verb": "PUT"
				}
  ],
  "DeliveryConfigID": "<DELIVERY_CONFIG_FROM_EARLIER>"
}
UsersWebhook
{
  "Name": "UsersWebhook",
  "ApiClientIDs": ["<API_CLIENT_IDS>"],
  "WebhookRoutes": [
    {
					"Route": "v1/buyers/{buyerID}/users",
					"Verb": "POST"
				},
				{
					"Route": "v1/buyers/{buyerID}/users/{userID}",
					"Verb": "DELETE"
				},
				{
					"Route": "v1/buyers/{buyerID}/users/{userID}",
					"Verb": "PATCH"
				},
				{
					"Route": "v1/buyers/{buyerID}/users/{userID}",
					"Verb": "PUT"
				}
  ],
  "DeliveryConfigID": "<DELIVERY_CONFIG_FROM_EARLIER>"
}

Arranged Entities

UserGroups

The screenshot shows the User Groups webhook.

Categories

The screenshot shows the Categories webhook.

Users

The screenshot shows the Users webhook.

UserGroupAssignments

The screenshot shows the User Groups Assignment webhook.

Addresses

The screenshot shows the Addresses webhook.

AddressAssignment

The screenshot shows the Address Assignment webhook.

Catalogs

The screenshot shows the Catalogs webhook.

Important

For detailed support, contact the Microsoft Cloud for Retail team at mcfrcommunity@microsoft.com.