A [`DeviceIdentifier`](https://developers.google.com/zero-touch/reference/reseller/rest/v1/partners.devices#DeviceIdentifier) encapsulates hardware IDs to identify a
manufactured device. This document explains how to work with identifiers in the
zero-touch enrollment API.

A `DeviceIdentifier` combines hardware metadata or IDs required to uniquely
identify a device.

Your organization includes the device identifier values when uploading device
data through the portal or calling the API.

> [!IMPORTANT]
> **Important:** a `DeviceIdentifier` represents a hardware device. It shouldn't be confused with `deviceId`, which represents a record in the API.

## Required fields

### Android devices

Zero-touch enrollment typically identifies devices by the IMEI (or MEID)
cellular modem IDs. To support devices without cellular modems, such as
tablets, you can also identify devices using a different set of fields. The
following table shows the fields you can use for each type of device:

| Identifier | Cellular | Wi‑Fi only | Notes |
|---|---|---|---|
| `hardware_id` | Yes | No | This field must be an IMEI or MEID number. Zero-touch enrollment validates the format of IMEI values when you pass them in API arguments. |
| `hardware_id2` | Yes | No | This field must be a second IMEI or MEID number. Zero-touch enrollment validates the format of IMEI values when you pass them in API arguments. For information on devices with more than one cellular modem, see [Dual-SIM devices](https://developers.google.com/zero-touch/guides/identifiers#dual-sim). |
| `serialNumber` | Yes | Yes | The manufacturer's serial number for the device. The serial number is case sensitive and is the same value that's returned from [`Build.getSerial()`](https://developer.android.com/reference/android/os/Build.html#getSerial()). |
| `model` | Yes | Yes | The device model value must match the device's built-in value returned from [`Build.MODEL`](https://developer.android.com/reference/android/os/Build.html#MODEL). See the [model names](https://developers.google.com/zero-touch/resources/manufacturer-names#model-names) reference for a list of allowed values for each manufacturer. |
| `manufacturer` | Yes | Yes | The `manufacturer` field value must match the device's built-in value returned from [`Build.MANUFACTURER`](https://developer.android.com/reference/android/os/Build.html#MANUFACTURER). See the [manufacturer names](https://developers.google.com/zero-touch/resources/manufacturer-names) reference for further information. |

If registering serial number you must also register manufacturer and model to
ensure zero-touch is able to detect the device.

#### Dual-SIM devices

A dual-SIM device includes two discrete modems and has two IMEI numbers. If
registering just one IMEI, prefer the numerically lowest IMEI number as
zero-touch enrollment works more reliably with the lowest IMEI. To increase
reliability you can additionally register the other IMEI, or the serial number,
manufacturer and model.

To display the second IMEI in the zero-touch portal:

1. Go to the **Devices** tab.
2. On the upper right corner, beside the **Add Device** button, click the three dots .
3. Select **Customize table**.
4. Select the checkbox for **IMEI2**.
5. Click **Save**.

### ChromeOS devices

For ChromeOS devices the set of required identifiers is the same for cellular
and Wi-Fi only devices:

| Identifier | Notes |
|---|---|
| `serialNumber` | The manufacturer's serial number for the device. |
| `model` | The device model value must match the device's built-in value. See the [list of ChromeOS model values](https://developers.google.com/zero-touch/resources/chromeos-models) for reference. |
| `chromeOsAttestedDeviceId` | The Attested Device ID. See the [list of compatible ChromeOS devices](https://support.google.com/chrome/a/answer/10130175#identify_compatible&zippy=%2Cidentify-compatible-chrome-devices) for reference. |

## Refer to a device

Use a `DeviceIdentifier` when finding or claiming devices. You need to include
the required fields specified for the type of device.

The following snippet shows an IMEI number used to search for a specific device
by calling [`partners.devices.findByIdentifier`](https://developers.google.com/zero-touch/reference/reseller/rest/v1/partners.devices/findByIdentifier):

### Java

```java
// Create a DeviceIdentifier.
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setImei("123456789012347");

// Perform the search using the zero-touch enrollment API.
FindDevicesByDeviceIdentifierRequest body = new FindDevicesByDeviceIdentifierRequest();
body.setLimit(1L);
body.setDeviceIdentifier(deviceIdentifier);

FindDevicesByDeviceIdentifierResponse response = service
    .partners()
    .devices()
    .findByIdentifier(PARTNER_ID, body)
    .execute();
```

### .NET

```c#
// Create a DeviceIdentifier.
var deviceIdentifier = new DeviceIdentifier
{
    Imei = "123456789012347"
};

// Perform the search using the zero-touch enrollment API.
var body = new FindDevicesByDeviceIdentifierRequest
{
    Limit = 1,
    DeviceIdentifier = deviceIdentifier
};
var response = service.Partners.Devices.FindByIdentifier(body, PartnerId).Execute();
```

### Python

```python
# Create a DeviceIdentifier.
device_identifier = {'imei':'123456789012347'}

# Perform the search using the zero-touch enrollment API.
response = service.partners().devices().findByIdentifier(
    partnerId=PARTNER_ID, body={'deviceIdentifier':device_identifier, \
    'limit':1}).execute()
```

The following snippet shows how to create a device identifier with a serial
number:

### Java

```java
// Create a device identifier to find a Wi-Fi-only device.
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setManufacturer("Honeywell");
deviceIdentifier.setModel("VM1A");
deviceIdentifier.setSerialNumber("ABcd1235678");
```

### .NET

```c#
// Create a device identifier to find a Wi-Fi-only device.
var deviceIdentifier = new DeviceIdentifier
{
    Manufacturer = "Honeywell",
    Model = "VM1A",
    SerialNumber = "ABcd1235678"
};
```

### Python

```python
# Create a device identifier to find a Wi-Fi-only device.
device_identifier = {'manufacturer':'Honeywell', \
    'model':'VM1A', 'serialNumber':'ABcd1235678'}
```

## Learn more

- To learn more about hardware identifiers, see the [API reference documentation](https://developers.google.com/zero-touch/reference/reseller/rest/v1/partners.devices#DeviceIdentifier) for `DeviceIdentifier`.
- To see a list of allowed manufacturer names and device models, review the [manufacturer names](https://developers.google.com/zero-touch/resources/manufacturer-names) reference.
- To see a list of compatible ChromeOS devices, see the [ChromeOs Help Center](https://support.google.com/chrome/a/answer/10130175#identify_compatible&zippy=%2Cidentify-compatible-chrome-devices)