---
title: "Sellable item commands, pipelines and blocks"
slug: "sellable-item-commands-pipelines-and-blocks"
abstract: ""
---
# Sellable item commands, pipelines and blocks

The following table describes the sellable items commands and pipelines:

| **Command/Pipeline** | **Description** |
| --- | --- |
| `CreateSellableItemCommand`<br><br>`CreateSellableItemPipeline` | Creates a new sellable item in the Commerce Engine.<br><br>Parameters:<br><br><ul><li>`productId`: unique identifier for the sellable item</li><li>`name`: internal name for the sellable item</li><li>`displayName`: display name for the sellable item</li><li>`description`: description for the sellable item</li><li>`brand`: brand of the sellable item</li><li>`manufacturer`: manufacturer of the sellable item</li><li>`typeOfGood`: type of good of the sellable item</li><li>`tags`: tags associated with the sellable item</li></ul><br><br>> [!note]<br>> When you create a sellable item programmatically, you must also explicitly associate the new item to a catalog, as shown in this [example](https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-commerce/sellable-item-commands,-pipelines-and-blocks.html#UUID-59de9763-def8-ebe8-66a8-f312a4d12f2a_section-idm4611522343163231651271394118). |
| `CreateSellableItemVariationCommand`<br><br>`CreateSellableItemVariationPipeline` | Creates a variant of an existing sellable item.<br><br>Parameters:<br><br><ul><li>`sellableItemId`: identifier for the parent sellable item</li><li>`variantId`: identifier for the sellable item variant</li><li>`variantName`: name for the sellable item variant</li><li>`variantDisplayName`: display name for the sellable item variant</li></ul> |
| `DeleteSellableItemCommand` | Deletes the specified sellable item.<br><br>Parameters:<br><br><ul><li>`sellableItemId`: unique identifier for the sellable item.</li></ul> |
| `DeleteSellableItemVariationCommand` | Deletes the specified *variant*of the sellable item.<br><br>Parameters:<br><br><ul><li>`sellableItemId`: unique identifier for the parent sellable item.</li><li>`variantId`: unique identifier for the sellable item variant.</li></ul> |
| `DisableSellableItemVariationCommand`<br><br>`DisableSellableItemVariationPipeline` | Removes the specified variant from a sellable item.<br><br>Parameters:<br><br><ul><li>`sellableItemId`: identifier for the parent sellable item</li><li>`variantId`: ID for the sellable item variant</li></ul> |
| `EditSellableItemCommand`<br><br>`EditSellableItemPipeline` | Makes changes to an existing sellable item.<br><br><ul><li>`sellableItem`: identifier for the sellable item</li></ul> |
| `GetBulkPricesCommand`<br><br>`GetSellableItemPipeline` | Retrieves a string of sellable item identifiers and returns a bulk pricing model for each item. Returns pricing on a particular variant if a variant identifier is supplied, otherwise returns pricing on all variants.<br><br>Parameters:<br><br><ul><li>`itemIds`: a delimited list of item identifiers; contains a Catalog, ProductId, and VariantId to fully describe a particular item (string).</li></ul> |
| `GetSellableItemsByParentCommand`<br><br>`GetSellableItemsByParentPipeline` | Retrieves all sellable items that belong to a specified parent (that is, a catalog or a category).<br><br>Parameters:<br><br><ul><li>`ParentId`: identifier for a catalog or for a category</li><li>`Skip`: number of items to skip</li><li>`Take`: number of items to skip</li></ul> |
| `GetSellableItemCommand`<br><br>`GetSellableItemPipeline` | Retrieves the specified sellable item.<br><br>Parameters:<br><br><ul><li>`itemId`: identifier for the sellable item</li><li>`filterVariations`: indicates whether the sellable item variants should be retrieved</li></ul> |
| `GetSellableItemsCommand`<br><br>`GetSellableItemsPipeline` | Retrieves a list of all sellable items in the system.<br><br>Parameters: none. |
| `RemoveListPricesCommand`<br><br>`RemoveListPricesPipeline` | Removes the specified list prices for a sellable item.<br><br>Parameters:<br><br><ul><li>`itemId`: identifier for the sellable item</li><li>`prices`: delimited string of prices for different currencies for the sellable item</li></ul> |
| `UpdateListPricesCommand`<br><br>`UpdateListPricesPipeline` | Adds or updates the specified list prices (in different currencies) for a sellable item.<br><br>Parameters:<br><br><ul><li>`itemId`: identifier for the sellable item</li><li>`prices`: delimited string of prices for different currencies for the sellable item</li></ul> |
| `UpdateSellableItemPurchasableCommand` | Determines if an item is available for purchase or not.<br><br><ul><li>`true`: the item is available for purchase</li><li>`false`: the item cannot be purchased.</li></ul> |
| `DeleteSellableItemBundleReferencesBlock` | Checks if the item that is being deleted is a sellable item and cleans up bundle associations if necessary. |

## Example: create a sellable item programmatically

You use the `CreateSellableItem` command to create a sellable item programmatically. When you create a sellable item using code, you must also include an explicit association to the relevant catalog.

The following example shows a sample `createSellableItem` command, with the required catalog association:

```csharp
namespace Sitecore.Commerce.Plugin.Sample
{
    using System;
    using System.Threading.Tasks;
    using Sitecore.Commerce.Core;
    using Sitecore.Commerce.Core.Commands;
    using Sitecore.Commerce.Plugin.Catalog;

    /// <inheritdoc />
    /// <summary>
    /// Defines the SampleCommand command.
    /// </summary>
    public class SampleCommand : CommerceCommand
    {
        private readonly CreateSellableItemCommand _createSellableItemCommand;

        private readonly AssociateSellableItemToParentCommand _associateSellableItemToParent;

        public SampleCommand(CreateSellableItemCommand createSellableItemCommand, AssociateSellableItemToParentCommand associateSellableItemToParent, IServiceProvider serviceProvider) : base(serviceProvider)
        {
            _createSellableItemCommand = createSellableItemCommand;
            _associateSellableItemToParent = associateSellableItemToParent;
        }

        public async Task<SampleEntity> Process(CommerceContext commerceContext, string catalogID)
        {
            using (var activity = CommandActivity.Start(commerceContext, this))
            {
                SellableItem sellableItem = await _createSellableItemCommand.Process(commerceContext, "My Prodcut ID", "", "My Product Name", "My Product DisplayName", "My Description", "My Brand", "Manufacturer", Array.Empty<string>()).ConfigureAwait(continueOnCapturedContext: false);
                if (sellableItem != null)
                {
                    await _associateSellableItemToParent.Process(commerceContext, "Entity-Catalog-Habitat_Master", catalogID, sellableItem.Id).ConfigureAwait(continueOnCapturedContext: false);
                }

                return new SampleEntity();
            }
        }
    }
}

```