Skip to main content
POST
/
schedules
/
limit
Schedule by price limit
curl --request POST \
  --url https://api.flatpeak.com/schedules/limit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "location_id": "loc_641b90b758fb8e6293716e40",
  "start_time": "2023-06-15T09:00:00Z",
  "end_time": "2023-06-16T09:00:00Z",
  "segment": "HIGH",
  "device_id": "dev_63a6087272941ef077a8fd3e",
  "tariff_direction": "IMPORT",
  "relative": 0.1,
  "absolute": 0.17
}
'
{
  "device_id": "dev_63a6087272941ef077a8fd3e",
  "location_id": "loc_65e42ce4d3b813479b252160",
  "id": "spl_65e42cdd73e9f861edda35d7",
  "object": "schedule_limit",
  "account_id": "acc_661677911f2197045e6cf1b1",
  "live_mode": true,
  "location_timezone": "Europe/London",
  "currency_code": "EUR",
  "tariff_direction": "IMPORT",
  "duration": 180,
  "data": [
    {
      "start_time": "2022-12-28T01:00:00Z",
      "end_time": "2022-12-28T02:30:00Z",
      "price": {
        "confidence": 1,
        "value": 4.998
      },
      "vpp_event": false
    }
  ],
  "next_update": "2022-05-24T23:00:00Z",
  "time_created": "2022-05-24T15:15:22Z"
}

Authorizations

Authorization
string
header
required

Authenticate with bearer you obtained from authentication endpoint.

Body

application/json
location_id
string
required

Flatpeak Location ID

Example:

"loc_641b90b758fb8e6293716e40"

start_time
string<date-time>
required

RFC 3339 timestamp marking the start of the data window, e.g. 2023-06-15T09:00:00Z or 2023-06-15T08:00:00+01:00; use either UTC or time offset—if offsets differ, end_time takes precedence.

Example:

"2023-06-15T09:00:00Z"

end_time
string<date-time>
required

RFC 3339 timestamp marking the start of the data window, e.g. 2023-06-15T09:00:00Z or 2023-06-15T08:00:00+01:00; use either UTC or time offset—if offsets differ, end_time takes precedence. The maximum period between start_time and end_time for a single request is 3 days.

Example:

"2023-06-16T09:00:00Z"

segment
string
required

Set to HIGH to get the most expensive rate segment and to LOW to get the cheapest segment.

Example:

"HIGH"

device_id
string

Flatpeak Device ID

Example:

"dev_63a6087272941ef077a8fd3e"

tariff_direction
string

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

Example:

"IMPORT"

relative
number

Relative tariff threshold. The highest tariff is 1, and the lowest is 0.01. Either relative or absolute must be provided.

Example:

0.1

absolute
number
default:0.17

Absolute tariff threshold in local currency. Either absolute or relative must be provided. Absolute threshold overrides relative if it was provided. Use major currency units.

Response

Response example

This object is a container for tariff rate segments.

device_id
string
required

Flatpeak device ID.

Example:

"dev_63a6087272941ef077a8fd3e"

location_id
string
required

The unique Flatpeak ID of the location.

Example:

"loc_65e42ce4d3b813479b252160"

id
string
required

Flatpeak unique object id.

Example:

"spl_65e42cdd73e9f861edda35d7"

object
string
required

Represents the object's type.

Example:

"schedule_limit"

account_id
string
required

Flatpeak account ID.

Example:

"acc_661677911f2197045e6cf1b1"

live_mode
boolean
required

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

location_timezone
string
required

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

Example:

"Europe/London"

currency_code
string
required

Currency at the location in ISO 4217.

Example:

"EUR"

tariff_direction
string
required

Direction of tariff. Supported options are IMPORT, EXPORT and LOCAL.

Example:

"IMPORT"

duration
number
required

Total amount of time in minutes for all calculated slots.

Example:

180

data
object[]
required

Rates response data.

next_update
string
required

Time when we recommend fetching new rates. In the format of the request, e.g. UTC or time-offset.

Example:

"2022-05-24T23:00:00Z"

time_created
string<date-time>
required

Time when this response was calculated. In UTC.

Example:

"2022-05-24T15:15:22Z"