> ## Documentation Index
> Fetch the complete documentation index at: https://help.cryptolens.io/llms.txt
> Use this file to discover all available pages before exploring further.

# .NET: CustomerMethods

> Signatures, models and behavior for SKM.V3.Methods.CustomerMethods in the .NET SDK 4.0.54.

Methods that perform operations on a customer object. A complete list can be found here: [Customer](https://help.cryptolens.io/api-reference/generated/Customer.md)

**Namespace:** `SKM.V3.Methods`\
**Version:** 4.0.54. Both packages; all six documented target frameworks.

```csharp C# theme={null}
public class CustomerMethods
```

```vb VB.NET theme={null}
Public Class CustomerMethods
```

These methods return a result object. Check `Result == ResultType.Success` before using its data. In version 4.0.54, handled request and JSON errors normally return `ResultType.Error` with a diagnostic `Message`. A non-null result alone does not mean the request succeeded. See [Request Errors](https://help.cryptolens.io/libraries/dotnet-reference/settings.md#request-errors).

## Constructors

### CustomerMethods()

Creates an empty CustomerMethods object. This constructor does not send an API request.

```csharp C# theme={null}
public CustomerMethods()
```

```vb VB.NET theme={null}
Public Sub New()
```

## Methods

### AddCustomer(string, AddCustomerModel)

This method will add new customer. To remove an existing customer, please see [`RemoveCustomer(string, RemoveCustomerModel)`](https://help.cryptolens.io/libraries/dotnet-reference/methods/customer-methods#remove-customer-990dfa9cdb)

```csharp C# theme={null}
public static AddCustomerResult AddCustomer(string token, AddCustomerModel parameters)
```

```vb VB.NET theme={null}
Public Shared Function AddCustomer(token As String, parameters As AddCustomerModel) As AddCustomerResult
```

[Web API Reference](https://help.cryptolens.io/api-reference/generated/AddCustomer.md)

**Parameters**

| Name | Type | Description |
| - | - | - |
| `token` | `string` | An access token with AddCustomer permission. More info: [Auth](https://help.cryptolens.io/api-reference/generated/Auth.md) |
| `parameters` | [`AddCustomerModel`](https://help.cryptolens.io/libraries/dotnet-reference/models/add-customer-model) | Parameters of the method. |

**Returns:** [`AddCustomerResult`](https://help.cryptolens.io/libraries/dotnet-reference/models/add-customer-result). The API response. Check `Result` and `Message` before using the returned data.

### EditCustomer(string, EditCustomerModel)

This method will edit an existing customer. It will only change the properties that you specify.

```csharp C# theme={null}
public static EditCustomerResult EditCustomer(string token, EditCustomerModel parameters)
```

```vb VB.NET theme={null}
Public Shared Function EditCustomer(token As String, parameters As EditCustomerModel) As EditCustomerResult
```

[Web API Reference](https://help.cryptolens.io/api-reference/generated/EditCustomer.md)

**Parameters**

| Name | Type | Description |
| - | - | - |
| `token` | `string` | An access token with EditCustomer permission. More info: [Auth](https://help.cryptolens.io/api-reference/generated/Auth.md) |
| `parameters` | [`EditCustomerModel`](https://help.cryptolens.io/libraries/dotnet-reference/models/edit-customer-model) | Parameters of the method. |

**Returns:** [`EditCustomerResult`](https://help.cryptolens.io/libraries/dotnet-reference/models/edit-customer-result). The API response. Check `Result` and `Message` before using the returned data.

### GetCustomerLicenses(string, GetCustomerLicensesModel)

This method will return a list of license keys that belong to a certain customer.

```csharp C# theme={null}
public static GetCustomerLicensesResult GetCustomerLicenses(string token, GetCustomerLicensesModel parameters)
```

```vb VB.NET theme={null}
Public Shared Function GetCustomerLicenses(token As String, parameters As GetCustomerLicensesModel) As GetCustomerLicensesResult
```

[Web API Reference](https://help.cryptolens.io/api-reference/generated/GetCustomerLicenses.md)

**Parameters**

| Name | Type | Description |
| - | - | - |
| `token` | `string` | An access token with GetCustomerLicenses permission. More info: [Auth](https://help.cryptolens.io/api-reference/generated/Auth.md) |
| `parameters` | [`GetCustomerLicensesModel`](https://help.cryptolens.io/libraries/dotnet-reference/models/get-customer-licenses-model) | Parameters of the method. |

**Returns:** [`GetCustomerLicensesResult`](https://help.cryptolens.io/libraries/dotnet-reference/models/get-customer-licenses-result). The API response. Check `Result` and `Message` before using the returned data.

### GetCustomerLicensesBySecret(string, GetCustomerLicensesBySecretModel)

Retrieves licenses using a customer secret you already have.

```csharp C# theme={null}
public static GetCustomerLicensesResult GetCustomerLicensesBySecret(string token, GetCustomerLicensesBySecretModel parameters)
```

```vb VB.NET theme={null}
Public Shared Function GetCustomerLicensesBySecret(token As String, parameters As GetCustomerLicensesBySecretModel) As GetCustomerLicensesResult
```

[Web API Reference](https://help.cryptolens.io/api-reference/generated/GetCustomerLicenses.md)

**Parameters**

| Name | Type | Description |
| - | - | - |
| `token` | `string` | An access token with GetCustomerLicensesBySecret permission. More info: [Auth](https://help.cryptolens.io/api-reference/generated/Auth.md) |
| `parameters` | [`GetCustomerLicensesBySecretModel`](https://help.cryptolens.io/libraries/dotnet-reference/models/get-customer-licenses-by-secret-model) | Parameters of the method. |

**Returns:** [`GetCustomerLicensesResult`](https://help.cryptolens.io/libraries/dotnet-reference/models/get-customer-licenses-result). The API response. Check `Result` and `Message` before using the returned data.

The access token needs the **GetCustomerLicensesBySecret permission**. This method does not retrieve the customer secret.

### GetCustomers(string, GetCustomersModel)

Retrieves customers by search text or customer ID.

```csharp C# theme={null}
public static GetCustomersResult GetCustomers(string token, GetCustomersModel parameters)
```

```vb VB.NET theme={null}
Public Shared Function GetCustomers(token As String, parameters As GetCustomersModel) As GetCustomersResult
```

[Web API Reference](https://help.cryptolens.io/api-reference/generated/GetCustomers.md)

**Parameters**

| Name | Type | Description |
| - | - | - |
| `token` | `string` | An access token with AddCustomer permission. More info: [Auth](https://help.cryptolens.io/api-reference/generated/Auth.md) |
| `parameters` | [`GetCustomersModel`](https://help.cryptolens.io/libraries/dotnet-reference/models/get-customers-model) | Parameters of the method. |

**Returns:** [`GetCustomersResult`](https://help.cryptolens.io/libraries/dotnet-reference/models/get-customers-result). The API response. Check `Result` and `Message` before using the returned data.

The access token needs the **GetCustomers permission**. This SDK wrapper requests model version 1 and returns `List<Customer>`, which has no `Secret` property. To retrieve an existing secret, call the Web API with `ModelVersion=2` or `3`; see [GetCustomers](https://help.cryptolens.io/api-reference/generated/GetCustomers.md).

### RemoveCustomer(string, RemoveCustomerModel)

Removes an existing customer by customer ID. To add a customer, use [`AddCustomer(string, AddCustomerModel)`](https://help.cryptolens.io/libraries/dotnet-reference/methods/customer-methods#add-customer-6577419bba).

```csharp C# theme={null}
public static BasicResult RemoveCustomer(string token, RemoveCustomerModel parameters)
```

```vb VB.NET theme={null}
Public Shared Function RemoveCustomer(token As String, parameters As RemoveCustomerModel) As BasicResult
```

[Web API Reference](https://help.cryptolens.io/api-reference/generated/RemoveCustomer.md)

**Parameters**

| Name | Type | Description |
| - | - | - |
| `token` | `string` | An access token with RemoveCustomer permission. More info: [Auth](https://help.cryptolens.io/api-reference/generated/Auth.md) |
| `parameters` | [`RemoveCustomerModel`](https://help.cryptolens.io/libraries/dotnet-reference/models/remove-customer-model) | Parameters of the method. |

**Returns:** [`BasicResult`](https://help.cryptolens.io/libraries/dotnet-reference/models/basic-result). The API response. Check `Result` and `Message` before using the returned data.

## FAQ

> [accordion] Can GetCustomers Return a Customer Secret?
>
> The Web API can, but this SDK method cannot in 4.0.54. It sends `ModelVersion=1` and returns `Customer` objects without a `Secret` property. Make a direct [GetCustomers request with ModelVersion=2 or 3](https://help.cryptolens.io/api-reference/generated/GetCustomers.md), a specific `CustomerId` and the **Get Customers permission**.
>
> If you already have the secret, use `GetCustomerLicensesBySecret` to retrieve that customer's licenses. This requires the **Get Customer Licenses By Secret permission**. See the [Customer Secret guide](https://help.cryptolens.io/feature/web-ui/customer-secret.md).

[.NET SDK Reference](https://help.cryptolens.io/libraries/dotnet-api.md) · [Reviewed Source Revision](https://github.com/Cryptolens/cryptolens-dotnet/tree/30aaf399ba53d9a111bee896c35bf557fa219394)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.