Register Device

Last Updated on : 2023-06-20 12:39:04

Register a partner's device in Tuya's ecosystem.

API address

POST: /v1.0/iot-03/3rdcloud/devices/{third_cloud_device_id}/register

Request parameter

Parameter nameTypeINRequiredDescription
third_cloud_device_idStringuritrueThe unique ID of a partner's device. It can be a unique readable identifier of the device, such as device SN, MAC address, or IMEI. It contains only numbers, uppercase letters, and lowercase letters. The length should not exceed 32 characters.

Description of body

Parameter nameTypeINRequiredDescription
device_nameStringbodytrueThe name of the specified device, with no more than 50 characters.
product_idStringbodytrueThe ID of the specified Tuya-enabled device.
optionsObjectbodyfalseThe extension information about the specified device. Valid values:
  • installLocation: installation location.
  • outProjectId: the project ID of the device in the partner cloud.
  • mac: the MAC address.
  • extendData: in JSON format, such as: {"roomNo":"16"}, where roomNo is the hotel room number.
bind_typeEnumbodyfalseThe binding type. Valid values:
  • HOME: Bind the specified device with a home.
  • ASSET: Bind the specified device with an asset.
group_idStringbodyfalseThe binding ID, which can be the home ID or asset ID. The binding ID corresponds to the bind_type field.
has_qrcodeBooleanbodyfalseSpecifies whether or not to generate a short URL for device pairing. If this parameter is selected, the short URL for device pairing will be returned in the response result. The manufacturer can generate a QR code based on the returned short URL and paste it on the device. After getting the device, a user can use a Tuya-enabled app to scan the QR code on the device, and thus bind the device with the user.

Return parameter

Parameter nameTypeDescription
resultObjectThe response result.
codeStringThe response code. It is empty when the request succeeded.
msgStringThe message that is returned if the request fails. It is empty if the request is successful.
successBooleanIndicates whether the request is successful. Valid values:
  • true: success.
  • false: failure.
tLongThe 13-digit timestamp of a response.

Description of result

Parameter nameTypeDescription
device_idStringThe ID of the specified Tuya-enabled device.
short_urlStringThe short URL for device pairing.

Request example

POST: /v1.0/iot-03/3rdcloud/devices/A18007210830****/register
  "device_name": "Test Device",
  "product_id": "xz0uukkq5oce****",
  "options": {
    "mac": "48ea63fd****",
    "installLocation": "****Jiangdun Road, Xihu District, Hangzhou City",

Return example

    "result": {
        "device_id": "6cf4171005d11e2ca7****"
    "t": 1561456817168,
    "success": true

Error code

For more information, see error code.