---
title: "Create or updates a location price formula"
method: POST
path: "/locations/{locationId}/priceformulas"
tags: ["Location price formulas"]
---

# Create or updates a location price formula

`POST /locations/{locationId}/priceformulas`

## Request

- Base URL: `https://eliq.data-management-api.eliq.com` (the document declares no server; this is the origin it was published from)
- URL: `https://eliq.data-management-api.eliq.com/locations/{locationId}/priceformulas`
- Auth: none declared
- TypeScript: <https://skmtc.dev/eliq/apis/eliq-data-management-api/docs/locations/:locationId/priceformulas/post.ts> (a function with typed inputs; its response is checked against the schema)

Note! A contract for a location is unique by the from date. Adding a price formula for a location with the same from date as an already
existing price formula will overwrite the existing price formula.

## Path parameters

- `locationId` string, required

## Request body

- LocationPriceFormula
  - `fuel` string, nullable
  - `source` string, nullable
  - `name` string, nullable
  - `direction` string, nullable
  - `from` string, nullable
  - `to` string, nullable
  - `currency_code` string, nullable
  - `elements` Element[], nullable
    - `name` string, nullable
    - `type` string, nullable
    - `charge` Charge
      - `resolution` string, nullable
      - `charge` number, double, nullable
      - `type` string, nullable
      - `capacity_tariff` CapacityTariff
        - `charge_tariff` number, double
        - `minimum_contribution` number, double
        - `calculation_type` string, nullable
    - `unit_rate` UnitRate
      - `type` string, nullable
      - `fixed` Fixed
        - `unit_rate` number, double, nullable
      - `tou` Tou
        - `register_id` string, nullable
        - `unit_rate` number, double, nullable
        - `intervals` Interval[], nullable
          - `from_minute` integer, nullable
          - `to_minute` integer, nullable
        - `skip_intervals` boolean, nullable
      - `block` Block
        - `resolution` string, nullable
        - `register_id` string, nullable
        - `unit_rate` number, double
        - `from_kwh` integer, nullable
        - `to_kwh` integer, nullable
        - `from_m3` integer, nullable
        - `to_m3` integer, nullable
      - `spot_price` SpotPrice
        - `provider` string, nullable
        - `region` string, nullable
        - `resolution` string, nullable
        - `multiplier` number, double, nullable
      - `weekdays` string[], nullable
  - `price_multiplier` number, double, nullable

## Response `200`

OK

- LocationPriceFormula
  - `fuel` string, nullable
  - `source` string, nullable
  - `name` string, nullable
  - `direction` string, nullable
  - `from` string, nullable
  - `to` string, nullable
  - `currency_code` string, nullable
  - `elements` Element[], nullable
    - `name` string, nullable
    - `type` string, nullable
    - `charge` Charge
      - `resolution` string, nullable
      - `charge` number, double, nullable
      - `type` string, nullable
      - `capacity_tariff` CapacityTariff
        - `charge_tariff` number, double
        - `minimum_contribution` number, double
        - `calculation_type` string, nullable
    - `unit_rate` UnitRate
      - `type` string, nullable
      - `fixed` Fixed
        - `unit_rate` number, double, nullable
      - `tou` Tou
        - `register_id` string, nullable
        - `unit_rate` number, double, nullable
        - `intervals` Interval[], nullable
          - `from_minute` integer, nullable
          - `to_minute` integer, nullable
        - `skip_intervals` boolean, nullable
      - `block` Block
        - `resolution` string, nullable
        - `register_id` string, nullable
        - `unit_rate` number, double
        - `from_kwh` integer, nullable
        - `to_kwh` integer, nullable
        - `from_m3` integer, nullable
        - `to_m3` integer, nullable
      - `spot_price` SpotPrice
        - `provider` string, nullable
        - `region` string, nullable
        - `resolution` string, nullable
        - `multiplier` number, double, nullable
      - `weekdays` string[], nullable
  - `price_multiplier` number, double, nullable

## Other responses

- `400`: Bad Request
- `404`: Not Found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/eliq/apis/eliq-data-management-api.md) - [All operations](https://skmtc.dev/eliq/apis/eliq-data-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/eliq/apis/eliq-data-management-api/revisions/022af911e0d0?raw)
