This deserves to be wider known, I think: Having been working on a project that involves Content Hub to OrderCloud connectivity recently, it turns out there's more than one way to achieve this. So if you're looking at work that needs this sort of connectivty, maybe this may be of interest to you?

The documented approach Copy link icon url copied!

If you go and look at the main Sitecore documentation for this sort of connectivity, then you'll be looking at the "Bidirectional Content Hub integration" feature.

This makes use of two key bits of technology:

  • It uses Content Hub triggers and actions to detect changes and send out data to external services.
  • It uses an API endpoint hosted by the OrderCloud product to receive these changes and update the commerce data.

The main advantages of this approach are:

  • Nothing extra to host. All of the technology involved lives on servers Sitecore run.
  • Very config driven. The documentation explains how it detects changes (so you can fine tune which ones it sees)
  • It's supported. You can raise support tickets against this if you need to.
  • As it says in the name, it's bi-directional. If you need data to go both ways this has you covered by default. (Though this does require extra setup to connect the Delivery Config in OrderCloud back to Content Hub)

But the downside of this is you have limited control.

If you want to avoid hosting anything yourself and the sync behaviour you need fits within the bounds of the config available, then this may be the right approach for you. But if you find it's not working for you, then you have very limited visibility of what's going on and why. You can raise support tickets, but from the outside basically all you can see is the audit log for the triggers in Content Hub - which often doesn't tell you enough.

I have seen scenarios where the trigger will fire, and the sync service will return a 200 "success" code but no data will change in your OrderCloud instance. When stuff like this happens your only choice is support, as there is no way to work out what happened from externally.

The less well known alternative Copy link icon url copied!

But (as I have found) it's not too difficult for requirements to stray out of the abilities of the "out of the box" approach. So what can you do if you need more flexibility? Well "just write your own code" is always an option. But I discovered recently via our project's 360 team that the Accelerate info for Content Hub includes some extra help here that's not mentioned in the main docs.

There is a source repository which provides Azure Function code for a sync tool that you can download and host yourself.

This does not use the "Triggers and Actions" approach - instead it is wire to the Edge Cache webhooks for Content Hub. Whenever content is published to the Edge it will trigger this code to update. That change of approach probably doesn't matter for most projects - but do think through the business logic of your scenario, as that means this approach might not be suited to a scenario where you have fields in Content Hub which don't go to the Edge Cache but do need to go to OrderCloud.

The key advantages of this approach are:

  • You now have all the flexibility you need. Want an obscure approach to how data gets mapped across to meet your odd business needs? Fine - you can write or modify the code to suit that need exactly.
  • You have much better visibility. Because you have the source, you can run this locally (via the Aspire framework) and that means you have the ability to debug it while it's in action. Or you can add more detailed trace and logging code to suite your needs for audit or visibility.

But it does mean you have to have a place to run Azure Function code in your deployment. You have to manage the hosting (and it's bill!) for this. So you put in a bit more effort with your infrastructure to get the flexibility.

What's not provided via this route, however is the mapping logic itself. This code doesn't take the config-based approach, so you have to modify the source to add in whatever mapping logic you need to get fields in Content Hub to the correct place in fields or XP in OrderCloud.

This approach also doesn't address the bi-directional sync need - it's just aimed at getting product data out of Content Hub and into OrderCloud. (Though since you have the source, you could always add that if you needed to) However it does also come with some other example code which can be used for Content Hub to Sitecore Search integration too. That might also be useful to have for some projects.

But it's very useful to know the flexibility is available if you need it...

↑ Back to top

Alternative approaches to Content Hub and OrderCloud integration