---
name: "getDeviceDetailsById"
mode: "kit"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.5" }
---

## getDeviceDetailsById

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.5

### Method signature

```typescript
getDeviceDetailsById(params: QueryGetDeviceDetailsById)
```

### Description

View details of a single device

### Parameters

`Params`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `params` | `QueryGetDeviceDetailsById` | Yes | - | Request body |

### Return Value

Type: `Promise<DeviceDetails>`

Device details (see DeviceDetails)

### Referenced Types

##### `type` QueryGetDeviceDetailsById

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `homeId` | `string` | Yes | Home ID |
| `uuid` | `string` | Yes | Device UUID |
| `categoryCode` | `string` | Yes | Business category code |

##### `interface` DeviceDetails

| Property | Type | Description |
| --- | --- | --- |
| `haveAvailableService` | `0 \| 1` | Whether a service is available (0: not activated; 1: activated) |
| `activeStockIdList` | `string[]` | List of stockId values for activated services |
| `productId` | `string` | Product ID |
| `planList` | `PlanInfoDto[]` | Device service plan list |
| `isUseFreeService` | `0 \| 1` | Whether a subscription product with a free first period has been purchased (0: not purchased, 1: purchased) |
| `isUseCommonUserTrail` | `0 \| 1` | Whether an account-level free product for a standard trial has ever been purchased (0: not purchased, 1: purchased) |
| `isUseCommonDeviceTrail` | `0 \| 1` | Whether a device-level free product for a standard trial has ever been purchased (0: not purchased, 1: purchased) |
| `isTried` | `0 \| 1` | Whether the product has been tried (0: not tried, 1: tried) |
| `hasServiceOrder` | `boolean` | Whether a service ticket exists |
| `icon` | `string` | Device icon |
| `name` | `string` | Device name |
| `ownerId` | `string` | ID of the home the device belongs to |
| `uuid` | `string` | Unique device ID |
| `roomName` | `string` | Room name |
| `deviceId` | `string` | Device deviceId |
| `isBind` | `DeviceBindStatus` | Binding status (bound / unsupported / unbound) |
| `status` | `boolean` | Device status |
| `aiSmartFreeDev` | `boolean` | Whether the current device is on the aiSmart capability allowlist |

##### `type` PlanInfoDto

| Property | Type | Description |
| --- | --- | --- |
| `commodityCode` | `string` | Product code |
| `commodityName` | `string` | Product name |
| `env` | `number` | Environment identifier |
| `instanceId` | `string` | Instance ID (typically the device ID) |
| `isSubscribe` | `0 \| 1` | Whether the product is subscribed to (0 / 1) |
| `orderNo` | `number` | Sort order |
| `planStatus` | `USING` | Plan status (e.g., active) |
| `serviceBeginTime` | `number` | Service start time |
| `serviceEndTime` | `number` | Service end time |
| `stockId` | `string` | Inventory ID |
| `isCanceled` | `0 \| 1` | Whether the subscription has been canceled (0 / 1) |
| `isAdditional` | `0 \| 1` | Whether this is an additional purchase or add-on (0 / 1) |


### Valid Values

##### `DeviceDetails.haveAvailableService`

| Value | Description | Since |
| --- | --- | --- |
| `0` | - | - |
| `1` | - | - |

##### `DeviceDetails.planList.isSubscribe`

| Value | Description | Since |
| --- | --- | --- |
| `0` | - | - |
| `1` | - | - |

##### `DeviceDetails.planList.isCanceled`

| Value | Description | Since |
| --- | --- | --- |
| `0` | - | - |
| `1` | - | - |

##### `DeviceDetails.planList.isAdditional`

| Value | Description | Since |
| --- | --- | --- |
| `0` | - | - |
| `1` | - | - |

##### `DeviceDetails.isUseFreeService`

| Value | Description | Since |
| --- | --- | --- |
| `0` | - | - |
| `1` | - | - |

##### `DeviceDetails.isUseCommonUserTrail`

| Value | Description | Since |
| --- | --- | --- |
| `0` | - | - |
| `1` | - | - |

##### `DeviceDetails.isUseCommonDeviceTrail`

| Value | Description | Since |
| --- | --- | --- |
| `0` | - | - |
| `1` | - | - |

##### `DeviceDetails.isTried`

| Value | Description | Since |
| --- | --- | --- |
| `0` | - | - |
| `1` | - | - |


### Examples

#### Request example

```typescript
import { getDeviceDetailsById } from '@tuya-miniapp/cloud-api';

getDeviceDetailsById({
  homeId: '194137',
  uuid: 'vdevo176127325226099',
  categoryCode: 'ipc',
})
  .then((detail) => {
    console.log(detail);
  })
  .catch((err) => {
    console.error(err);
  });
```

#### Response example

```json
{
  "uuid": "vdevo176127325226099",
  "name": "Sample camera",
  "iconUrl": "https://images.example.com/icon.png",
  "online": true
}
```
