Integrating CoreMedia Content Cloud with Commerce Layer: A simple process

Ferdinand Ragi

Ferdinand Ragi

CoreMedia has extensive experience in integrating with e-commerce systems, with many customers relying on our proven integration pattern, facilitated by the CoreMedia Commerce Hub. This Hub features prefabricated integration points that are ready to be utilized with our editorial backend, CoreMedia Studio, as well as our delivery engines—whether it's our GraphQL-based headless service or our headful content application engine.

Blended content and commerce experiences

Enhancing the content creator’s experience in creating blended content and commerce experiences is where CoreMedia excels. The CoreMedia Commerce Hub supports standard content-driven use cases out-of-the-box, including: 

  • Accessing products and SKUs (product variants) from within CoreMedia Studio 

  • Creating storytelling with embedded products 

  • Creating shoppable images (images with clickable hot zones) 

  • Creating shoppable videos (videos with an interactive timeline of products) 

  • Enriching product listing pages (PLPs) with content at fix positions 

  • Enriching product detail pages (PDPs) with inspirational content 

  • Personalizing content experiences based on e-Commerce segments  

  • Creating blended content and commerce mega menus 

And much more. 

With the Italian e-commerce vendor Commerce Layer disrupting the market, we saw a great opportunity to test our CoreMedia Commerce Hub integration pattern with them.

So, in this article, we want to demonstrate how easily the integration of a CoreMedia Commerce Hub Adapter for Commerce Layer can be created. The focus is on the developer experience.

Setting up Commerce Layer

If you already have an existing Commerce Layer organization with products in it, this chapter can be skipped. Otherwise, feel free to read through the getting started on Commerce Layer documentation: https://docs.commercelayer.io/core/readme/onboarding-tutorial. After the onboarding tutorial you are ready to go.

What needs to be considered is that you have a git repository for a complete demo-store to test with it (https://github.com/commercelayer/demo-store). Read through the README and start your local store.

Getting your IDE ready

First things first: authentication. Create an oauth method which connects you via API to the store. You need to know your client ID and your client secret. Obviously, the client secret shouldn’t be shared with third parties. Also, you need to connect it with the right domain. The properties should look like this:

To fetch the access token for your organization, it’s necessary to send a POST request to the /oauth/token endpoint.

Now you can manipulate the data and send it via API calls to CoreMedia’s endpoints.

It’s important to notice that there are different entities that you can GET from different endpoints. There are, for example, markets, SKUs, shipping categories, etc. Each one of them has relationships, attributes and a unique ID. For our CoreMedia Commerce Adapter we want to be able to list these relevant entities in the CoreMedia Studio library to allow content creators to embed them into content experiences.

The steps are:

1. Set up HTTP Request

2. GET Market-, Shipping Category-, SKU list

3. GET Relationships between these entities

4. Build a connector to CoreMedia’s Studio Server

5. Show the data in the Studio Client

Step 1:

Include the necessary headers in your request. This usually involves setting the authorization header with your API key and specifying the mime type as application/json.

Step 2:

Now, getting the data from Commerce Layer is easy. Using the API token, send a GET post to the right API endpoint. The GET post is generic and could be built with different bodies. For example, if you want to have all SKU lists available the body needs nothing more than the API endpoint. If a specific type is searched for the API needs also the unique ID of the type. It could look like this:

Step 3:

Commerce Layer always returns responses in a JSON format if the HTTP request is set up right. So, attributes and relationships are provided by the response. In this case, it’s easy to read out the relationships that are needed.

Step 4:

Building a connector to the CoreMedia Studio Server works fine over ports if it’s run on your local machine. Set up the “plugins.directories” property in the run configuration for Studio server to listen on the port, which you have configured in the spring properties in the commerce adapter.

Step 5:

Now let’s get to show the data in the Studio Client. After having defined your port, it’s necessary to adjust the “LiveContext” settings inside the studio-client. Select your previously configured port as the “Commerce Connector Endpoint”. Also, the vendor's name and the catalog Id needs to be set.

And that’s it! Now, you have connected Commerce Layer via the CoreMedia Commerce Hub. The great thing about our Commerce Hub is that once connected, it will provide product catalog access in CoreMedia Studio for content creators – as well as integration in our headless server based on GraphQL.

A few examples on how it looks like:

1. Homepage with an embedded product of the demo store of Commerce Layer: First the view in CoreMedia Studio and then the GraphQL view.

2. Shoppable image: The view in CoreMedia Studio and then the GraphQL view.

As you can see, it’s very simple to set up and configure the Commerce Layer specific topics – and due to the high degree of prefabrication in the generic CoreMedia Commerce Hub, you can quickly enjoy the benefits of all the use cases mentioned in the beginning of the article. Have fun!

Stage 1: Fragmented: Multiple Channels

You’re a digital dinosaur!

You have a beautiful website, but with fragmented digital experiences, you run the risk of extinction.

It’s time to evolve.

Your audiences want a seamless experience, no matter what's happening behind the scenes. When your experience is different or difficult, it’s important to start with the basics, such as cultivating a holistic approach to online digital experiences. Realign your teams, platforms, processes, goals, and metrics around a comprehensive view of the online experience. Focus on the end-to-end customer journey cutting across channels, desktop and mobile.

separate channels animation circle t-rex dinosaur square
Stage 2: Integrated: Multiple channels

You’re a fish!

Signs of exciting life are starting to form. Your DX is responsive and adaptive but it’s not quite personalized yet.

Keep swimming!

The integration of your brand content across every touchpoint (website, online store, social media, emails, apps, point of sale) creates immersive experiences. These flagship sites combine content-rich brand experiences with immediate conversion capabilities. Business teams and marketing are closely aligned. However, while the digital experience is responsive and adaptive, it’s not yet personalized.

Connect with an expert
Stage 3: Instant: Global expansion

You’re a crocodile!

You’re taking it global. Speed and scalability are key and just like a crocodile, you’re fast…but you’re clumsy.

Oh snap!

In this stage, the online digital experience becomes completely dynamic. You need content that is global, yet relevant, with plenty of local insights: Who is the user? Are they using a mobile phone? Is it raining where they are? Is it snowing? If it is, maybe they need warm, waterproof boots. All of this contextualized information creates a better user experience. With one global orchestration, you’re able to adapt everything, in whatever country or language you choose – while keeping turnaround times low. So keep evolving.

Connect with an expert
Stage 4: Dynamic: Real time personalization

You’re a lion!

You’re reaching more customers in more countries and languages than ever before, and now you’re finally hunting and collecting info with precision.

But you can do more to keep your brand roaring!

As you graduate to the Instant level, you’re able to rapidly update everything - not just in one language and for one country, but in 20 languages and for 100 countries. Speed and scalability are key, driven by the need to roll out global campaigns in all languages and all touchpoints and make updates in minutes or hours, not weeks. But there’s still more to do to reach nirvana.

Connect with an expert
Stage 5: Immersive: Elevated experiences

You’re Captain Content!

You’ve done it! You have opposable thumbs AND you’re saving the world with your seamless, elevated customer experiences.

You're a superhero in the digital space.

Your digital world and your physical world are blending together in the most complementary way possible. When shoppers visit your store, they’ll be greeted with their pre-selected products. Language changes dynamically depending on country of origin – it's like the whole store was set up just for your one specific customer.

In this final stage, your customer experience is truly immersive and superior, and your flagship store merges your physical and digital world into one, with a truly personalized individual experience.

Connect with an expert