Skip to main content
GET
/
locations
List all locations
curl --request GET \
  --url https://api.flatpeak.com/locations \
  --header 'Authorization: Bearer <token>'
{
  "object": "list",
  "url": "/locations",
  "has_more": true,
  "data": [
    {
      "id": "loc_641b90b758fb8e6293716e40",
      "object": "location",
      "live_mode": true,
      "time_created": "2023-11-07T05:31:56Z",
      "account_id": "acc_661677911f2197045e6cf1b1",
      "reference_id": "LOC1234567890",
      "customer_id": "cus_65e421d1daa4a24082b4f590",
      "timezone": "Europe/London",
      "currency_code": "EUR",
      "postal_address": {
        "address_line1": "1-3",
        "address_line2": "Strand",
        "city": "London",
        "state": "NSW",
        "post_code": "WC2N 5EH",
        "country_code": "GB"
      },
      "geo_location": {
        "lat": 50.12345,
        "lng": -1.23456
      },
      "consents": {
        "provider_tariff": true,
        "provider_bills": true,
        "provider_postal_address": true,
        "provider_grid_meter": true,
        "device_telemetry": true,
        "device_control": true,
        "time_created": "2022-03-22T11:12:21Z"
      },
      "tariffs": [
        {
          "tariff_id": "trf_66ba584eb6923d7c3b942ef6",
          "location_id": "loc_641b90b758fb8e6293716e40",
          "type": "COMMODITY",
          "direction": "IMPORT",
          "status": "CONNECTED",
          "connection_type": "DIRECT",
          "display_name": "Agile Octopus v3 2024",
          "is_temporary": true,
          "provider": {
            "id": "prv_63a6087272921ef075a8fd3e",
            "display_name": "Octopus Energy",
            "logo_url": "https://s.flatpeak.com/83b06a60e38c2.png"
          }
        }
      ],
      "devices": [
        "dev_63a6087272941ef077a8fd3e"
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Authenticate with bearer you obtained from authentication endpoint.

Query Parameters

reference_id
string

A reference that is meaningful to you, for example, an ID from your system.

customer_id
string

Flatpeak customer_id.

Example:

"cus_65e421d1daa4a24082b4f590"

starting_after
string

Specifies a cursor for pagination use; defines the place in the list. To retrieve the next page in the list include starting_after where ID is the last ID in the currently retrieved list.

limit
integer

A limit on the number of objects to be returned. Can range between 1 and 100, and the default is 30.

ending_before
string

Specifies a cursor for pagination use; defines the place in the list. To retrieve the previous page in the list, include ending_before, which is the first ID in the currently retrieved list.

Response

Response example

object
string
required

Represents the object’s type. i.e. list.

Example:

"list"

url
string
required

Represents the URL slug for the object.

Example:

"/locations"

has_more
boolean
required

Is set to true if more objects are available.

data
Location · object[]
required