1. Usage of the external Bridge API endpoints with the Connect for Commerce module

It is possible to access external API endpoints of the bridge via a service of the Connect for Commerce module.

This is done via the ServiceFactory, which calls the corresponding BridgeFsService via the getBridgeService method. This service uses the internal EcomBridgeAPI to provide methods for forwarding requests to the API endpoints of the bridge.

In the following script example, a content page is created in the shop system. Scripts can, for example, be executed via a schedule task or integrated into a workflow.

Script example for the creation of a content page in the shop system
import com.crownpeak.firstspirit.ecom.connect.module.ServiceFactory;
import com.crownpeak.firstspirit.ecom.connect.bridge.EcomElementDTO;

Map labels = new HashMap();
labels.put("en", "mynewpage");

Map paths = new HashMap();
paths.put("en", "/mynewpage");

EcomElementDTO data = new EcomElementDTO("content", false, "myNewPageUID", labels, paths);
String id = ServiceFactory.getBridgeService(context).createContent(data);

In general, the following methods are available for interacting with the API endpoints of the bridge.

Method Name Description

getCategories

Retrieves a list of categories from the shop system matching the specified IDs.

findCategories

Fetches all available categories from the shop system with optional filters.

getCategoriesTree

Returns the category tree in a specified language for a project.

hasCategoryTree

Checks if the endpoint /categories/tree is available for a project.

getProducts

Retrieves a list of products from the shop system matching the specified IDs.

findProducts

Fetches a pageable list of products from the shop system with optional filters.

hasContent

Checks if the /content/ endpoints are available for a project.

getContent

Retrieves a list of content pages matching the specified IDs.

findContent

Fetches content pages from the shop system with optional filters.

createContent

Creates a new content page in the shop system using the provided data.

updateContent

Updates an existing content page in the shop system using the provided data.

deleteContent

Deletes a specified content page in the shop system.

getStoreFrontUrl

Retrieves the URL for a specified EcomId stored in the shop system.

resolveStoreFrontUrl

Creates an EcomId object for a given storefront URL.

The required parameters for the respective methods can be seen in the JavaDoc of the BridgeFsService interface.

FirstSpirit Connect for Commerce is a product of Crownpeak Technology GmbH, Dortmund, Germany.
Only a license agreed upon with Crownpeak Technology GmbH is valid for using the module.

3. Help

The Technical Support of the Crownpeak Technology GmbH provides expert technical support covering any topic related to the FirstSpirit™ product. You can get and find more help concerning relevant topics in our community.

4. Disclaimer

This document is provided for information purposes only. Crownpeak Technology GmbH may change the contents hereof without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. Crownpeak Technology GmbH specifically disclaims any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. The technologies, functionality, services, and processes described herein are subject to change without notice.