# Create qr codes

`POST https://api.parklio.com/v2/qr-codes`

This endpoint allows the user to create qr codes

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `product_id` | number | yes | ID of the product to associate with this QR code |
| `start_time` | string | yes | The date and time from which the QR code becomes active, in ISO 8601 format |
| `end_time` | string | no | The date and time at which the QR code expires, in ISO 8601 format. If omitted, the QR code does not expire |
| `timezone` | string | yes | Timezone offset used to interpret the start and end times, in ±HH:MM format |
| `description` | string | no | Optional description explaining the purpose of the QR code. Max 255 characters |

```json
{
  "product_id": 1,
  "start_time": "2026-01-15T09:30:00.000Z",
  "end_time": "2026-01-15T09:30:00.000Z",
  "timezone": "+01:00",
  "description": "Guest parking access for Building A"
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 1,
    "account_id": 1,
    "account_user_id": 1,
    "product_id": 1,
    "device_id": "B123456",
    "uuid": "2b26e2e4-51c5-4d29-bb2b-12762245e9b3",
    "token": "PGiTTPbwYSwQoJYETV7B5SYc710C2RjQwpGUMrKT0Qf4IS2RUFT7yskcfeyXyKmX",
    "start_time": "2026-01-15T09:30:00.000Z",
    "end_time": "2026-01-15T09:30:00.000Z",
    "description": "Guest parking access for Building A",
    "created_at": "2026-01-15T09:30:00.000Z",
    "updated_at": "2026-01-15T09:30:00.000Z",
    "deleted_at": null
  }
}
```

### 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"
    }
  ]
}
```

