Collects
A Collect is an object that connects a product to a custom collection.
Creating a collect
Section titled “Creating a collect”var service = new CollectService(myShopifyUrl, shopAccessToken);var collect = new Collect(){ CollectionId = collectionId, ProductId = productId}
collect = await service.CreateAsync(collect);Retrieving a collect
Section titled “Retrieving a collect”var service = new CollectService(myShopifyUrl, shopAccessToken);var collect = await service.GetAsync(collectId);Deleting a collect
Section titled “Deleting a collect”var service = new CollectService(myShopifyUrl, shopAccessToken);
await service.DeleteAsync(collectId);Counting collects
Section titled “Counting collects”var service = new CollectService(myShopifyUrl, shopAccessToken);int collectCount = await service.CountAsync();
//Optionally filter the count to only those collects for a certain product or collectionint filteredCollectCount = await service.CountAsync(new CollectFilterOptions(){ ProductId = productId, CollectionId = collectionId});Listing collects
Section titled “Listing collects”var service = new CollectService(myShopifyUrl, shopAccessToken);var collects = await service.ListAsync();
//Optionally filter the list to only those collects for a certain product or collectionvar filteredCollects = await service.CountAsync(new CollectFilterOptions(){ ProductId = productId, CollectionId = collectionId});