---
title: Customizing creation of new customers
related:
  - https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/customers.md
  - https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/customers/registering-customers-manually.md
  - https://docs.kentico.com/13/custom-development/customizing-providers.md
  - https://docs.kentico.com/13/custom-development.md
  - https://docs.kentico.com/13/e-commerce-features/customizing-on-line-stores/customer-related-customizing/synchronizing-customer-and-user-properties.md
  - https://docs.kentico.com/13/e-commerce-features/customizing-on-line-stores/customer-related-customizing/customizing-customer-preferences.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

In Xperience, you can customize how the system creates new [customers](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/customers.md). This is suitable especially when you want to process additional actions during the creation of a new customer, or when you want to replace the custom creation process completely.

To customize creating of new customers, you need to implement a class that inherits from the **CustomerInfoProvider** class:

1. Prepare an assembly (_Class Library_ project) with class discovery enabled in your Xperience solution (or use an existing one). See [Adding custom assemblies](https://docs.kentico.com/13/custom-development/adding-custom-assemblies.md).
   - Reference the project from both your live site and Xperience administration (_CMSApp_) projects.
2. Create a new class in your project in Visual Studio (for example **CustomCustomerInfoProvider.cs**) that inherits from the **CustomerInfoProvider** class and [registers the custom InfoProvider](https://docs.kentico.com/13/custom-development/customizing-providers/registering-providers-using-assembly-attributes.md):

   ```csharp

   [assembly: RegisterCustomProvider(typeof(CustomCustomerInfoProvider))]
   public class CustomCustomerInfoProvider : CustomerInfoProvider
   {
   }

   ```
3. Override the default **Set** method.
4. Save your project and reload your Xperience website.

The system now uses the custom _CustomerInfoProvider_ class with the modified method.

## Example – Adding extra credit to newly registered customers

This example demonstrates [adding extra credit](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/customers/managing-customer-credit.md) to the [credit account](https://docs.kentico.com/13/e-commerce-features/configuring-on-line-stores/configuring-payment-methods/configuring-customer-credit.md) of every newly registered customer.

```csharp

using System;

using CMS;
using CMS.Ecommerce;
using CMS.SiteProvider;

[assembly: RegisterCustomProvider(typeof(CustomCustomerInfoProvider))]

public class CustomCustomerInfoProvider : CustomerInfoProvider
{
    public override void Set(CustomerInfo info)
    {
        if (info == null)
        {
            throw new ArgumentNullException(nameof(info));
        }

        // Indicates whether the set object is a new customer
        bool newCustomer = info.CustomerID <= 0;            

        // Updates or creates the customer based on the default process
        base.Set(info);

        // Adds extra credit for each new registered customer
        if (newCustomer && info.CustomerIsRegistered)
        {
            // Creates a new credit event object
            CreditEventInfo extraCredit = new CreditEventInfo();

            // Sets the credit event's general properties
            extraCredit.EventName = "Extra credit for a new customer";
            extraCredit.EventDate = DateTime.Now;
            extraCredit.EventDescription = "This is starting credit for a new customer.";
            extraCredit.EventCustomerID = info.CustomerID;

            // Sets the credit event's value in the site's main currency
            extraCredit.EventCreditChange = 100;

            // Sets the credit as site or global credit according to the current site's settings
            extraCredit.EventSiteID = ECommerceHelper.GetSiteID(SiteContext.CurrentSiteID, ECommerceSettings.USE_GLOBAL_CREDIT);

            // Saves the credit event to the database
            CreditEventInfo.Provider.Set(extraCredit);
        }
    }
}

```
