---
updatedAt: 2026-06-09T17:02:17.000Z
agentTools:
  projectIndex: https://hq.docs.netevia.com/llms.txt
---

# Returns a list of licenses for the merchant's devices.

## Get Charge Anywhere Licenses

Returns a list of licenses associated with a merchant's Charge Anywhere devices. Each license object includes a license key, the device ID it is assigned to, and a flag indicating whether the license should be kept active. This endpoint is essential for ISOs and administrators who need to audit or manage licensing across a merchant's portfolio of payment devices.

### Endpoint

`GET /api/v1/merchant/chargeAnywhere/licenses`

### Authentication

Basic HTTP Authentication required.
Encode `username:password` in Base64 and pass in the Authorization header:

```
Authorization: Basic {base64(username:password)}
```

### When to use

Use this endpoint when you need to view the current license state for all Charge Anywhere devices belonging to a specific merchant. This is particularly useful during device audits, before decommissioning hardware, or when verifying that all active devices have valid licenses. Administrators can use the `keepActive` flag in each license record to determine which devices are slated for continued use.

### Query Parameters

| Parameter | Type            | Required | Description                                                                                |
| --------- | --------------- | -------- | ------------------------------------------------------------------------------------------ |
| id        | integer (int32) | Yes      | Unique merchant identifier used to retrieve all associated Charge Anywhere device licenses |

### Response

**200 OK**

| Field                  | Type    | Description                                                        |
| ---------------------- | ------- | ------------------------------------------------------------------ |
| userId                 | integer | Internal user ID associated with the merchant account              |
| licenses               | array   | List of license objects for the merchant's Charge Anywhere devices |
| licenses\[].licenseKey | string  | The license key string assigned to the device                      |
| licenses\[].deviceId   | string  | Unique identifier of the device the license is assigned to         |
| licenses\[].keepActive | boolean | Whether the license is configured to remain active                 |
| requestId              | integer | Unique request ID for tracking and debugging                       |
| success                | boolean | True if the request succeeded; false otherwise                     |
| error                  | string  | Error message on failure; null on success                          |
| validationErrors       | array   | Field-level validation errors, if any                              |

```json
{
  "userId": 5821,
  "licenses": [
    {
      "licenseKey": "CA-LIC-A1B2C3D4E5F6",
      "deviceId": "DEV-00391",
      "keepActive": true
    },
    {
      "licenseKey": "CA-LIC-G7H8I9J0K1L2",
      "deviceId": "DEV-00392",
      "keepActive": false
    },
    {
      "licenseKey": "CA-LIC-M3N4O5P6Q7R8",
      "deviceId": "DEV-00394",
      "keepActive": true
    }
  ],
  "requestId": 80442,
  "success": true,
  "error": null,
  "validationErrors": []
}
```

### Error Codes

| Code | When it happens                                     |
| ---- | --------------------------------------------------- |
| 400  | `id` parameter is missing or is not a valid integer |
| 401  | Invalid or missing Basic Auth credentials           |
| 403  | User does not have permission for this operation    |
| 404  | No licenses found for the specified merchant ID     |
| 500  | Internal server error while retrieving licenses     |

### Common Mistakes

* Passing a non-integer value for `id` — the parameter must be a valid int32
* Omitting the `id` query parameter — the endpoint requires it to scope the license lookup to a specific merchant
* Misinterpreting `keepActive: false` as a license being invalid — it simply means the license will not be renewed automatically
* Not paginating results for merchants with many devices — review if a merchant has a large number of devices before displaying the full list

### Related Endpoints

* `GET /api/v1/merchant/chargeAnywhere/virtualTerminal` — retrieve Charge Anywhere credentials for a merchant
* `GET /api/v1/merchant/chargeAnywhere/terminals` — list all created Charge Anywhere terminals for a merchant
* `POST /api/v1/merchant/chargeAnywhere/keepLicenseActive` — update the keep-active option for a specific device license

### Example

```bash
curl -X GET "https://hq.staging.netevia.dev/api/v1/merchant/chargeAnywhere/licenses?id=5821" \
  -H "Authorization: Basic $(echo -n 'username:password' | base64)" \
  -H "Content-Type: application/json"
```

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "v1",
    "title": "Netevia HQ | API Documentation",
    "description": "Netevia HQ | API Documentation"
  },
  "paths": {
    "/api/v1/merchant/chargeAnywhere/licenses": {
      "get": {
        "tags": [
          "Charge Anywhere Gateway"
        ],
        "summary": "Returns a list of licenses for the merchant's devices.",
        "operationId": "ChargeAnywhereGateway_GetLicenses",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MPosAccountLicensesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MPosAccountLicensesResponse"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/MPosAccountLicensesResponse"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/MPosAccountLicensesResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "Basic": []
    }
  ],
  "servers": [
    {
      "url": "https://hq.staging.netevia.dev"
    }
  ],
  "components": {
    "securitySchemes": {
      "Basic": {
        "type": "http",
        "description": "Basic HTTP Authentication",
        "scheme": "basic"
      }
    },
    "schemas": {
      "ValidationError": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "MPosAccountLicensesResponse": {
        "type": "object",
        "properties": {
          "userId": {
            "format": "int32",
            "type": "integer"
          },
          "licenses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MPosAccountLicense"
            }
          },
          "requestId": {
            "format": "int32",
            "type": "integer"
          },
          "success": {
            "type": "boolean"
          },
          "error": {
            "type": "string"
          },
          "validationErrors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            }
          }
        }
      },
      "MPosAccountLicense": {
        "type": "object",
        "properties": {
          "licenseKey": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "keepActive": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
```