Skip to main content
POST
/
power-tariffs
/
{tariff_uid}
/
calculate
Calculate Cost
curl --request POST \
  --url https://api.engrate.io/v1/power-tariffs/{tariff_uid}/calculate \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "powerOfftake": {
    "fromDatetime": "2023-11-07T05:31:56Z",
    "values": [
      123
    ]
  },
  "subscribedCapacities": [
    {
      "fromDatetime": "2023-11-07T05:31:56Z",
      "toDatetime": "2023-11-07T05:31:56Z",
      "value": 123
    }
  ]
}
'
{
  "currency": "SEK",
  "totalCost": 123
}

Authorizations

Authorization
string
header
required

Path Parameters

tariff_uid
string<uuid>
required

UUID of the power tariff to calculate the cost with.

Example:

"123e4567-e89b-12d3-a456-426614174000"

Body

application/json
powerOfftake
PowerOfftakeTimeseries · object

Power offtake timeseries data in kW.

Only relevant if the tariff contains peak power fees or overdraft penalties.

Note that the timeseries is defined by:

  • a start datetime
  • a list of consecutive hourly values

This is done to keep the payload size as small as possible, as well as to avoid gaps and resolution mismatches.

subscribedCapacities
SubscribedCapacity · object[] | null

Subscribed capacities ("abonnerad effekt") in kW over time. Only relevant if the tariff contains subscription fees or overdraft penalties.

Response

Successful Response

currency
enum<string>
required

Currency code for the calculated amounts, in ISO 4217 format.

Available options:
SEK
Example:

"SEK"

totalCost
number
required

Total cost for the entire calculation request period (excl. VAT).

Example:

150.75