I need to delete the catalogs from Sitecore Commerce by using code. Is there any pipeline or command?
-
Can I ask what is the reasoning behind deleting catalog programatically? What is your business case?– Peter ProcházkaSep 7, 2018 at 15:35
-
what commerce version do you have?– Vlad IobagiuSep 7, 2018 at 16:44
-
I am using 9.0.1 version now. I am getting the Catalogs from third part source to add in to SXC. While doing development , i need to delete catalogs at some time.– HussainSep 10, 2018 at 5:35
1 Answer
In 9.0.1, you can invoke IRemoveAllCatalogItemsPipeline
to delete all catalogs, categories, and sellable items. You can invoke it using Postman via the RemoveAllCatalogItems()
API. There are no APIs (controllers/pipelines) for deleting individual catalogs.
I believe 9.0.2 introduced UI for deleting sellable items so presumably there are additional pipelines that support that functionality, but I'm not familiar enough with 9.0.2 to help with any details.