POST
/
costs
/
interval
/
{id}
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-11-07T05:31:56Z"
}'
{
  "id": "ecs_65ea3fb185c1541f247c251e",
  "object": "energy_cost",
  "object_id": "dev_65e6d8334c8d715963d99db3",
  "live_mode": true,
  "direction": "IMPORT",
  "currency_code": "EUR",
  "energy_units": "WH",
  "carbon_units": "gCO2eq",
  "data": [
    {
      "start_time": "2022-02-01T10:30:00Z",
      "end_time": "2022-02-01T11:00:00Z",
      "session_reference_id": "SESSION1234567890",
      "record_reference_id": "MET1234567890",
      "energy": {
        "value": 10284
      },
      "tariff": {
        "value": 928.372,
        "confidence": 1
      },
      "carbon": {
        "value": 35.24,
        "confidence": 0.8
      }
    }
  ]
}

Authorizations

Authorization
string
headerrequired

Authenticate with bearer_token you obtained from /login endpoint.

Path Parameters

id
string
required

FlatPeak location_id or device_id.

Query Parameters

aggregation
string

Aggregation interval, supported values are DAY, MONTH.

direction
string
default: IMPORT

Indicates direction you want to work with. Set to IMPORT or EXPORT.

include_tariff
boolean

Set to true if you want to include tariff data.

include_carbon
boolean

Set to true if you want to include carbon intensity data.

Body

application/json
start_time
string

Period start time.

end_time
string

Period end time.

Response

200 - application/json
id
string

FlatPeak unique object ID that represents this response.

object
string

FlatPeak object type. I.e. meter_value_interval.

object_id
string

FlatPeak object location_id or device_id cost data is for.

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.

direction
string

Indicates energy direction. Supported values are IMPORT and EXPORT.

currency_code
string

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

energy_units
string

Units of energy measure.

carbon_units
string

Units of carbon emissions measure.

data
object[]