> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flatpeak.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Release Notes - 2025-09-14.anode

**Anode** is a major update to the Flatpeak platform focused on simplification and the introduction of new capabilities:

* [Price forecasts](/guides/sources/price-forecasts) — plan up to 5 days ahead.
* [Grid fees](/guides/sources/grid-fees) — adds support for non-energy (non-commodity) charges.
* [Webhook notifications for price updates](/guides/connect/webhooks#when-your-backend-receives-location-update-events%3A).
* [On-site generation accounting](/guides/calculate/local-generation) — supports PV and other local generation cost tracking.
* All endpoints now return `400 Bad Request` instead of `409 Conflict` for validation errors.

<Info>Access the documentation for [Zero](https://zero.docs.flatpeak.com), our previous generation release</Info>

## Connect tariff

Anode introduces significant updates to the Connect architecture and endpoints, designed to simplify integration and shorten the user journey.

Because of the scale of these changes, we recommend re-implementing your integration using the updated [App Integration Guide](/guides/connect).

#### Connect endpoints changes summary:

<Info>
  All Connect pages now include the following actions:

  | Action  | Result                                                                |
  | :------ | :-------------------------------------------------------------------- |
  | `BACK`  | Returns previous page. If unavailable, returns `callback_url`.        |
  | `CLOSE` | Returns `callback_url` you specified when creating the Connect token. |
</Info>

<Note>
  All pages now also include a `type` flag, inherited from the `tariff_type` field — either `"COMMODITY"` or `"NON_COMMODITY"`, depending on how the [Connect Token was created](/api-reference/anode/connect/create-a-connect-token).
</Note>

<AccordionGroup>
  <Accordion title="Create / Retrieve Connect token">
    <CodeGroup>
      ```json Create connect_token theme={"system"}
      POST /connect/tariff/token // [!code --]
      POST /connect/token // [!code ++]
      {
        "customer_id": "cus_65e421d1daa4a24082b4f590",
        "customer_reference_id": "CUS0123456789",
        "location_id": "loc_641b90b758fb8e6293716e40",
        "location_reference_id": "LOC0123456789",
        "direction": "IMPORT", // [!code --]
        "tariff_direction": "IMPORT", // [!code ++]
        "type": "COMMODITY", // [!code --]
        "tariff_type": "COMMODITY", // [!code ++]
        "connect_web_url": "myapp://nova/flatpeak/connect", // [!code --]
        "connect_url": "myapp://nova/flatpeak/connect", // [!code ++]
        "callback_url": "myapp://nova/flatpeak/complete",
        "tariff_id": "trf_6597ef46529ab4467502af0b",
        "actions": { // [!code ++]
          "disconnect_tariff": false, // [!code ++] disconnects tariff with no UI
          "edit_tariff": true // [!code ++] // starts with provider selection instead of summary
        },
        "route_options": { // [!code ++] enables non-mandatory pages
          "advanced_tariff_capture": false, // [!code ++]
          "tariff_name_capture": false, // [!code ++]
          "contract_term_capture": false // [!code ++]
        },
        "postal_address_type": "RESIDENTIAL", // [!code ++] fitlers providers by address type
        "postal_address": {
          "address_line1": "1-3",
          "address_line2": "Strand",
          "city": "London",
          "state": "Greater London",
          "post_code": "WC2N 5EH",
          "country_code": "GB"
        }
      }
      ```

      ```json Retrieve connect connect_token theme={"system"}
      POST /connect/tariff/token // [!code --]
      POST /connect/token // [!code ++]
      {
        "id": "cot_6587fa4362341be5b524de3b",
        "object": "connect_token",  // [!code --]
        "object": "connect_session",  // [!code ++]
        "live_mode": true,
        "customer_id": "cus_65e421d1daa4a24082b4f590",
        "customer_reference_id": "CUS0123456789",
        "location_id": "loc_641b90b758fb8e6293716e40",
        "location_reference_id": "LOC0123456789",
        "is_tariff_processed": true, // [!code --]
        "price_available": true, // [!code ++]
        "time_created": "2023-05-05T18:37:27Z",
        "time_expiry": "2023-12-28T03:00:00Z"
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Start session (Δ)" icon="rocket">
    <CodeGroup>
      ```json Start a connect session theme={"system"}
      curl --request POST \
        --url https://connect.flatpeak.com \
        --header 'Content-Type: application/json' \
        --data '{
        "connect_token": "<connect_token>",
        "route": "session_restore", // [!code --]
        "route": "session_start" // [!code ++]
      }'
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Postal Address (Δ)" icon="map-location">
    <CodeGroup>
      ```json Your POST to Connect (data) theme={"system"}
      curl --request POST \
        --url https://connect.flatpeak.com \
        --header 'Content-Type: application/json' \
        --data '{
        "connect_token": "cot_6587fa4362341be5b524de3b",
        "route": "postal_address_capture",
        "data": {
          "postal_address": {
            "address_line1": "1-3Strand", // [!code ++] Required
            "city": "London", // [!code ++] Required
            "state": "Greater London",
            "post_code": "WC2N 5EH", // [!code ++] Required
            "country_code": "GB" // [!code ++] Required
          }
        }
      }'
      ```
    </CodeGroup>

    Complete postal address is now required to support automatic assigment of [grid fees](/guides/sources/grid-fees), [price forecasts](/guides/sources/price-forecasts), solar forecasts, and flexibility features.

    The new error codes are as follows:

    | Error Code               | Error Description                                                                                                 |
    | ------------------------ | ----------------------------------------------------------------------------------------------------------------- |
    | `address_line1_missing`  | Address line 1 is required.                                                                                       |
    | `city_missing`           | City name is required.                                                                                            |
    | `post_code_missing`      | Post code is required.                                                                                            |
    | `country_code_missing`   | Country code is required.                                                                                         |
    | `country_code_invalid`   | Country code must be in two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. |
    | `geo_location_not_found` | Unable to resolve Geo location, provide complete address.                                                         |
    | `data_json_invalid`      | Data does not conform to the JSON schema.                                                                         |
  </Accordion>

  <Accordion title="Market surcharge (-)" icon="money-bill-trend-up">
    <Warning>
      Deprecated. Replaced by [Surchage Capture](/api-reference/anode/connect/surcharge-capture) and [Region Selection](/api-reference/anode/connect/region-selection)
    </Warning>
  </Accordion>

  <Accordion title="Surcharge capture (+)" icon="money-bill-trend-up">
    <Warning>
      The [Surcharge capture](/api-reference/anode/connect/surcharge-capture) is a new page that partially replaces the **Market Surcharge** page.
    </Warning>
  </Accordion>

  <Accordion title="Region Selection (+)" icon="location-check">
    <Warning>
      The [Region Selection](/api-reference/anode/connect/region-selection) is a new page that partially replaces the **Market Surcharge** page.
    </Warning>
  </Accordion>

  <Accordion title="Contract term capture (Δ)" icon="calendar-star">
    <CodeGroup>
      ```json Connect response theme={"system"}
      {
        "connect_token": "cot_6587fa4362341be5b524de3b",
        "route": "contract_term_capture",
        "direction": "IMPORT",
        "type": "COMMODITY",
        "live_mode": false,
        "actions": [
          "BACK"
        ],
        "data": {
          "provider": {
            "id": "prv_65de3071e0c5570f767f06f1",
            "display_name": "SSE",
            "logo_url": "https://s.flatpeak.com/570f767f06f1.png"
          },
          "contract_start_date": null,
          "contract_end_date": null,
          "contract_term_type": "" // [!code ++] set to UNTIL_TERMINATED for rolling contracts
        }
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Pending tariff connection (Δ)" icon="hourglass-start">
    <CodeGroup>
      ```json Connect response theme={"system"}
      {
        "connect_token": "cot_6587fa4362341be5b524de3b",
        "route": "summary_tariff_inprogress", // [!code --]
        "route": "tariff_connection_pending", // [!code ++]
        "direction": "IMPORT",
        "type": "COMMODITY",
        "live_mode": false,
        "actions": [
          "SAVE", // [!code --]
          "EDIT", // [!code ++]
          "DISMISS_DIRECT" // [!code --] depreciated
          "DISCONNECT", // [!code ++]
          "BACK"
        ],
        "data": {
          "connection_type": "DIRECT",
          "provider": {
            "id": "prv_65b78bbdd8e83b06a60e38c2",
            "display_name": "Octopus Energy",
            "logo_url": "https://s.flatpeak.com/83b06a60e38c2.png"
          }
        }
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Failed tariff connection (Δ)" icon="link-simple-slash">
    <CodeGroup>
      ```json Connect response theme={"system"}
      {
        "connect_token": "cot_6587fa4362341be5b524de3b",
        "route": "summary_tariff_failed", // [!code --]
        "route": "tariff_connection_failed", // [!code ++]
        "direction": "IMPORT",
        "type": "COMMODITY",
        "live_mode": false,
        "actions": [
          "RECONNECT", // [!code --]
          "EDIT", // [!code ++]
          "DISCONNECT", // [!code ++]
          "BACK"
        ],
        "data": {
          "connection_type": "DIRECT",
          "provider": {
            "id": "prv_65b78bbdd8e83b06a60e38c2",
            "display_name": "Octopus Energy",
            "logo_url": "https://s.flatpeak.com/83b06a60e38c2.png"
          }
        }
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Tariff summary (Δ)" icon="chart-simple">
    <Warning>
      The `SAVE` action has been removed from this page. The tariff is now saved automatically by Flatpeak before the page is returned. This speeds up how quickly tariff data becomes available and removes the need for any user action.
    </Warning>

    You must now subscribe to Connect session events to receive a notification when the session is complete. To do this, open the [Integrate tariff connection into your app](/guides/connect) guide and scroll to the **Subscribe to Connect session events** section.

    <CodeGroup>
      ```json Tariff summary theme={"system"}
      ROUTE summary_fixed_confirm // [!code --] deprecated
      ROUTE summary_tou_confirm // [!code --] new route that supports both fixed and tou tariffs
      {
        "connect_token": "cot_6587fa4362341be5b524de3b",
        "route": "tariffs_summary",
        "direction": "IMPORT",
        "type": "COMMODITY",
        "live_mode": false,
        "actions": [
          "WRONG_TARIFF_REPORT",
          "EDIT",
          "DISCONNECT",
          "SAVE", // [!code --] Flatpeak now automatically saves the tariff before returning this `tariffs_summary` page.
          "CLOSE",
          "BACK"
        ],
        "data": {
          "connection_type": "MARKET",
          "currency_code": "GBP",
          "market_rates_source": true,
          "provider": {
            "id": "prv_65de48b2977276d02acdb481",
            "display_name": "British Gas",
            "logo_url": "https://s.flatpeak.com/7276d02acdb481.png"
          },
          "tariff": {
            "status": "CONNECTED",
            "name": "Flex Next Go",
            "structure_type": "MARKET",
            "contract_start_date": "2023-06-15T00:00:00+02:00",
            "contract_end_date": "2024-06-15T00:00:00+02:00",
            "contract_term_type": "FIXED",
            "tiered": false
          },
          "rates":
            "yesterday": [],
            "today": [
              {
                "valid_from": "2024-02-01T00:00:00+02:00",
                "valid_to": "2024-02-01T22:00:00+02:00",
                "tariff": {
                  "cost": 0.12,
                  "confidence": 1
                }
              },
              {
                "valid_from": "2024-02-01T22:00:00+02:00",
                "valid_to": "2024-02-01T00:00:00+02:00",
                "tariff": {
                  "cost": 0.09,
                  "confidence": 1
                }
              }
            ],
            "tomorrow": [
              {
                "valid_from": "2024-02-02T00:00:00+02:00",
                "valid_to": "2024-02-02T06:00:00+02:00",
                "price": {
                  "cost": 0.09,
                  "confidence": 1
                }
              },
              {
                "valid_from": "2024-02-02T06:00:00+02:00",
                "valid_to": "2024-02-03T00:00:00+02:00",
                "price": {
                  "cost": 0.12,
                  "confidence": 1
                }
              }
            ]
          }
        }
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Complete session (-)">
    <Warning>
      Deprecated. The session now completes automatically once the customer reaches the [Tariff Summary](/api-reference/anode/connect/tariff-summary) page.
    </Warning>

    Review the **Tariff summary (Δ)** section above for implementation.
  </Accordion>
</AccordionGroup>

#### Other endpoints changes summary:

<AccordionGroup>
  <Accordion title="Retrieve energy price">
    <CodeGroup>
      ```json Request theme={"system"}
      GET /tariffs/rates/{id} // [!code --]
      POST /prices/{id} // [!code ++]

      QUERY-PARAMS // [!code --] all except location_id depreciated

      {
        "start_time": "2023-06-15T09:00:00Z", // [!code ++]
        "end_time": "2023-06-15T23:00:00Z", // [!code ++]
        "tariff_direction": "IMPORT" // [!code ++]
      }
      ```

      ```json Response theme={"system"}
      GET /tariffs/rates/{id} // [!code --]
      POST /prices/{id} // [!code ++]

      {
        "id": "prs_65e42cdd73e9f861edda35d7",
        "object": "tariff_rate", // [!code --]
        "object": "price", // [!code ++]
        "live_mode": true,
        "location_id": "loc_65e42ce4d3b813479b252160",
        "location_timezone": "Europe/London",
        "currency_code": "EUR",
        "tariff_direction": "IMPORT",
        "last_updated": "2022-05-24T14:15:22Z",
        "next_update": "2022-05-24T23:00:00Z", // [!code --]
        "request": {
          "include_tariff": true, // [!code --] now implicit
          "include_carbon": true, // [!code --] depreciated
          "direction": "IMPORT", // [!code --]
          "tariff_direction": "IMPORT", // [!code ++]
          "start_time": "2022-05-24T14:15:22Z",
          "end_time": "2022-05-24T16:15:22Z"
        },
        "data": [
          {
            "valid_from": "2022-12-28T01:00:00Z",
            "valid_to": "2022-12-28T02:30:00Z",
            "tariff": { // [!code --]
            "price": {
              "value": 4.998,
              "confidence": 1
            }, // [!code --]
            "carbon": { // [!code --] depreciated
              "intensity": 42, // [!code --]
              "relative": 0.1, // [!code --]
              "confidence": 0.9 // [!code --]
            }
          }
        ],
        "time_created": "2022-05-24T15:15:22Z",
        "account_id": "acc_661677911f2197045e6cf1b1"
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Audit energy price">
    <CodeGroup>
      ```json Request theme={"system"}
      GET /tariffs/audits/{id} // [!code --]
      POST /audits/prices/{id} // [!code ++]

      QUERY-PARAMS // [!code --] all except location_id depreciated

      {
        "start_time": "2023-06-15T09:00:00Z", // [!code ++]
        "end_time": "2023-06-15T23:00:00Z", // [!code ++]
        "tariff_direction": "IMPORT" // [!code ++]
      }
      ```

      ```json Response theme={"system"}
      GET /tariffs/rates/{id} // [!code --]
      POST /prices/{id} // [!code ++]

      {
        "id": "tra_65e42cdd73e9f861edda35d7",
        "object": "tariff_rate_audit", // [!code --]
        "object": "price_audit", // [!code ++]
        "live_mode": true,
        "location_id": "loc_65e42ce4d3b813479b252160",
        "location_timezone": "Europe/Berlin",
        "currency_code": "EUR",
        "direction": "IMPORT", // [!code --]
        "tariff_direction": "IMPORT", // [!code ++]
        "last_updated": "2022-05-24T14:15:22Z", // [!code ++]
        "request": {
          "tariff_direction": "IMPORT",
          "start_time": "2024-05-24T14:15:22Z",
          "end_time": "2024-05-24T15:15:22Z"
        },
        "market_sources": [
          "mrs_65792b4df61b16685ebd2e78"
        ],
        "data": [
          {
            "valid_from": "2024-12-28T01:00:00Z",
            "valid_to": "2024-12-28T02:00:00Z",
            "tariff_rate": { // [!code --]
            "price_breakdown": { // [!code ++]
              "commodity": {
                "market": 4.998,
                "fixed": 0.124,
                "percentage": 0.11,
                "tier": 100,
                "aggregate": 17.994
              },
              "non_commodity": {
                "fixed": 7.122,
                "tier": 10000
              },
              "total": 25.116,
              "confidence": 0.8
            }
          }
        ],
        "time_created": "2024-05-24T15:15:22Z",
        "account_id": "acc_661677911f2197045e6cf1b1"
      }
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

## Schedule energy

* All scheduling endpoints now use `POST`.
* **/slots-threshold** replaced by [/schedules/duration](/api-reference/anode/schedules/schedule-by-duration).
* **/slots-time** replaced by [/schedules/limit](/api-reference/anode/schedules/schedule-by-limit).
* **/schedules** replaced by [/schedules/amount](/api-reference/anode/schedules/schedule-by-amount).

## Tariffs

* All endpoints have path `/tariffs/elements` replaced by `/tariffs`.
* [List all tariffs](https://docs.flatpeak.com/api-reference/anode/tariffs/list-tariffs)
* [Create a tariff](https://docs.flatpeak.com/api-reference/anode/tariffs/create-a-tariff)
* [Retrieve a tariff](https://docs.flatpeak.com/api-reference/anode/tariffs/retrieve-a-tariff)
* [Delete a tariff](https://docs.flatpeak.com/api-reference/anode/tariffs/delete-a-tariff)

#### Endpoints changes summary:

<AccordionGroup>
  <Accordion title="Schedule by duration">
    <CodeGroup>
      ```json Request theme={"system"}
      GET /slots/time/{id} // [!code --]
      POST /schedules/duration/{id} // [!code ++]

      {
        "start_time": "2023-06-15T09:00:00Z",
        "end_time": "2023-06-16T09:00:00Z",
        "tariff": "IMPORT",  // [!code --]
        "tariff_direction": "IMPORT",  // [!code ++]
        "segment": "HIGH",
        "duration": 60
      }
      ```

      ```json Response theme={"system"}
      {
        "id": "sta_65e42cdd73e9f861edda35d7", // [!code --]
        "id": "sdu_65e42cdd73e9f861edda35d7", // [!code ++]
        "object": "slot_time",   // [!code --]
        "object": "schedule_duration",   // [!code ++]
        "live_mode": true,
        "location_id": "loc_65e42ce4d3b813479b252160",
        "location_timezone": "Europe/London",
        "currency_code": "EUR",
        "direction": "IMPORT", // [!code --]
        "tariff_direction": "IMPORT", // [!code ++]
        "next_update": "2023-06-18T23:00:00Z", // [!code --]
        "request": {
          "tariff_direction": "IMPORT",
          "segment": "LOW",
          "duration": 60,
          "start_time": "2022-05-24T14:15:22Z",
          "end_time": "2022-05-24T16:15:22Z"
        },
        "data": [
          {
            "start_time": "2024-05-20T00:00:00Z",
            "end_time": "2024-05-20T05:30:00Z",
            "tariff": { // [!code --]
            "price": { // [!code ++]
              "rate_avg_": 3.221, // [!code --]
              "average": 3.221, // [!code ++]
              "confidence": 1
            }
          }
        ],
        "time_created": "2024-05-23T15:14:22Z",
        "account_id": "acc_661677911f2197045e6cf1b1"
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Schedule by price limit">
    <CodeGroup>
      ```json Request theme={"system"}
      GET /slots/threshold/{id} // [!code --]
      POST /schedules/limit/{id} // [!code ++]

      {
        "start_time": "2023-06-15T09:00:00Z",
        "end_time": "2023-06-16T09:00:00Z",
        "tariff": "IMPORT",  // [!code --]
        "tariff_direction": "IMPORT",  // [!code ++]
        "segment": "HIGH",
        "relative": 0.1,
        "absolute": 0.17
      }
      ```

      ```json Response theme={"system"}
      {
        "id": "spl_65e42cdd73e9f861edda35d7", // [!code --]
        "id": "sli_65e42cdd73e9f861edda35d7", // [!code ++]
        "object": "slot_threshold", // [!code --]
        "object": "schedule_limit", // [!code ++]
        "live_mode": true,
        "location_id": "loc_65e42ce4d3b813479b252160",
        "location_timezone": "Europe/London",
        "currency_code": "EUR",
        "direction": "IMPORT", // [!code --]
        "tariff_direction": "IMPORT", // [!code ++]
        "duration": 180,
        "next_update": "2022-05-24T23:00:00Z", // [!code --]
        "request": {
          "direction": "IMPORT", // [!code --]
          "tariff_direction": "IMPORT", // [!code ++]
          "segment": "HIGH",
          "absolute": 4.2,
          "relative": 0.5,
          "start_time": "2022-12-28T00:00:00Z",
          "end_time": "2022-12-28T06:00:00Z"
        },
        "data": [
          {
            "start_time": "2022-12-28T01:00:00Z",
            "end_time": "2022-12-28T02:30:00Z",
            "price": { // [!code ++]
              "rate_avg_": 3.221, // [!code --]
              "average": 3.221, // [!code ++]
            }
          }
        ],
        "time_created": "2022-05-24T15:15:22Z",
        "account_id": "acc_661677911f2197045e6cf1b1"
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Schedule by amount of energy">
    <CodeGroup>
      ```json Request theme={"system"}
      POST /schedules // [!code --]
      POST /schedules/amount/{id} // [!code ++]

      {
        "max_power": {
          "units": "W",
          "value": 14000
        },
        "shaving_threshold": {
          "relative": 0.83,
          "absolute": 0.123
        },
        "data": [
          {
            "device_id": "dev_65e6d8334c8d715963d99db3",
            "direction": "IMPORT", // [!code --]
            "tariff_direction": "IMPORT", // [!code ++]
            "start_time": "2022-02-01T20:14:00Z",
            "end_time": "2022-02-02T06:00:00Z",
            "max_power": {
              "units": "W",
              "value": 7000
            },
            "energy": {
              "units": "WH",
              "value": 24500
            }
          }
        ]
      }
      ```

      ```json Response theme={"system"}
      {
        "id": "sae_65ea3fb185c1541f247c251e",
        "object": "schedule_amount",
        "live_mode": true,
        "location_id": "loc_641b90b758fb8e6293716e40",
        "location_timezone": "Europe/London",
        "currency_code": "GBP",
        "max_power": {
          "units": "W",
          "value": 14000
        },
        "shaving_threshold": {
          "relative": 0.83,
          "absolute": 0.123
        },
        "tariff": { // [!code --]
        "cost": { // [!code ++]
          "value": 928.372,
          "confidence": 1
        },
        "savings": {
          "value": 0.0239,
          "percentage": 1.34
        },
        "data": [
          {
            "device_id": "dev_664525107c44d88a37ca1ad7",
            "tariff_direction": "IMPORT",
            "start_time": "2022-02-01T20:14:00Z",
            "end_time": "2022-02-02T06:00:00Z",
            "max_power": {
              "units": "W",
              "value": 7000
            },
            "energy": {
              "units": "WH",
              "value": 34000
            },
              "tariff": { // [!code --]
              "cost": { // [!code ++]
              "value": 928.372,
              "confidence": 1
            },
            "savings": {
              "value": 0.2375,
              "percentage": 0.11
            },
            "schedule": [
              {
                "start_time": "2022-02-02T02:00:00Z",
                "end_time": "2022-02-02T04:30:00Z",
                "power": {
                  "units": "W",
                  "value": 11000
                }
              }
            ]
          }
        ],
        "time_created": "2022-01-24T14:15:22Z",
        "account_id": "acc_661677911f2197045e6cf1b1"
      }
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

## Calculate cost

Minor consistency improvements across all endpoints, including Metering.

#### Endpoints changes summary:

<AccordionGroup>
  <Accordion title="Submit meter records">
    <CodeGroup>
      ```json Interval Request theme={"system"}
      [
        {
          "location_id": "loc_641b90b758fb8e6293716e40",
          "device_id": "dev_65e6d8334c8d715963d99db3",
          "session_reference_id": "SESSION1234567890",
          "record_reference_id": "MET1234567890",
          "direction": "IMPORT", // [!code --]
          "energy_flow_direction": "INBOUND", // [!code ++]
          "tariff_rate": "IMPORT", // [!code --]
          "tariff_direction": "IMPORT", // [!code ++]
          "measurand": "TRANSFERRED", // [!code --] depreciated
          "units": "W",
          "confidence": 1,
          "value": 20567,
          "start_time": "2022-02-01T10:30:00Z",
          "end_time": "2022-02-01T11:00:00Z"
        }
      ]
      ```

      ```json Cumulative Request theme={"system"}
      {
        "location_id": "loc_641b90b758fb8e6293716e40",
        "device_id": "dev_65e6d8334c8d715963d99db3",
        "session_reference_id": "SESSION1234567890",
        "direction": "IMPORT", // [!code --]
        "energy_flow_direction": "INBOUND", // [!code ++]
        "tariff_rate": "IMPORT", // [!code --]
        "tariff_direction": "IMPORT", // [!code ++]
        "units": "WH",
        "data": [
          {
            "time": 1721991392,
            "value": 1553,
            "record_reference_id": "MET1234567890"
          }
        ]
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Calculate cost instantly">
    <CodeGroup>
      ```json Request theme={"system"}
      QUERY-PARAM: "include_tariff" // [!code --]
      QUERY-PARAM: "include_carbon" // [!code --]

      {
        "location_id": "loc_641b90b758fb8e6293716e40",
        "device_id": "dev_65e6d8334c8d715963d99db3",
        "session_reference_id": "SESSION1234567890",
        "record_reference_id": "MET1234567890",
        "direction": "IMPORT", // [!code --]
        "energy_flow_direction": "INBOUND", // [!code ++]
        "tariff_rate": "IMPORT", // [!code --]
        "tariff_direction": "IMPORT", // [!code ++]
        "measurand": "TRANSFERRED", // [!code --] depreciated
        "units": "W",
        "confidence": 1,
        "value": 20567,
        "start_time": "2022-02-01T10:30:00Z",
        "end_time": "2022-02-01T11:00:00Z"
      }
      ```

      ```json Response theme={"system"}
      {
        "id": "mre_65e641b570b2901d3a40199d",
        "object": "meter_record",
        "live_mode": true,
        "direction": "IMPORT", // [!code --]
        "energy_flow_direction": "INBOUND", // [!code ++]
        "tariff_rate": "IMPORT", // [!code --]
        "tariff_direction": "IMPORT", // [!code ++]
        "currency_code": "GBP",
        "energy_units": "WH",
        "request": {
          "location_id": "loc_641b90b758fb8e6293716e40",
          "device_id": "dev_65e6d8334c8d715963d99db3",
          "session_reference_id": "SESSION1234567890",
          "record_reference_id": "MET1234567890",
          "direction": "IMPORT", // [!code --]
          "energy_flow_direction": "INBOUND", // [!code ++]
          "tariff_rate": "IMPORT", // [!code --]
          "tariff_direction": "IMPORT", // [!code ++]
          "units": "W",
          "confidence": 1,
          "value": 20567,
          "start_time": "2022-02-01T10:30:00Z",
          "end_time": "2022-02-01T11:00:00Z",
          "non_persistent": false
        },
        "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": { // [!code --]
          "cost": { // [!code ++]
            "value": 928.372,
            "confidence": 1
          }, // [!code --]
          "carbon": { // [!code --] depreciated
            "value": 35.24, // [!code --]
            "confidence": 0.8 // [!code --]
          }
        },
        "time_created": "2022-02-01T10:33:00Z",
        "account_id": "acc_661677911f2197045e6cf1b1"
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Calculate historic cost">
    <CodeGroup>
      ```json Response theme={"system"}
      QUERY-PARAM: "include_tariff" // [!code --] now implicit
      QUERY-PARAM: "include_carbon" // [!code --] depreciated
      QUERY-PARAM: "direction" // [!code --]
      QUERY-PARAM: "tariff_direction" // [!code ++]

      {
        "id": "ecs_65ea3fb185c1541f247c251e",
        "object": "energy_cost",
        "object_id": "dev_65e6d8334c8d715963d99db3",
        "live_mode": true,
        "direction": "IMPORT", // [!code --]
        "tariff_direction": "IMPORT", // [!code ++]
        "location_timezone": "Europe/London",
        "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": { // [!code --]
            "cost": { // [!code ++]
              "value": 928.372,
              "confidence": 1
            }, // [!code --]
            "carbon": { // [!code --] depreciated
              "value": 35.24, // [!code --]
              "confidence": 0.8 // [!code --]
            }
          }
        ],
        "account_id": "acc_661677911f2197045e6cf1b1"
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Calculate cost by session ID">
    <CodeGroup>
      ```json Response theme={"system"}
      QUERY-PARAM: "include_tariff" // [!code --] now implicit
      QUERY-PARAM: "include_carbon" // [!code --] depreciated
      QUERY-PARAM: "direction" // [!code --]
      QUERY-PARAM: "tariff_direction" // [!code ++]

      {
        "id": "ecs_65ea3fb185c1541f247c251e",
        "object": "energy_cost",
        "object_id": "dev_65e6d8334c8d715963d99db3",
        "live_mode": true,
        "direction": "IMPORT", // [!code --]
        "tariff_direction": "IMPORT", // [!code ++]
        "location_timezone": "Europe/London",
        "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": { // [!code --]
            "cost": { // [!code ++]
              "value": 928.372,
              "confidence": 1
            }, // [!code --]
            "carbon": { // [!code --] depreciated
              "value": 35.24, // [!code --]
              "confidence": 0.8 // [!code --]
            }
          }
        ],
        "account_id": "acc_661677911f2197045e6cf1b1"
      }
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>
