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

# Create a new meter

> This endpoint creates a new meter for a store identified by the `x-store-id` header. The request body must include `name`, `event_name`, `aggregation_type`, and an optional `unit`. The `aggregation_type` must be one of `sum`, `count`, `max`, or `latest`. The endpoint ensures that the `event_name` is unique within the store. If successful, it returns the created meter details.



## OpenAPI

````yaml /api-reference/blink-api.json post /v1/meters
openapi: 3.0.0
info:
  title: Blink API
  description: Comprehensive API documentation for Blink.
  version: 1.0.0
servers:
  - url: https://api.blink.store/v1
security:
  - storeIdHeader: []
tags:
  - name: Invoices
    description: Unified merchant of record invoices for products and subscriptions.
  - name: Geo Pricing
    description: Resolve Purchasing Power Parity (PPP) localized pricing.
paths:
  /v1/meters:
    post:
      tags:
        - Meters
      summary: Create a new meter
      description: >-
        This endpoint creates a new meter for a store identified by the
        `x-store-id` header. The request body must include `name`, `event_name`,
        `aggregation_type`, and an optional `unit`. The `aggregation_type` must
        be one of `sum`, `count`, `max`, or `latest`. The endpoint ensures that
        the `event_name` is unique within the store. If successful, it returns
        the created meter details.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMeterRequest'
      responses:
        '201':
          description: Meter created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeterDetails'
        '400':
          description: Bad Request - validation errors.
        '401':
          description: Unauthorized - Store ID header missing.
        '409':
          description: Conflict - A meter with this event_name already exists.
        '500':
          description: Internal Server Error.
      security:
        - storeIdHeader: []
components:
  schemas:
    CreateMeterRequest:
      type: object
      properties:
        name:
          type: string
        event_name:
          type: string
        aggregation_type:
          type: string
          enum:
            - sum
            - count
            - max
            - latest
        unit:
          type: string
          default: unit
      required:
        - name
        - event_name
        - aggregation_type
    MeterDetails:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        unit:
          type: string
        store_id:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    storeIdHeader:
      type: apiKey
      in: header
      name: x-store-id

````