This document will explain Contentful integration with SAP Hybris which includes implementation of Mulesoft as a Middleware for routing and transforming messages.
The behaviour of this implementation will work as an application where content writers can insert some content for products and categories in Contentful which will be pushed to SAP Hybris passing through Mulesoft.
The diagram below shows exactly how this integration will work:
There’s some explanation for the flow of integration defined below:
There are a couple of steps to prepare systems before integration:
1. Contentful
Let’s suppose there are 3 fields in a content model named Category which should look like the image below;
2. SAP Hybris Commerce
3. Mulesoft
1. HTTP Listener
– This will behave as the entry point of the flow and will be used to receive payload from Contentful webhook
2. HTTP Request
– This will be used to request and receive full payload for the particular category including its supercategories from Contentful
3. Transform
– This will be used to transform Contentful payload to Hybris payload
4. HTTP Request
– This will be used to send data to SAP Hybris Commerce
Integrate Systems
1. Configure Settings in Contentful Application for Integration
Note :
2. Configure Settings in Mule Application for Integration
Now we’ll configure connectors in Mulesoft Application which were created in “Prepare Systems” section
1. HTTP Listener
– Define method as POST
– Define path as /category
2. HTTP Request
– Define method as GET
– Define URL as:
https://cdn.contentful.com/spaces//entries/?access_token=&content_type=category&include=1&fields.categoryCode=payload.fields.categoryCode."en-US"
– Define Request body as payload
3. Transform
– Transform Contentful payload to Hybris payload
4. HTTP Request
– Define method as PUT
– Define URL as
https://{host}/ws410/rest/catalogs//catalogversions//categories/payload.code
Mule flow should look like this
Once done with the steps defined above, add any entry for the category content type in Contentful, then publish it, and go to Hybris Backoffice to verify the category.
As this integration works perfectly fine for product and category models for SAP Hybris, using Mulesoft was an idea not to make any basic customisations in Hybris; however, it can be achieved using Contentful API libraries like CMA and CDA by customising Hybris Service layers and CronJobs. This Integration can be enhanced to make it work for assets integration, for which there might be some customisation required in Hybris to import external media.