# Patch a product

`PATCH https://api.parklio.com/v2/products/{id}`

This endpoint allows the user to patch a product assigned to his account

**Auth:** `Authorization: Bearer <token>`

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | The user set product name |
| `longitude` | number | no | The product longitude, acquired during setup |
| `latitude` | number | no | The product latitude, acquired during setup |
| `zone_id` | number | no | The the id of the target zone where we want to move the product |

```json
{
  "name": "B123456",
  "longitude": 16.450813293,
  "latitude": 43.52652359,
  "zone_id": 0
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "product_error": {
      "id": 0,
      "jammed": 0,
      "sensor_dirty": 0,
      "pin_broken": 0,
      "rtcc_invalid": 0,
      "battery_empty": 0,
      "master_key_not_set": 0,
      "deleted_at": null,
      "created_at": "2026-01-15T09:30:00.000Z",
      "updated_at": "2026-01-15T09:30:00.000Z",
      "error_code": "string"
    },
    "id": 0,
    "device_id": "B123456",
    "name": "B123456",
    "power_type": "battery",
    "lot_id": 0,
    "zone_id": 0,
    "product_type_id": 2,
    "hardware_version": "1.0.0",
    "firmware_version": "1.0.0",
    "latitude": 43.52652359,
    "longitude": 16.450813293,
    "status": "online",
    "advertisement_data": "string",
    "battery_status": null,
    "product_error_id": null,
    "rssi": null,
    "created_at": "2026-01-15T09:30:00.000Z",
    "updated_at": "2026-01-15T09:30:00.000Z",
    "barrier": {
      "id": 0,
      "product_id": 0,
      "state": "opened",
      "is_autoclose": 0,
      "is_car_on_top": 0,
      "autoclose_time": 0,
      "created_at": "2026-01-15T09:30:00.000Z",
      "updated_at": "2026-01-15T09:30:00.000Z"
    },
    "gate": {
      "id": 0,
      "product_id": 0,
      "state": "closed",
      "permanent_position": "disabled",
      "deleted_at": null,
      "created_at": "2026-01-15T09:30:00.000Z",
      "updated_at": "2026-01-15T09:30:00.000Z"
    },
    "chain": {
      "id": 0,
      "product_id": 0,
      "state": "closed",
      "permanent_position": "disabled",
      "deleted_at": null,
      "created_at": "2026-01-15T09:30:00.000Z",
      "updated_at": "2026-01-15T09:30:00.000Z"
    },
    "bollard": {
      "id": 0,
      "product_id": 0,
      "state": "closed",
      "permanent_position": "disabled",
      "deleted_at": null,
      "created_at": "2026-01-15T09:30:00.000Z",
      "updated_at": "2026-01-15T09:30:00.000Z"
    },
    "brain": {
      "id": 0,
      "product_id": 0,
      "state": "closed",
      "permanent_position": "disabled",
      "deleted_at": null,
      "created_at": "2026-01-15T09:30:00.000Z",
      "updated_at": "2026-01-15T09:30:00.000Z"
    }
  }
}
```

### 400 — Cannot be moved between different lots.

```json
{
  "success": false,
  "errors": [
    {
      "code": 1000,
      "message": "Cannot move to different lot."
    }
  ]
}
```

### 401 — Account user is not logged in and they should log in again.

```json
{
  "success": false,
  "errors": [
    {
      "code": 1,
      "message": "Unauthorized access."
    }
  ]
}
```

### 403 — User does not have permission to access requested resource.

```json
{
  "success": false,
  "errors": [
    {
      "code": 4,
      "message": "No permission."
    }
  ]
}
```

### 404 — Resource that has been requested does not exist. User should not try to repeat this request.

```json
{
  "success": false,
  "errors": [
    {
      "code": 6,
      "message": "Resource not found."
    }
  ]
}
```

### 422 — Some of the provided request parameters are missing or are invalid. User should add/change them according to response message.

```json
{
  "success": false,
  "errors": [
    {
      "code": 23,
      "message": "Validation error",
      "field": "field"
    }
  ]
}
```

