> ## 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](/api-reference/generated/Customer)

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

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

  ```vb VB.NET theme={null}
  Public Class CustomerMethods
  ```
</CodeGroup>

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](/libraries/dotnet-reference/settings#request-errors).

## Constructors

<a id="ctor-e70952da1f" />

### CustomerMethods()

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

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

  ```vb VB.NET theme={null}
  Public Sub New()
  ```
</CodeGroup>

## Methods

<a id="add-customer-6577419bba" />

### AddCustomer(string, AddCustomerModel)

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

<CodeGroup>
  ```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
  ```
</CodeGroup>

[Web API Reference](/api-reference/generated/AddCustomer)

**Parameters**

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

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

<a id="edit-customer-a6fe639e5a" />

### EditCustomer(string, EditCustomerModel)

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

<CodeGroup>
  ```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
  ```
</CodeGroup>

[Web API Reference](/api-reference/generated/EditCustomer)

**Parameters**

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

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

<a id="get-customer-licenses-17c73ba46f" />

### GetCustomerLicenses(string, GetCustomerLicensesModel)

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

<CodeGroup>
  ```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
  ```
</CodeGroup>

[Web API Reference](/api-reference/generated/GetCustomerLicenses)

**Parameters**

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

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

<a id="get-customer-licenses-by-secret-0e87ae9b5c" />

### GetCustomerLicensesBySecret(string, GetCustomerLicensesBySecretModel)

Retrieves licenses using a customer secret you already have.

<CodeGroup>
  ```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
  ```
</CodeGroup>

[Web API Reference](/api-reference/generated/GetCustomerLicenses)

**Parameters**

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

**Returns:** [`GetCustomerLicensesResult`](/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.

<a id="get-customers-6367037ec8" />

### GetCustomers(string, GetCustomersModel)

Retrieves customers by search text or customer ID.

<CodeGroup>
  ```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
  ```
</CodeGroup>

[Web API Reference](/api-reference/generated/GetCustomers)

**Parameters**

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

**Returns:** [`GetCustomersResult`](/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](/api-reference/generated/GetCustomers).

<a id="remove-customer-990dfa9cdb" />

### RemoveCustomer(string, RemoveCustomerModel)

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

<CodeGroup>
  ```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
  ```
</CodeGroup>

[Web API Reference](/api-reference/generated/RemoveCustomer)

**Parameters**

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

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

## FAQ

<AccordionGroup>
  <Accordion title="Can GetCustomers Return a Customer Secret?" id="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](/api-reference/generated/GetCustomers), 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](/feature/web-ui/customer-secret).
  </Accordion>
</AccordionGroup>

[.NET SDK Reference](/libraries/dotnet-api) · [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.