getServiceDetail(params: QueryServiceDetailDto)

Requires:
@tuya-miniapp/cloud-api≥1.0.5

Description

Service details

Parameters

ParameterTypeRequiredDescription
YesRequest 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

interfaceServiceDetailDto
PropertyTypeDescription
subscribeIdstringSubscription ID
planIdstringFuture payment plan ID
List of devices bound to cloud storage
supportCancel0 | 1Whether cancellation is supported
0: not supported; 1: supported
isPublish0 | 1Listing status of the product associated with the service
additionalUuidstringUUID bound to the root device service
hasAigcProtectServicebooleanWhether the service allows Smart Cube capabilities
categoryCodestringService category
cloudServiceCloudServiceCloud service binding/usage overview (optional)
coverstringCover
commodityNamestringPlan name
stockIdstringPurchased inventory ID
commodityCodestringPlan code
durationnumberService period
durationDescstringString representation of the service period
serviceBeginTimenumberService start time
serviceEndTimenumberService expiration time
isSubscribe0 | 1Whether this is a subscription product
isFuturePayments0 | 1Whether payment is scheduled for the future
isCanceled0 | 1Whether the subscription has been canceled
0: not canceled; 1: canceled
stockStatusStockStatusActivation status
1: not activated; 2: active
isAdditional1 | 0Whether the service is bundled with the device

Valid Values

ServiceDetailDto.instanceList.isUseFreeService
ValueDescriptionSince
0--
1--
ServiceDetailDto.instanceList.isUseCommonUserTrail
ValueDescriptionSince
0--
1--
ServiceDetailDto.instanceList.isUseCommonDeviceTrail
ValueDescriptionSince
0--
1--
ServiceDetailDto.instanceList.isTried
ValueDescriptionSince
0--
1--
ServiceDetailDto.supportCancel
ValueDescriptionSince
0--
1--
ServiceDetailDto.isPublish
ValueDescriptionSince
0--
1--
ServiceDetailDto.isSubscribe
ValueDescriptionSince
0--
1--
ServiceDetailDto.isFuturePayments
ValueDescriptionSince
0--
1--
ServiceDetailDto.isCanceled
ValueDescriptionSince
0--
1--
ServiceDetailDto.isAdditional
ValueDescriptionSince
1--
0--

Examples

Request example

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

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

Response example

{
  "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 }
}