> ## 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.

# Get Customer Licenses

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

Assumed ModelVersion: 3 (highest documented version at generation time)

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

This method is accessed in several ways. Each way works in the same way but requires the different permissions.
The first method requires *GetCustomerLicenses* permission and the second method requires *GetCustomerLicensesBySecret* permission.
The set of accepted parameters differs between the methods. Both cases are listed below:

### Parameters

**Method 1:** [https://api.cryptolens.io/api/customer/GetCustomerLicenses](https://api.cryptolens.io/api/customer/GetCustomerLicenses)

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| CustomerId | The id of the customer whose licenses we want to access. | required |
| Metadata | Includes [additional information](/api-reference/generated/GetCustomerLicenses) about each license key, such as number of activated devices, etc. | optional. false by default. |
| ModelVersion | The model that will be returned. In comparison to method version, this only affects what fields and information will be returned and does not impact the way the method works. A changelog can be found in the [end of this page](/api-reference/generated/GetCustomerLicenses). | optional. by default, it's 1. |
| v | Method version. | optional. by default, it's 1. |

**Method 2:** [https://api.cryptolens.io/api/customer/GetCustomerLicensesBySecret](https://api.cryptolens.io/api/customer/GetCustomerLicensesBySecret)

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| Secret | The Customer secret that can be used by clients to identify themselves to, for instance, retrieve their licenses. | required |
| Metadata | Includes [additional information](/api-reference/generated/GetCustomerLicenses) about each license key, such as number of activated devices, etc. | optional. false by default. |
| v | Method version. | optional. by default, it's 1. |

### Results

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| LicenseKeys | The license keys that belong to the customer. The [License Key](/api-reference/generated/GetKey) model is returned. Please note that Reseller information is not returned at this time and will be set to null. You can obtain it by using Activate or GetKey method. | always returned |
| Metadata | Additional information about each license key. This is a dictionary of (**GlobalId**, [Metadata](/api-reference/generated/model/Metadata)) pairs. In order to retrieve metadata for a specific license key, its **GlobalId** should be used. | returned if **Metadata=True** |
| Result | This is either **0**(=success) or **1**(=error). | always returned |
| Message | The message that provides additional information about the result. | always returned. |

### Example results

```text theme={null}
{"licenseKeys":[{"productId":3349,"id":7,"key":"ABCDE-FGHIJ-KLMNO-PQRST","created":"2015-08-27T00:00:00","expires":"2016-07-03T00:00:00","period":1,"f1":true,"f2":false,"f3":false,"f4":false,"f5":false,"f6":false,"f7":false,"f8":false,"notes":"","block":false,"globalId":12345},{"productId":3349,"id":18,"key":"ABCDE-FGHIJ-KLMNO-PQRST","created":"2015-08-27T00:00:00","expires":"2017-01-08T00:00:00","period":500,"f1":true,"f2":true,"f3":false,"f4":false,"f5":false,"f6":false,"f7":false,"f8":false,"notes":"","block":false,"globalId":23456}],"result":0,"message":null}
```

### Remarks

* If **Detailed=true**, it will take longer time to execute this method. Therefore, the default option should be preferred.

### Errors

| **Error** |
| - |
| Access denied. |
| The input parameters were incorrect. |
| Customer does not exist. |
| The Secret was not specified. |
| A customer with the same secret exists. |
