---
title: PriceType examples
slug: commerce-connect-13/docs/pricetype-examples
docTags: 
createdAt: 2026-07-23T09:44:50.000Z
---

## PriceType

This is an example of how to work with PriceType: geting price type definitions.

```xml
<SalePriceTypes>
  <add key="NewCustomPriceType" value="3" description="New Custom Price Type" />
  <add key="JurisdictionGroup" value="4" description="Jurisdiction Group"/>
</SalePriceTypes>
```

### Add custom price types

To add a new PriceType, add a new line within the SalePriceTypes of CatalogOptions in *ecf.cataloconfigig* file.

```xml
<SalePriceTypes>
    <add key="NewCustomPriceType" value="3" description="New Custom Price Type" />
    <add key="JurisdictionGroup" value="4" description="Jurisdiction Group"/>
</SalePriceTypes>
```

:::hint{type="info"}
**Note**
The value must be unique and 3 or greater.
:::

### Get all price types enumum and configuration

PriceTypeConfiguration.PriceTypeDefinitions returns all price types, including predefined price types and price types defined in the configuration.

```csharp
namespace CodeSamples.Mediachase.Commerce.Pricing
      {
        public class PriceTypeConfigurationSample
          {
            #region GetPriceTypeFromEnumAndConfiguration
            public IDictionary<CustomerPricing.PriceType, PriceTypeDefinition> GetAllPriceTypeDefinitions()
              {
                 // Get all price types - included predefined and price types from configuration file.
                 var priceTypeDefinitions = PriceTypeConfiguration.Instance.PriceTypeDefinitions;
                 return priceTypeDefinitions;
              }
            #endregion
          }
      }
```

### Add your own customer price group

**Customer Price Group** is a predefined price type that should be matched with a specific sale code. Options available to marketers are predefined as: **Customer**, **Partner**, and **Distributor**.

As a developer, you can add items to that list, to make your own customer price group available in the drop-down.
![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/cox2zBAlCkufBCV6S0588-20260723-094604.png "custom-customer-price-group.png")

Populate the list by adding the code in the example below, and call that from your [initialization module](https://world.optimizely.com/documentation/developer-guides/commerce/initialization/).

```csharp
private void AddVIPCustomerPriceGroup()
      {
        var metaFieldType = DataContext.Current.MetaModel.RegisteredTypes["ContactGroup"];
        var metaEnumItems = MetaEnum.GetItems(metaFieldType);
        var hasVIPGroup = metaEnumItems.Any(item => string.Equals(item.Name, "VIP", StringComparison.InvariantCultureIgnoreCase));
        if (!hasVIPGroup)
          {
            var lastIndex = metaEnumItems.Count();
            MetaEnum.AddItem(metaFieldType, "VIP", ++lastIndex);
          }
      }
```
