# Replace tariffs

`PUT https://api.parklio.com/v2/tariffs/{id}`

This endpoint allows the user to replace tariffs by id

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

## Path parameters

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

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `group_ids` | number[] | yes | IDs of the groups this tariff applies to |
| `name` | string | yes | Name of the tariff |
| `description` | string | yes | Description of the tariff |
| `start_time` | string | yes | Date and time from which the tariff becomes active. The tariff is not applied before this timestamp. |
| `end_time` | string | yes | Date and time until which the tariff remains active. The tariff is not applied after this timestamp. |
| `season_start` | string | no | Seasonal start date of the tariff. Only the day and month are evaluated; the year is ignored. The tariff is applied only within this day–month range each year. |
| `season_end` | string | no | Seasonal end date of the tariff. Only the day and month are evaluated; the year is ignored. The tariff is applied only within this day–month range each year. |
| `interval` | number | yes | Charging interval in minutes (minimum 15) |
| `price` | number | yes | Base price for the interval |
| `exit_free_time_interval` | number | yes | Exit free time in minutes |
| `entry_free_time_interval` | number | yes | Entry free time in minutes |
| `maxima` | number | yes | Maximum price allowed for the tariff |
| `max_time_of_stay` | number | yes | Maximum time of stay in minutes |
| `gratis_time` | number | yes | Gratis time in minutes before charging starts |
| `currency_id` | number | yes | Currency ID (e.g., 1 = EUR) |
| `price_progression_type` | string (`flat`, `linear`, `exponential`, `incremental`) | yes | How the price increases (flat, linear, etc.) |
| `max_affected_members_per_group` | number | yes | Maximum amount of users that will be affected by this tariff |
| `schedules` | object[] | yes |  |

```json
{
  "group_ids": [
    2,
    9
  ],
  "name": "Weekend Special",
  "description": "Special pricing for weekends only",
  "start_time": "2026-01-15T09:30:00.000Z",
  "end_time": "2026-01-15T09:30:00.000Z",
  "season_start": "2026-01-15T09:30:00.000Z",
  "season_end": "2026-01-15T09:30:00.000Z",
  "interval": 15,
  "price": 2.5,
  "exit_free_time_interval": 10,
  "entry_free_time_interval": 5,
  "maxima": 20,
  "max_time_of_stay": 240,
  "gratis_time": 30,
  "currency_id": 1,
  "price_progression_type": "flat",
  "max_affected_members_per_group": 20,
  "schedules": [
    {
      "weekday": 0,
      "start_time": "08:00:00",
      "end_time": "17:00:00"
    }
  ]
}
```

## Responses

### 200

```json
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Standard Day Tariff",
    "description": "Applies during regular business hours",
    "start_time": "2026-01-15T09:30:00.000Z",
    "end_time": "2026-01-15T09:30:00.000Z",
    "season_start": "2020-01-01",
    "season_end": "2020-12-01",
    "interval": 60,
    "price": 200,
    "exit_free_time_interval": 10,
    "entry_free_time_interval": 5,
    "maxima": 2000,
    "max_time_of_stay": 480,
    "gratis_time": 20,
    "currency": "EUR",
    "price_progression_type": "linear",
    "account_id": 1,
    "schedules": [
      {
        "id": 1,
        "weekday": 1,
        "start_time": "08:00",
        "end_time": "18:00"
      }
    ],
    "max_affected_members_per_group": 20,
    "zones": [
      {
        "id": 1,
        "name": "Premium Parking Zone"
      }
    ],
    "groups": [
      {
        "id": 5,
        "name": "Employees"
      }
    ]
  }
}
```

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

