Integrate with OrderCloud
You can use the built-in integration between Sitecore Search and OrderCloud to easily send data into Search, after the data is in OrderCloud. The built-in integration automatically sets up the infrastructure to sync data, such as product or category data, store data for multilocation retailers, and any other entity. To use the integration, you must first set up your domain and then trigger the product sync.
This ensures that OrderCloud product visibility and pricing rules are applied in the search experience delivered by Search.
You can use the integration for full syncs and incremental syncs. If you choose incremental syncs then only updated products are synced, instead of the full catalog.
Even though the out-of-the-box product sync and proxy offered by OrderCloud handles most commerce use cases, hosting your own processor is recommended for more complex scenarios. For instance, if you have requirements around multilevel (store or group) search experiences, you might want to use a custom processor.
This walkthrough describes how to:
-
Ensure you have access to OrderCloud with the Marketplace Admin role and the ProductSyncConfigAdmin and DeliveryConfigAdmin permissions.
-
Ensure you have access to Sitecore Search with the TechAdmin role. For the OrderCloud sync to work, you must have the product entity and its attributes on Search.
Select an attribute template
To set up your search domain, select an attribute template and then define a source for the OrderCloud sync target. Use the API Push connector to enable OrderCloud to send the incremental updates to Sitecore Search.
To select an attribute template:
-
In Sitecore Search, on the main menu, click Administration > Domain Settings.
-
On the General Settings tab, click Entities > Edit.
NoteIf you don't see Entities on the General Settings tab, your domain is not enabled for multiple entities.
-
Click the entity you want to sync, such as Product.
-
In the Attribute Template drop-down menu, select a template to map attributes that match the OrderCloud data model.
-
For product entities, select the Order Cloud Product Spec 2 template.
-
For any other entity, select the Base Attribute Template.
-
-
If you’re using OrderCloud’s extended properties to add business specific properties to the OrderCloud data model, add those as attributes in Sitecore Search.
-
Create a source of type API Push.
-
Click Save.
(Optional) Define new attributes for OrderCloud XP properties
If you want to return XP properties in the API response of a synced OrderCloud entity or use them for filtering, faceting, rules, and additional search experiences, you must set up those XP properties as attributes in Sitecore Search.
To set up new attributes for your XP properties:
-
On the menu bar, click Administration > Domain Settings > Attributes.
-
In the Entity drop-down menu, select Product.
-
Click Add Attribute and type the attribute name using lowercase letters with an underscore representing nesting.
For instance, an attribute called
xp.Brand
in OrderCloud must be namedxp_brand
in Sitecore Search. -
To show product thumbnails in Sitecore Search, create an XP property in OrderCloud called
xp.ThumbnailImageUrl
.
Create an OrderCloud Delivery Configuration
Now that you have set up your domain by selecting an attribute template and creating a source, you must create an OrderCloud delivery configuration.
To create a delivery configuration:
-
Log in to OrderCloud and click API Console.
-
In the main menu, in the Integrations section, click Delivery Configurations.
-
In the drop-down menu at the top, select the
POST
operation to create a new delivery configuration. -
Select the Enabled check box.
-
In the Search Ingestion section, fill in the following fields:
-
Domain - your Search domain ID.
-
Source - your Search source ID.
-
Endpoint - your Search source endpoint URL.
-
Entity - enter product.
-
API Key - your Search source API key.
Note-
To find the domain ID, on the menu bar, click Home and then hover over your domain name.
-
To find the source ID, endpoint URL, and API Key, on the menu bar, click Sources, and then click a source. On the Source Settings page, click Source Information.
-
-
Click Send.
-
In the main menu, in the Integrations section, click Product Synchronization.
-
In the drop-down menu at the top, select the
PUT
operation to create or update a product sync. -
In the Request Body, select the Sync Product Changed check box to sync products when they’re created or updated, and select the Sync Product Deleted check box to sync products when they're deleted.
-
In the Delivery Config ID, enter the ID and click Send.
Repeat this process for other Sitecore Search entities (such as categories, stores/suppliers, or inventory). Use the Entity Synchronization endpoint to create these respectively.
Trigger the product sync
After setting up the connection in OrderCloud, you're ready to trigger the sync from OrderCloud into Sitecore Search.
Before performing a full sync on either a catalog or a category, we recommend that you perform an incremental sync on a single product to confirm if your setup is correct. You can do this by running a PATCH
query to update the product with a new value and then executing the incremental sync.
To trigger the sync:
-
In OrderCloud, click Self-service > Sync tools.
NoteIf you’re using the OrderCloud Portal, go to Marketplaces > Product sync.
-
To sync the entire catalog, in the Catalog ID field, enter the ID.
Alternatively, to sync only one category, in the Catalog ID field, enter the ID, and in the Category ID field, enter the ID.
-
Select the I’m not a robot check box.
-
Click Submit.
-
In Sitecore Search, on the main menu, click Content Collection.
-
Click the synced entity, for example, Product. The page lists the products from OrderCloud.
NoteIf you selected the Sync Product Changed and/or Sync Product Deleted options, any time products are created, changed, or deleted in OrderCloud, those changes sync to Search.
In Sitecore Search, when you click Sources, you can now see an exclamation mark next to a source indicating that it’s queued for indexing. Indexing might take some time to complete, depending on the size of the source.
You can also go to Analytics > Sources > Overview, to view detailed information for all sources on a range of metrics. To view details of a specific source, select it from the list of sources. This gives you information about the source, the summary of its last run, and the number of jobs run. To view details of a specific job, select it from the graph or Job Run List.
(Optional) Set up the Search proxy
With the Sitecore Search proxy, you can get accurate product visibility and pricing from OrderCloud. It also lets you sync multi-locale and non-OrderCloud attributes stored in another system that's required by Search. This is an optional step. You don't need the proxy to sync data from OrderCloud. Use it only if you have a complex marketplace with multiple prices for each product and/or limited product visibility.
To set up the proxy:
-
In OrderCloud, in the top-right corner, in the drop-down menu with your Marketplace name, make a note of the OrderCloud Region and Marketplace ID.
-
In Search, on the menu bar, click Sources, and then click a source. On the Source Settings page, click Source Information and make a note of the Search Ingestion API URL.
-
Log a support case with this information.
Return accurate products and pricing using the proxy
The payload submitted to the proxy endpoint from a buyer front end is identical to that in Search, except for an additional ordercloud
section as shown in the following. By appending the visibility rules of the current user to the given filters and applying the proper pricing, this proxy lets you take advantage of all the features available in Search.
{
"context": {
"page": {
"uri": "/"
},
"user": {
"uuid": "173929009-e4-05-47-1p-boo1kknmlw-1708358871002"
}
},
"ordercloud": {
"sellerId": "12345",
"requiredInventoryLocations": [
"*-0044"
] },
"widget": {
"items": [
{
"rfk_id": "rfkid_6",
"search": {
"content": {},
"suggestion": [
{
"name": "auto_suggester",
"max": 6
}
],
"limit": 6
},
"entity": "product"
}
]
}
}
To call the proxy, you need a bearer token. You can retrieve this by calling OrderCloud’s oauth/userinfo
endpoint with a valid OrderCloud user token. This returns a bearer token containing all the user’s contextual information that you can use to call the proxy.
Proxy endpoint format: https://uswest-integrations.ordercloud.io/api/v1/search/{domain}
Region specific endpoints:
-
US West -
https://uswest-integrations.ordercloud.io/
-
Europe West -
https://westeurope-integrations.ordercloud.io/
-
US East -
https://useast-integrations.ordercloud.io/
-
Japan East -
https://japaneast-integrations.ordercloud.io/
-
Australia East -
https://australiaeast-integrations.ordercloud.io/
If you only need to ensure that you're showing the correct products and prices to the correct buyers, this integration does this for you using the proxy method. If you have additional use cases, such as sorting by price or custom rules around product inventory (for example, bury or boost), then you’ll also need to use the multistore/multigroup functionality in Sitecore Search.