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

## getServiceDetail

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

### Method signature

```typescript
getServiceDetail(params: QueryServiceDetailDto)
```

### Description

Service details

### Parameters

`Params`

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

### Return Value

Type: `Promise<ServiceDetailDto>`

Service details (see ServiceDetailDto; contains more fields than the minituya brief table; use the type as the reference)

### Referenced Types

##### `type` QueryServiceDetailDto

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `homeId` | `string` | Yes | Home ID |
| `stockId` | `string` | Yes | Inventory ID |

##### `interface` ServiceDetailDto

| Property | Type | Description |
| --- | --- | --- |
| `subscribeId` | `string` | Subscription ID |
| `planId` | `string` | Future payment plan ID |
| `instanceList` | `DeviceInfo[]` | List of devices bound to cloud storage |
| `supportCancel` | `0 \| 1` | Whether cancellation is supported 0: not supported; 1: supported |
| `isPublish` | `0 \| 1` | Listing status of the product associated with the service |
| `additionalUuid` | `string` | UUID bound to the root device service |
| `hasAigcProtectService` | `boolean` | Whether the service allows Smart Cube capabilities |
| `categoryCode` | `string` | Service category |
| `cloudService` | `CloudService` | Cloud service binding/usage overview (optional) |
| `cover` | `string` | Cover |
| `commodityName` | `string` | Plan name |
| `stockId` | `string` | Purchased inventory ID |
| `commodityCode` | `string` | Plan code |
| `duration` | `number` | Service period |
| `durationDesc` | `string` | String representation of the service period |
| `serviceBeginTime` | `number` | Service start time |
| `serviceEndTime` | `number` | Service expiration time |
| `isSubscribe` | `0 \| 1` | Whether this is a subscription product |
| `isFuturePayments` | `0 \| 1` | Whether payment is scheduled for the future |
| `isCanceled` | `0 \| 1` | Whether the subscription has been canceled 0: not canceled; 1: canceled |
| `stockStatus` | `StockStatus` | Activation status 1: not activated; 2: active |
| `isAdditional` | `1 \| 0` | Whether the service is bundled with the device |

##### `type` DeviceInfo

| Property | Type | Description |
| --- | --- | --- |
| `productId` | `string` | Product ID |
| `planList` | `PlanInfoDto[]` | Device service plan list |
| `isUseFreeService` | `0 \| 1` | Whether a subscription product with a free initial period has been purchased (0: not purchased; 1: purchased) |
| `isUseCommonUserTrail` | `0 \| 1` | Whether an account-level free standard trial product has been purchased (0: not purchased; 1: purchased) |
| `isUseCommonDeviceTrail` | `0 \| 1` | Whether a device-level free standard trial product has been purchased (0: not purchased; 1: purchased) |
| `isTried` | `0 \| 1` | Whether the product trial has been used (0: not used; 1: used) |
| `hasServiceOrder` | `boolean` | Whether a service ticket exists |
| `icon` | `string` | Device icon |
| `name` | `string` | Device name |
| `ownerId` | `string` | Home ID |
| `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 |


### Valid Values

##### `ServiceDetailDto.instanceList.isUseFreeService`

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

##### `ServiceDetailDto.instanceList.isUseCommonUserTrail`

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

##### `ServiceDetailDto.instanceList.isUseCommonDeviceTrail`

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

##### `ServiceDetailDto.instanceList.isTried`

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

##### `ServiceDetailDto.supportCancel`

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

##### `ServiceDetailDto.isPublish`

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

##### `ServiceDetailDto.isSubscribe`

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

##### `ServiceDetailDto.isFuturePayments`

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

##### `ServiceDetailDto.isCanceled`

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

##### `ServiceDetailDto.isAdditional`

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


### Examples

#### Request example

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

getServiceDetail({ homeId: '194137', stockId: 'stock-1' })
  .then((d) => console.log(d))
  .catch(console.error);
```

#### Response example

```json
{
  "cover": "https://images.example.com/cover.jpg",
  "commodityName": "Cloud Storage Monthly Plan",
  "stockId": "stock-1",
  "commodityCode": "CLOUD_30D",
  "duration": 30,
  "durationDesc": "30 days",
  "stockStatus": 2,
  "isSubscribe": 1,
  "isFuturePayments": 0,
  "additionalUuid": "uuid-root",
  "categoryCode": "ipc",
  "isPublish": 1,
  "cloudService": { "bindDeviceNum": 1, "totalDevices": 2 }
}
```
