- Introduction
- Authorization
- Events
- Customers
- Locations
- Tariff (elements)
- Devices
Connect
- Token management
- Session management
- Main pages
- Service pages
Cost reporting
- Meter submissions
- Cost calculations
- Raw tariff rates
Locations
Create a location
Location is an identifier of a supply address.
Creates a location.
POST
/
locations
curl --request POST \
--url https://api.flatpeak.com/locations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"reference_id": "LOC1234567890",
"customer_id": "cus_65e421d1daa4a24082b4f590",
"postal_address": {
"address_line1": "1-3",
"address_line2": "Strand",
"city": "London",
"state": "Greater London",
"post_code": "WC2N 5EH",
"country_code": "GB"
}
}'
{
"id": "loc_641b90b758fb8e6293716e40",
"object": "location",
"reference_id": "LOC1234567890",
"customer_id": "cus_65e421d1daa4a24082b4f590",
"live_mode": true,
"timezone": "Europe/London",
"currency_code": "EUR",
"postal_address": {
"address_line1": "1-3",
"address_line2": "Strand",
"city": "London",
"state": "Greater London",
"post_code": "WC2N 5EH",
"country_code": "GB"
},
"geo_location": {
"lat": 50.12345,
"lng": -1.23456
},
"tariff_status": {
"commodity_import": "CONNECTED",
"commodity_export": "ERROR",
"non_commodity_import": "NOT_CONNECTED",
"non_commodity_export": "NOT_SUPPORTED",
"local": "NOT_SUPPORTED"
},
"tariff_elements": [
"trf_66ba584eb6923d7c3b942ef6"
],
"time_created": "2023-11-07T05:31:56Z",
"account_id": "acc_661677911f2197045e6cf1b1"
}
Authorizations
Body
application/json
This object represents a supply address.
Response
201
application/json
Example response
This object represents a supply address.
Was this page helpful?
curl --request POST \
--url https://api.flatpeak.com/locations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"reference_id": "LOC1234567890",
"customer_id": "cus_65e421d1daa4a24082b4f590",
"postal_address": {
"address_line1": "1-3",
"address_line2": "Strand",
"city": "London",
"state": "Greater London",
"post_code": "WC2N 5EH",
"country_code": "GB"
}
}'
{
"id": "loc_641b90b758fb8e6293716e40",
"object": "location",
"reference_id": "LOC1234567890",
"customer_id": "cus_65e421d1daa4a24082b4f590",
"live_mode": true,
"timezone": "Europe/London",
"currency_code": "EUR",
"postal_address": {
"address_line1": "1-3",
"address_line2": "Strand",
"city": "London",
"state": "Greater London",
"post_code": "WC2N 5EH",
"country_code": "GB"
},
"geo_location": {
"lat": 50.12345,
"lng": -1.23456
},
"tariff_status": {
"commodity_import": "CONNECTED",
"commodity_export": "ERROR",
"non_commodity_import": "NOT_CONNECTED",
"non_commodity_export": "NOT_SUPPORTED",
"local": "NOT_SUPPORTED"
},
"tariff_elements": [
"trf_66ba584eb6923d7c3b942ef6"
],
"time_created": "2023-11-07T05:31:56Z",
"account_id": "acc_661677911f2197045e6cf1b1"
}