Skip to main content
POST
/
costs
/
interval
/
{id}
Report historic energy cost
curl --request POST \
  --url https://api.flatpeak.com/costs/interval/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "start_time": "2023-11-07T05:31:56Z",
  "end_time": "2023-12-07T05:31:56Z"
}
'
{
  "message": "Connect is processing link to tariff source."
}

Authorizations

Authorization
string
header
required

Authenticate with bearer you obtained from authentication endpoint.

Path Parameters

id
string
required

Flatpeak location_id or device_id.

Query Parameters

aggregation
string

Aggregation interval, supported values are DAY, MONTH.

Example:

"MONTH"

tariff_direction
string

Specified tariff direction. Possible values are IMPORT, EXPORT or LOCAL.

Body

application/json
start_time
string<date-time>

Period start time. In RFC3339 format e.g. 2023-06-15T09:00:00Z or with time-offset, e.g. 2023-06-15T08:00:00+01:00.

Example:

"2023-11-07T05:31:56Z"

end_time
string<date-time>

Period end time. In RFC3339 format e.g. 2023-06-15T09:00:00Z or with time-offset, e.g. 2023-06-15T08:00:00+01:00.

Example:

"2023-12-07T05:31:56Z"

Response

account_id
string
required

Flatpeak account id.

Example:

"acc_661677911f2197045e6cf1b1"

id
string

Flatpeak unique object ID that represents this response.

Example:

"ecs_65ea3fb185c1541f247c251e"

object
string

Flatpeak object type. I.e. energy_cost.

Example:

"energy_cost"

object_id
string

Flatpeak object location_id or device_id cost data is for.

Example:

"dev_65e6d8334c8d715963d99db3"

live_mode
boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

tariff_direction
string

Specified tariff direction. Possible values are IMPORT, EXPORT or LOCAL.

Example:

"IMPORT"

location_timezone
string

The timezone at the location, in 'tz database format'. I.e. 'Europe/Berlin'.

Example:

"Europe/London"

currency_code
string

Currency code for cost of energy measure. Always returned in large currency units.

Example:

"EUR"

energy_units
string

Units of energy measure.

Example:

"WH"

data
object[]