---
title: "Upsert dynamic prices on a DYNAMIC tariff."
method: PATCH
path: "/api/v1/tariffs/{tariffId}/dynamic-prices"
tags: ["Tariff"]
---

# Upsert dynamic prices on a DYNAMIC tariff.

`PATCH /api/v1/tariffs/{tariffId}/dynamic-prices`

Bulk-upserts price-interval entries on a `DYNAMIC` tariff. All entries in one request share the same `resolution` and `source`. The conflict key is `(timeStart, resolution)` — re-submitted entries update their `price`, `timeEnd`, and `source` in place.<br/><br/>The operation is **all-or-nothing**: if any entry is misaligned to its resolution grid, has the wrong interval length, or duplicates a `timeStart` within the request body, the entire batch is rejected with `400 BAD_REQUEST` and no rows are written. Maximum 5000 entries per request.<br/><br/>Returns `204 No Content` on success.<br/><br/>Clients may send an `Idempotency-Key` header for safe retry semantics; the header is currently accepted and ignored (no enforcement yet).<br/><br/>Required scope: `tariffs:write`

## Path parameters

- `tariffId` integer, required

## Headers

- `Idempotency-Key` union
  - string
  - string

## Request body

- PatchDynamicPricesRequest — Bulk-upsert dynamic price entries on a DYNAMIC tariff. All entries in one request share the same `resolution` and `source`. The operation is all-or-nothing: if any entry is misaligned, mis-sized, or duplicated, the entire batch is rejected with 400.
  - `resolution` 'quarter-hour' | 'half-hour' | 'hour', required — Time granularity of a dynamic price entry.
  - `source` 'dagster' | 'manual' | 'dso-import', required — Origin of a dynamic price entry.
  - `prices` DynamicPriceEntry[], required — Price-interval entries to upsert. Each entry's `(timeStart, resolution)` is the conflict key — a re-submitted entry updates `price`, `timeEnd`, and `source` in place. Max 5000 entries per request.
    - `timeStart` string, date-time, required — Inclusive start of the price interval (UTC, RFC 3339). Must align to the batch `resolution` grid.
    - `timeEnd` string, date-time, required — Exclusive end of the price interval (UTC, RFC 3339). `timeEnd - timeStart` must equal the batch `resolution`.
    - `price` number, required — Non-negative price per kWh in the parent tariff's currency. Up to 4 decimal places.

## Response `204`

Prices upserted

## Other responses

- `400` — The tariff is not DYNAMIC, or an entry is misaligned, mis-sized, or duplicates a timeStart
- `401` — Consumer with provided credentials was not found
- `403` — Operator doesn't have access to resource
- `404` — Tariff not found or not visible to this consumer

---

[API](https://skmtc.net/monta/apis/monta-partner-api.md) · [All operations](https://skmtc.net/monta/apis/monta-partner-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/monta/monta-partner-api/versions/517e18f11015/schema)
