---
title: Customizing creation of new customers
related:
  - https://docs.kentico.com/k11/e-commerce-features/managing-your-store/customers.md
  - https://docs.kentico.com/k11/e-commerce-features/managing-your-store/customers/registering-customers-manually.md
  - https://docs.kentico.com/k11/custom-development/customizing-providers.md
  - https://docs.kentico.com/k11/custom-development.md
  - https://docs.kentico.com/k11/e-commerce-features/customizing-and-developing-your-store/customer-related-customizing/synchronizing-customer-and-user-properties.md
  - https://docs.kentico.com/k11/e-commerce-features/customizing-and-developing-your-store/customer-related-customizing/customizing-customers-preferred-currency-payment-method-and-shipping-option.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 customize how the system creates new [customers](https://docs.kentico.com/k11/e-commerce-features/managing-your-store/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. 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/k11/custom-development/customizing-providers/registering-providers-using-assembly-attributes.md):

   ```csharp

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

   ```
2. Override the default **SetInfo** method.
3. Save your project and reload your Kentico website.

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

> **Tip:** To customize retrieval or deleting of customers, you can similarly customize the **GetInfoByID** or **DeleteInfo** methods.

## Example – Adding extra credit to newly registered customers

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

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

        // Adds extra credit for each new registered customer
        if (newCustomer && customerObj.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 = customerObj.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
            CreditEventInfoProvider.SetCreditEventInfo(extraCredit);
        }
    }
}

```
