> ## 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.

# Create a tariff

> Creates a tariff.

<Info>Only use this endpoint for bulk imports or if instructed by Flatpeak support. Otherwise, use [Connect](/guides/integration-plan), which creates all required objects automatically.</Info>



## OpenAPI

````yaml api-reference/anode/flatpeak-api-spec-anode.json POST /tariffs
openapi: 3.0.3
info:
  description: Flatpeak API
  version: 2025-09-14.anode
  title: Flatpeak API
  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://api.flatpeak.com
    description: Location
security: []
tags:
  - name: Consumption
    description: Consumption operations
  - name: Customers
    description: Customer operations
  - name: Devices
    description: Device operations
  - name: Meters
    description: Meter readings operations
  - name: Events
    description: Events operations
  - name: Login
    description: Bearer auth token operations
  - name: Connect
    description: Connect operations
  - name: Locations
    description: Location operations
  - name: Rates
    description: Rates operations
  - name: Costs
    description: Consumption cost calculations
  - name: Schedules
    description: Consumption schedules
  - name: Tariffs
    description: Tariff operations
  - name: Slots
    description: Slots operations
externalDocs:
  description: Location documentation
  url: https://docs.flatpeak.com
paths:
  /tariffs:
    parameters: []
    post:
      tags:
        - Tariffs
      summary: Create a tariff
      description: >-
        Creates a tariff.


        <Info>Only use this endpoint for bulk imports or if instructed by
        Flatpeak support. Otherwise, use [Connect](/guides/integration-plan),
        which creates all required objects automatically.</Info>
      operationId: create-a-tariff
      requestBody:
        $ref: '#/components/requestBodies/TariffCreate'
      responses:
        '200':
          $ref: '#/components/responses/Tariff'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
      security:
        - bearerAuth: []
components:
  requestBodies:
    TariffCreate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TariffCreate'
          examples: {}
  responses:
    '403':
      description: 403 forbidden
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                message: Bad credentials
            properties:
              object:
                type: string
                example: error
                x-stoplight:
                  id: gria4ysjd9zhk
                default: error
              type:
                type: string
                x-stoplight:
                  id: 7mhtfljidnqcu
                example: invalid_request
                default: invalid_request
              code:
                type: string
                x-stoplight:
                  id: sy7ljpdy5wdes
                example: access_denied
                default: access_denied
              time_created:
                type: string
                x-stoplight:
                  id: 84d5biv9dfbc9
                format: date-time
                example: '2025-01-01T00:00:00Z'
            required:
              - object
              - type
              - code
          examples: {}
    '404':
      description: 404 response
      content:
        application/json:
          schema:
            type: object
            x-examples:
              Example:
                message: Not Found
            properties:
              object:
                type: string
                example: error
                x-stoplight:
                  id: qyc690tqd4dnh
                default: error
              type:
                type: string
                x-stoplight:
                  id: 6sog2aaccgb59
                example: invalid_request
                default: invalid_request
              code:
                type: string
                x-stoplight:
                  id: 6l9jrgodwxi0c
                example: not_found
                default: not_found
              time_created:
                type: string
                x-stoplight:
                  id: 1ywndy1nsshcz
                example: '2025-01-01T00:00:00Z'
                format: date-time
          examples: {}
    Tariff:
      description: Response example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Tariff'
  schemas:
    TariffCreate:
      type: object
      x-stoplight:
        id: uyoawncda9zd7
      x-examples: {}
      title: TariffCreate
      properties:
        location_id:
          type: string
          example: loc_641b90b758fb8e6293716e40
          description: Flatpeak Location ID this tariff will be associated with.
          x-stoplight:
            id: o03807p5y5ori
        direction:
          type: string
          example: IMPORT
          description: >-
            Indicates direction of energy transfer this tariff applies to.
            Supported options are IMPORT, EXPORT and LOCAL
          x-stoplight:
            id: sgu7g8czu74d8
        type:
          type: string
          example: COMMODITY
          description: >-
            Indicates the tariff type you want to work with. Set to COMMODITY or
            NON_COMMODITY.
        display_name:
          type: string
          example: Flexible Go 2023
          description: Tariff display name.
        provider_id:
          type: string
          description: Flatpeak ID of the provider this tariff belongs to.
          example: prv_63a6087272921ef075a8fd3e
        market_rates:
          type: boolean
          default: false
          x-stoplight:
            id: zjq8cf7e275o3
          description: Indicates if this tariff is based on a market rate.
        contract_start_date:
          type: string
          example: '2023-01-24T00:00:00Z'
          format: date-time
          description: >-
            Indicates start date of the energy supply contract between customer
            and provider.
        contract_end_date:
          type: string
          example: '2024-01-24T00:00:00Z'
          format: date-time
          description: >-
            Indicates end date of the energy supply contract between customer
            and provider.
        schedule:
          $ref: '#/components/schemas/TariffScheduleCreate'
      required:
        - location_id
        - type
        - contract_start_date
        - contract_end_date
    Tariff:
      type: object
      x-stoplight:
        id: 05c1f1f174a8c
      x-examples: {}
      title: Tariff
      properties:
        id:
          type: string
          example: trf_66ba584eb6923d7c3b942ef6
          description: Unique tariff ID.
          x-stoplight:
            id: aq3ptj5uuup5p
        object:
          type: string
          example: tariff
          description: Flatpeak object type. I.e. tariff.
          x-stoplight:
            id: aq3ptj5uuup5p
        location_id:
          type: string
          example: loc_641b90b758fb8e6293716e40
          description: Flatpeak Location ID this tariff is associated with.
          x-stoplight:
            id: aq3ptj5uuup5p
        live_mode:
          type: boolean
          x-stoplight:
            id: hvnc0l0ys8avm
          description: >-
            Has the value true if the object exists in live mode or the value
            false if the object exists in test mode.
        is_linked:
          type: boolean
          default: false
          x-stoplight:
            id: eceonpwok2531
          description: >-
            This indicates that the tariff is linked to an external data source
            and is automatically updated from this source. Such as when it's
            linked to your customer's provider account or to a tariff in the
            Flatpeak tariffs library. This value is set automatically by
            Flatpeak and cannot be changed.
        connection_type:
          type: string
          example: MANUAL
          x-stoplight:
            id: 5jcdmn22herj0
          description: >-
            Represents tariff connection type. Set automatically by Flatpeak
            depending on how the tariff was created. Supported options are
            MANUAL, LIBRARY and DIRECT.
        direction:
          type: string
          example: IMPORT
          description: >-
            Indicates direction of energy transfer this tariff applies to.
            Supported options are IMPORT, EXPORT and LOCAL
          x-stoplight:
            id: 23npbxf6818th
        type:
          type: string
          example: COMMODITY
          description: >-
            Indicates the tariff type you want to work with. Set to COMMODITY or
            NON_COMMODITY.
        status:
          type: string
          example: CONNECTED
          description: Status of tariff. Possible values are CONNECTED or ERROR.
          x-stoplight:
            id: gb20zzq5nxbnq
        timezone:
          type: string
          x-stoplight:
            id: m4j4uz8b4zntb
          description: >-
            The timezone at the location, in 'tz database format'. I.e.
            'Europe/Berlin'.
          example: Europe/London
        display_name:
          type: string
          example: Flexible Go 2023
          description: Tariff display name.
        provider_id:
          type: string
          description: Flatpeak ID of the provider this tariff belongs to.
          example: prv_63a6087272921ef075a8fd3e
        market_rates:
          type: boolean
          default: false
          x-stoplight:
            id: zjq8cf7e275o3
          description: Indicates if this tariff is based on a market rate.
        contract_start_date:
          type: string
          example: '2023-01-24T00:00:00Z'
          format: date-time
          description: >-
            Indicates start date of the energy supply contract between customer
            and provider.
        contract_end_date:
          type: string
          example: '2024-01-24T00:00:00Z'
          format: date-time
          description: >-
            Indicates end date of the energy supply contract between customer
            and provider.
        schedule:
          $ref: '#/components/schemas/TariffSchedule'
        time_created:
          type: string
          format: date-time
          example: '2023-05-05T05:37:27Z'
          description: Indicates time when this tariff object was created.
        account_id:
          type: string
          x-stoplight:
            id: 2vdbtsh2bpzcz
          example: acc_661677911f2197045e6cf1b1
          description: Flatpeak account ID.
      required:
        - id
        - object
        - location_id
        - live_mode
        - is_linked
        - connection_type
        - type
        - status
        - timezone
        - market_rates
        - contract_start_date
        - contract_end_date
        - time_created
        - account_id
    TariffScheduleCreate:
      type: array
      x-stoplight:
        id: byvbn3onew37a
      x-examples: {}
      title: TariffSchedule
      description: Tariff schedule object.
      items:
        type: object
        properties:
          months:
            type: array
            description: >-
              Array of 3-letter abbreviations of month names the schedule
              applies to. Options are `Jan`, `Feb`, `Mar`, `Apr`, `May`, `Jun`,
              `Jul`, `Aug`, `Sep`, `Oct`, `Nov`, `Dec` or `All`
            items:
              x-stoplight:
                id: vn7di17f3ncyd
              type: string
              example: All
              default: All
          dates:
            type: array
            description: >-
              Array of day numbers the schedule applies to. Example: `[1, 4, 12,
              30]`. Leave empty (`[]`) to apply the schedule to all days
              numbers.
            items:
              x-stoplight:
                id: vn7di17f3ncyd
              type: number
              example: 24
          days_and_hours:
            type: array
            description: Array of days and hours when the tariff is valid.
            items:
              type: object
              properties:
                days:
                  type: array
                  description: >-
                    Days when the schedule is valid. Options are `Weekdays`,
                    `Weekend`, `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`
                    or `All`.
                  items:
                    type: string
                    example: All
                    default: All
                hours:
                  type: array
                  description: Array of hours when the schedule is valid.
                  items:
                    type: object
                    properties:
                      valid_from:
                        type: string
                        format: time
                        description: >-
                          Period start time in local time, formatted as
                          HH:MM:SS.
                        example: '05:00:00'
                        default: '00:00:00'
                      valid_to:
                        type: string
                        format: time
                        description: Period end time in local time, formatted as HH:MM:SS.
                        example: '23:30:00'
                        default: '00:00:00'
                      rate:
                        type: array
                        description: Tariff rate array object.
                        items:
                          type: object
                          x-stoplight:
                            id: odkyj9db9h27x
                          properties:
                            fixed:
                              type: number
                              description: >-
                                Fixed fariff rate in *large* currency units.
                                When `market_rates` is set to `true`, this value
                                is ignored.
                              example: 0.23431
                              x-stoplight:
                                id: 289r6lrnaa83g
                            to_kwh:
                              type: number
                              description: >-
                                Specifies up to what kWh tariff applies. Used
                                for tier-based tariffs. If tariff has no tiers,
                                leave as `null`.
                              example: 30.5
                              nullable: true
                            surcharge_fixed:
                              type: number
                              x-stoplight:
                                id: otfcqp1u2mk69
                              description: >-
                                Tariff surcharge value in *large* currency
                                units. When `market_rates` is set to `false`,
                                this value is ignored. Applied before
                                `surcharge_percentage`.
                              example: 0.12
                              nullable: true
                            surcharge_percentage:
                              type: number
                              x-stoplight:
                                id: gnr01j84f70ju
                              description: >-
                                Tariff surcharge percentage fraction of 1. When
                                `market_rates` is set to `false`, this value is
                                ignored.
                              example: 0.05
                              nullable: true
    TariffSchedule:
      type: array
      x-examples: {}
      title: TariffSchedule
      description: Tariff schedule object.
      items:
        type: object
        properties:
          months:
            type: array
            description: >-
              Array of 3-letter abbreviations of month names the schedule
              applies to. Options are `Jan`, `Feb`, `Mar`, `Apr`, `May`, `Jun`,
              `Jul`, `Aug`, `Sep`, `Oct`, `Nov`, `Dec` or `All`
            items:
              x-stoplight:
                id: vn7di17f3ncyd
              type: string
              example: All
              default: All
          dates:
            type: array
            description: >-
              Array of day numbers the schedule applies to. Example: `[1, 4, 12,
              30]`. Leave empty (`[]`) to apply the schedule to all days
              numbers.
            items:
              x-stoplight:
                id: vn7di17f3ncyd
              type: number
              example: 24
          days_and_hours:
            type: array
            description: Array of days and hours when the tariff is valid.
            items:
              type: object
              properties:
                days:
                  type: array
                  description: >-
                    Days when the schedule is valid. Options are `Weekdays`,
                    `Weekend`, `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`
                    or `All`.
                  items:
                    type: string
                    example: All
                    default: All
                hours:
                  type: array
                  description: Array of hours when the schedule is valid.
                  items:
                    type: object
                    properties:
                      valid_from:
                        type: string
                        format: time
                        description: >-
                          Period start time in local time, formatted as
                          HH:MM:SS.
                        example: '05:00:00'
                        default: '00:00:00'
                      valid_to:
                        type: string
                        format: time
                        description: Period end time in local time, formatted as HH:MM:SS.
                        example: '23:30:00'
                        default: '00:00:00'
                      rate:
                        type: array
                        description: Tariff rate array object.
                        items:
                          type: object
                          x-stoplight:
                            id: odkyj9db9h27x
                          properties:
                            fixed:
                              type: number
                              description: >-
                                Fixed fariff rate in *large* currency units.
                                When `market_rates` is set to `true`, this value
                                is ignored.
                              example: 0.23431
                              x-stoplight:
                                id: 289r6lrnaa83g
                            to_kwh:
                              type: number
                              description: >-
                                Specifies up to what kWh tariff applies. Used
                                for tier-based tariffs. If tariff has no tiers,
                                leave as `null`.
                              example: 30.5
                              nullable: true
                            surcharge_fixed:
                              type: number
                              x-stoplight:
                                id: otfcqp1u2mk69
                              description: >-
                                Tariff surcharge value in *large* currency
                                units. When `market_rates` is set to `false`,
                                this value is ignored. Applied before
                                `surcharge_percentage`.
                              example: 0.12
                              nullable: true
                            surcharge_percentage:
                              type: number
                              x-stoplight:
                                id: gnr01j84f70ju
                              description: >-
                                Tariff surcharge percentage fraction of 1. When
                                `market_rates` is set to `false`, this value is
                                ignored.
                              example: 0.05
                              nullable: true
                            expression:
                              type: string
                              x-stoplight:
                                id: vol3kbf3um6h1
                              example: (((0.03 * $index) - 3) * $unitScale) * $vat
                              description: Expression formula using variables object.
                            variables:
                              type: object
                              x-stoplight:
                                id: bvpta52zktuvo
                              description: Formula variables
                              properties:
                                index:
                                  type: string
                                  x-stoplight:
                                    id: 6w2p1i4znrc1r
                                  description: Price index name
                                  example: BELPEX
                                unitsScale:
                                  type: number
                                  x-stoplight:
                                    id: g6cg34nmdgc7g
                                  description: Units scale
                                  example: 0.01
                                vat:
                                  type: number
                                  x-stoplight:
                                    id: oj2hg3zcecdqp
                                  description: Tax percentage as fraction of 1
                                  example: 0.12
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate with `bearer` you obtained from
        [authentication](/api-reference/anode/authentication) endpoint.

````