Hybris create product programmatically

228 views Asked by At

I have a WS that returns very basic product data: code, price and image. I need to programmatically create Hybris products with this basic data and then sync in order to see these products in the storefront.

Which are the steps in order to create a product with this very basic info ? Is there any OOTB service ?

2

There are 2 answers

0
mkysoft On

There is no service OOTB. You can create custom cron job and fetch data from WS. Creating impex files with this data is good solution. Then process this impex files OOTB impex services. Also you can save these files as medias for future investigations.

0
geffchang On

There is a ModelService, ProductService, PriceService, and other services that you can use. For the list of other common services, check Key Services Overview.

To create a product, you'll ususally do:

ProductModel p = modelService.create(ProductModel.class);
// set attributes of p