---
name: "closeDoor"
mode: "api"
versionRequirements:
  - { name: "@ray-js/lock-sdk", version: "1.0.0" }
title: "closeDoor - Lock the door."
summary: "Lock the door."
---

## closeDoor

> [VERSION] @ray-js/lock-sdk >= 1.0.0

### Description

Lock

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `option` | `OpenDoorCallOptions` | No | Locking call options (e.g., timeout for waiting for device report) |

### Return Value

Type: `Promise<void>`

None

### Error Codes

| Error Code | Error Message |
| --- | --- |
| `1001` | Device is offline |
| `1064` | Non‑Thread devices do not support LAN lock/unlock |
| `1045` | Remote unlocking not supported |
| `1046` | Remote unlocking not enabled |
| `1047` | No permission to unlock |
| `1002` | Operation timed out |
| `1003` | Remote unlocking failed (cloud invocation error) |
| `1004` | Device reported unlock failure |
| `1005` | Remote unlocking failed (key invalidated) |
| `1006` | Key usage limit reached |
| `1007` | Key not within validity period |
| `1008` | Invalid key |

### Referenced Types

##### `interface` OpenDoorCallOptions

| Property | Type | Description |
| --- | --- | --- |
| `timeout` | `number` | Timeout for waiting for device reports (ms), default 15000 ms |


### Examples

```ts
import { closeDoor } from '@ray-js/lock-sdk';
await closeDoor();
```
