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

# Submit location meter records

> Submits meter records for the grid connection point, such as the main supply meter. Records describe the whole property and flow between `GRID` and `SITE_LOAD`. Pass the `device_id` of the device that reads the meter.



## OpenAPI

````yaml energy-api/reference/flatpeak-api-spec-energy-tariffs.json POST /locations/{location_id}/meter-records
openapi: 3.0.3
info:
  description: >-
    The tariff functions of the Flatpeak Energy API: tariff connection, prices,
    forecasts and costs. Generated from the full Energy API spec by
    scripts/build-tariff-spec.py. Do not edit.
  version: 2027-01-01.busbar
  title: 'Flatpeak Energy API: Tariffs'
  termsOfService: https://flatpeak.com/legal
  contact:
    name: Technical Support
    email: support@flatpeak.com
    url: https://flatpeak.com/contact
  license:
    name: Apache 2.0
    url: https://flatpeak.com/legal
servers:
  - url: https://energy-api.flatpeak.com
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: >-
      Exchange your account credentials for a bearer token to authenticate API
      requests.
  - name: Connect
    description: >-
      Create and retrieve Connect sessions. Connect drives the user journeys for
      tariff connection and [tariff error
      reporting](/energy-api/reference/connect/tariff/error-report). What
      happens in those journeys reaches your backend as [Connect
      webhooks](/energy-api/guides/platform/events).
  - name: Users
    description: Create, retrieve, update, delete, and list users.
  - name: Locations
    description: Create, retrieve, update, delete, and list locations.
  - name: Devices
    description: >-
      Create, retrieve, update, delete and list devices; submit and retrieve
      their state; read and write their shared settings.
  - name: Meters
    description: Submit meter records and check batch status.
  - name: Tariffs
    description: Create, retrieve, delete, and list tariffs.
  - name: Prices
    description: Retrieve and audit calculated energy prices.
  - name: Costs
    description: Calculate the monetary cost of imported or exported energy.
  - name: Optimizations
    description: >-
      Rank the connected tariff to find the best times to consume or export
      energy, as inputs to your own scheduling.
  - name: Events
    description: Retrieve and list account events.
externalDocs:
  description: Documentation
  url: https://docs.flatpeak.com
paths:
  /locations/{location_id}/meter-records:
    parameters:
      - name: location_id
        in: path
        required: true
        schema:
          type: string
          example: loc_641b90b758fb8e6293716e40
        description: Flatpeak Location ID.
    post:
      tags:
        - Meters
      summary: Submit location meter records
      description: >-
        Submits meter records for the grid connection point, such as the main
        supply meter. Records describe the whole property and flow between
        `GRID` and `SITE_LOAD`. Pass the `device_id` of the device that reads
        the meter.
      operationId: submit-location-meter-records
      parameters: []
      requestBody:
        $ref: '#/components/requestBodies/LocationMeterRecordsSubmit'
      responses:
        '200':
          $ref: '#/components/responses/MeterRecordsBatch'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '503':
          $ref: '#/components/responses/503'
components:
  requestBodies:
    LocationMeterRecordsSubmit:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LocationMeterRecordsSubmit'
  responses:
    '400':
      description: >-
        400 Bad Request: the request was malformed or a required field is
        missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '401':
      description: '401 Unauthorized: authentication credentials are missing or invalid.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '403':
      description: '403 Forbidden: you do not have permission to access this resource.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '404':
      description: '404 Not Found: the requested resource does not exist.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '422':
      description: >-
        422 Unprocessable Entity: the request is well-formed but cannot be
        processed, for example missing required data.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: '429 Too Many Requests: the rate limit has been exceeded.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '500':
      description: >-
        500 Internal Server Error: an unexpected error occurred. Safe to retry
        with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '503':
      description: >-
        503 Service Unavailable: the service is temporarily down for
        maintenance. Retry after the indicated delay.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    MeterRecordsBatch:
      description: '200 OK: the status of a submitted meter record batch.'
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
                example: mbr_65e42b7827c0526548432b9f
                description: Flatpeak ID for this submission.
              object:
                type: string
                example: meter_batch
                description: Object type.
                enum:
                  - meter_batch
              records_submitted:
                type: integer
                description: Number of received meter records.
                example: 18379
              records_accepted:
                type: integer
                description: Number of accepted meter records.
                example: 18378
              records_processed:
                type: integer
                description: Number of processed meter records.
                example: 32
              failed_records:
                type: array
                description: Details of any meter records that failed processing.
                items:
                  $ref: '#/components/schemas/FailedMeterRecord'
              account_id:
                type: string
                example: acc_661677911f2197045e6cf1b1
                description: Flatpeak Account ID.
              time_created:
                type: string
                example: '2026-11-07T05:31:56Z'
                description: Time when this object was created. In UTC.
                format: date-time
            required:
              - id
              - object
              - records_submitted
              - records_accepted
              - records_processed
              - account_id
              - time_created
  schemas:
    LocationMeterRecordsSubmit:
      title: LocationMeterRecordsSubmit
      allOf:
        - $ref: '#/components/schemas/MeterRecordsSubmit'
        - type: object
          required:
            - device_id
          properties:
            device_id:
              type: string
              example: dev_63a6087272941ef077a8fd3e
              description: >-
                The device the records were read from: the location's metering
                device (`capabilities.metering.location`). Records from a
                different device are accepted, the last write wins, and the
                location's `metering.conflict` is set.
    FailedMeterRecord:
      title: FailedMeterRecord
      type: object
      properties:
        record_num:
          type: integer
          description: Position of the meter record in the batch, from 0.
          example: 1
        error:
          type: string
          description: Error message for this meter record.
          example: end_time must not be before start_time
      required:
        - record_num
        - error
    Error:
      type: object
      description: Standard error envelope returned by every non-2xx response.
      required:
        - object
        - type
        - code
        - message
      properties:
        object:
          type: string
          enum:
            - error
          default: error
          description: Object type.
        type:
          type: string
          description: High-level error category.
          example: invalid_request
        code:
          type: string
          description: Machine-readable error code, safe to branch on.
          example: not_found
        message:
          type: string
          description: Human-readable description of the error.
          example: The requested resource could not be found.
        context:
          type: string
          description: Optional originating context, for example `api.price_get`.
          example: api.price_get
        live_mode:
          type: boolean
          description: Whether the error occurred against live or test data.
        time_created:
          type: string
          format: date-time
          description: Time the error was generated (RFC 3339).
          example: '2026-01-01T00:00:00Z'
    MeterRecordsSubmit:
      title: MeterRecordsSubmit
      type: object
      required:
        - basis
        - data
      additionalProperties: false
      properties:
        basis:
          type: string
          enum:
            - INTERVAL
            - CUMULATIVE
          example: INTERVAL
          description: >-
            `INTERVAL` records carry energy per period; `CUMULATIVE` records
            carry register readings.
        session_reference_id:
          type: string
          example: SESSION1234567890
          description: >-
            A reference for a group of meter records, for example, a charging
            session ID.
        data:
          type: array
          description: Meter records to submit, all of the same `basis`.
          items:
            oneOf:
              - type: object
                properties:
                  source:
                    type: string
                    example: PV
                    description: >-
                      Origin of the metered energy flow. Together with
                      destination it describes the flow path. Must differ from
                      destination.
                    enum:
                      - PV
                      - INVERTER
                      - BATTERY
                      - EVSE
                      - VEHICLE
                      - HVAC
                      - DHW
                      - GENERATOR
                      - SITE_LOAD
                      - GRID
                  destination:
                    type: string
                    example: BATTERY
                    description: >-
                      Destination of the metered energy flow. Must differ from
                      source.
                    enum:
                      - PV
                      - INVERTER
                      - BATTERY
                      - EVSE
                      - VEHICLE
                      - HVAC
                      - DHW
                      - GENERATOR
                      - SITE_LOAD
                      - GRID
                  start_time:
                    type: string
                    example: '2026-02-01T10:30:00Z'
                    description: >-
                      Meter record start time. In RFC 3339 format, for example
                      `2023-06-15T09:00:00Z` or with time offset, for example
                      `2023-06-15T08:00:00+01:00`.
                    format: date-time
                  end_time:
                    type: string
                    example: '2026-02-01T11:00:00Z'
                    description: >-
                      Meter record end time. In RFC 3339 format, for example
                      `2023-06-15T09:00:00Z` or with time offset, for example
                      `2023-06-15T08:00:00+01:00`.
                    format: date-time
                  energy_kwh:
                    type: number
                    example: 1.23456
                    description: Energy transferred in kilowatt hours.
                required:
                  - source
                  - destination
                  - start_time
                  - end_time
                  - energy_kwh
                title: Interval record
              - type: object
                properties:
                  source:
                    type: string
                    example: PV
                    description: >-
                      Origin of the metered energy flow. Together with
                      destination it describes the flow path. Must differ from
                      destination.
                    enum:
                      - PV
                      - INVERTER
                      - BATTERY
                      - EVSE
                      - VEHICLE
                      - HVAC
                      - DHW
                      - GENERATOR
                      - SITE_LOAD
                      - GRID
                  destination:
                    type: string
                    example: BATTERY
                    description: >-
                      Destination of the metered energy flow. Must differ from
                      source.
                    enum:
                      - PV
                      - INVERTER
                      - BATTERY
                      - EVSE
                      - VEHICLE
                      - HVAC
                      - DHW
                      - GENERATOR
                      - SITE_LOAD
                      - GRID
                  time:
                    type: integer
                    description: Unix timestamp when the measurement occurred.
                    example: 1721991392
                  energy_kwh:
                    type: number
                    description: Amount of energy measured, as cumulative register value.
                    example: 1.23456
                required:
                  - source
                  - destination
                  - time
                  - energy_kwh
                title: Cumulative record
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token obtained from POST /auth/tokens.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.