---
title: Customizing creation of new customers
related:
  - https://docs.kentico.com/k9/e-commerce-features/managing-your-store/customers.md
  - https://docs.kentico.com/k9/e-commerce-features/managing-your-store/customers/registering-customers-manually.md
  - https://docs.kentico.com/k9/custom-development/customizing-providers.md
  - https://docs.kentico.com/k9/custom-development.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 Kentico, you can modify the way of creating new [customers](https://docs.kentico.com/k9/e-commerce-features/managing-your-store/customers.md). That is suitable especially when you want to process additional actions during creation of a new customer, or when you want to replace the process of creation new customers completely.

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

1. 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/k9/custom-development/customizing-providers/registering-providers-using-assembly-attributes.md):

   ```csharp

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

   ```
2. Implement a method that overrides the default **SetCustomerInfoInterval** method:

   > **Tip:** See an example [below](#example-adding-extra-credit-to-newly-registered-customers).
3. Save your project and reload you Kentico website.

If you open your website, Kentico uses the modified _CustomerInfoProvider_ class with the modified methods.

> **Tip:** To customize retrieving of a customer, you can similarly customize the **GetCustomerInfoInternal** method.
>
> To customize deleting of a customer, you can similarly customize the **DeleteCustomerInfoInternal** method.

## Example – Adding extra credit to newly registered customers

This example demonstrates [adding extra credit](https://docs.kentico.com/k9/e-commerce-features/managing-your-store/customers/managing-customers-credit.md) to the [credit account](https://docs.kentico.com/k9/e-commerce-features/configuring-your-store/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
{
    protected override void SetCustomerInfoInternal(CustomerInfo customerObj)
    {
        // Remembers whether a new customer is created.
        bool newCustomer = ((customerObj != null) && (customerObj.CustomerID <= 0));

        // Updates a customer or creates a new customer based on the default process.
        base.SetCustomerInfoInternal(customerObj);

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

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

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

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

            // Saves the credit event.
            CreditEventInfoProvider.SetCreditEventInfo(extraCredit);
        }
    }
}

```
