Calculating your customer's energy cost
To enable you to access any tariff currently offered on the planet via a single API - including complex time of use, consumption tier and dynamic market-based - we had to come up with a data model that can universally support both static and dynamic tariff types. This is why we provide tariff as a time series feed that you may find time-consuming to implement or expensive to run (in terms of data storage and processing).
While you are free to access this raw tariff data via our /tariff-rates API endpoint, FlatPeak can also calculate the cost of energy using that tariff, saving you many hours of development and data storage costs, for this, you will use /cost-calculate endpoint.
Using cost calculation endpoints
Cost calculations API is a group of endpoints that ingests meter records and returns the monetary cost of energy. In this example, we will cover the instant cost calculation endpoint, but you can also explore using separate metering, time-interval and session-based cost calculation that may better fit your use case.
Here is how to plan your integration to use instant cost calculation API endpoints:
- Implement FlatPeak Connect to get consent from your customer to access their tariff and obtain FlatPeak
locaiton_id
for their supply address. - If you plan to calculate energy cost for a specific device, register it via device-create endpoint to obtain FlatPeak
device_id
. - Prepare location or device metering record and call instant-cost-calculate endpoint to get the monetary cost of energy.
Using tariff rates endpoint
This endpoint returns live tariff rates by FlatPeak location_id
in time series format.
Here is how to plan your integration to use tariff rates endpoint:
- Implement FlatPeak Connect to get consent from your customer to access their tariff and obtain FlatPeak
locaiton_id
for their supply address. - Call tariff-rates endpoint to get your Customer’s tariff. Because FlatPeak provides this data in time-series format, you will need to call this endpoint for every time period when you need to calculate the energy cost.
While using the tariff rates endpoint provides you with maximum flexibility in storing and using tariff data, we recommend you consider cost calculation endpoint that you may find much quicker to implement.
Was this page helpful?