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

## reportOutdoorsLocation

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

> 💡 This API is a cloud capability and requires authorization before use. For details on cloud capabilities, see the [documentation](/cn/miniapp/common/desc/tech-stack/api).
> Note: Currently, cloud capabilities are not available in the Developer Tools environment; you must package the app or debug on a real device.

### Description

Device location reporting. This wrapper serializes lon, lat, and optional extension fields into the payload JSON string required by the cloud and submits it.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `ReportOutdoorsLocationParams` | Yes | Request body |

### Return Value

Type: `Promise<boolean>`

boolean: per the documentation, true indicates success and false indicates failure.

### Referenced Types

##### `type` ReportOutdoorsLocationParams

| Property | Type | Description |
| --- | --- | --- |
| `deviceId` | `string` | Device ID |
| `pid` | `string` | Product ID |
| `lat` | `number` | Latitude, e.g., 12.1 |
| `lon` | `number` | Longitude, e.g., 123.1 |
| `accuracy` | `number` | Accuracy, in meters, e.g., 100 |
| `battery` | `number` | Battery level, e.g., 10 |
| `direction` | `number` | Heading value, range [0~360], e.g., 10 |
| `height` | `number` | Altitude, in meters, e.g., 10 |
| `coordinate` | `"GCJ02" \| "BD09LL"` | Coordinate system: GCJ02, BD09LL, etc., e.g., GCJ02 |
| `speed` | `number` | Speed, in km/h, e.g., 100 |
| `mileage` | `number` | Mileage, in km, e.g., 100 |
| `start` | `boolean` | Ignition, true/false, e.g., false |
| `connectStatus` | `1 \| 2` | Connect/Disconnect: 1 or 2, e.g., 1 |


### Examples

#### Request example

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

reportOutdoorsLocation({
  deviceId: 'vdevo16245017293',
  pid: 'p16245017293',
  lat: 12.1,
  lon: 123.1,
  accuracy: 100,
  battery: 10,
  direction: 10,
  height: 10,
  coordinate: 'GCJ02',
  speed: 100,
  mileage: 100,
  start: false,
  connectStatus: 1,
})
  .then((response) => {
    console.log(response);
  })
  .catch();
```

#### Response example

```json
true
```
