How can I unpublish a product without deleting it? Should I set it's status? And what SaveAction should I use?
I think you can set the StartPublish and/or StopPublish to make it "not available". Here's an example code:
var content = CurrentContent.CreateWritableClone<EntryContentBase>();
content.StopPublish = DateTime.UtcNow.AddDays(-1);
contentRepo.Save(content, SaveAction.Publish, AccessLevel.NoAccess);
Epi_IsPublished will still be true since you use SaveAction.Publish though. But maybe StartPublish and StopPublish will prevent it from showing?
There is no true way to unpublish a catalog content using content APIs (or at least what I know of). Setting StartPublish to be after current time means it's yet to available, while setting StopPublish to the past means it's expired. It then depends on your front-end code to filter out those entries from being shown.
You can still set IsActive column via CatalogEntryDto and/or setting metaObject["Epi_IsPublished"] to false via MetaObject.
Okay. I think in previous versions of EPi, I could set IsPendingPublish to true, which would set IsActive to false on the CatalogEntry. Is this still the case?
I would recommend to set the StopPublish to the current UTC time and that way expire the content.
It would require you to filter out content upon loading using the IPublishedStateAssessor.IsPublished function, but that is something you should already be doing. :)