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

# Get Meter

> Retrieve a meter by its ID.



## OpenAPI

````yaml get /meters/{id}
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.102.0
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /meters/{id}:
    get:
      tags:
        - Meters
      operationId: get_meter_handler
      parameters:
        - name: id
          in: path
          description: Meter ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Meter details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeterResponse'
        '404':
          description: Meter not found
        '500':
          description: Something went wrong :(
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import DodoPayments from 'dodopayments';

            const client = new DodoPayments({
              bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
            });

            const meter = await client.meters.retrieve('id');

            console.log(meter.id);
        - lang: Python
          source: |-
            import os
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            meter = client.meters.retrieve(
                "id",
            )
            print(meter.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tmeter, err := client.Meters.Get(context.TODO(), \"id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", meter.ID)\n}\n"
        - lang: Java
          source: |-
            package com.dodopayments.api.example;

            import com.dodopayments.api.client.DodoPaymentsClient;
            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
            import com.dodopayments.api.models.meters.Meter;
            import com.dodopayments.api.models.meters.MeterRetrieveParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    Meter meter = client.meters().retrieve("id");
                }
            }
        - lang: Kotlin
          source: |-
            package com.dodopayments.api.example

            import com.dodopayments.api.client.DodoPaymentsClient
            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
            import com.dodopayments.api.models.meters.Meter
            import com.dodopayments.api.models.meters.MeterRetrieveParams

            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val meter: Meter = client.meters().retrieve("id")
            }
        - lang: Ruby
          source: |-
            require "dodopayments"

            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )

            meter = dodo_payments.meters.retrieve("id")

            puts(meter)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $meter = $client->meters->retrieve('id');

              var_dump($meter);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System;
            using DodoPayments.Client;
            using DodoPayments.Client.Models.Meters;

            DodoPaymentsClient client = new();

            MeterRetrieveParams parameters = new() { ID = "id" };

            var meter = await client.Meters.Retrieve(parameters);

            Console.WriteLine(meter);
components:
  schemas:
    MeterResponse:
      type: object
      required:
        - id
        - business_id
        - name
        - event_name
        - aggregation
        - measurement_unit
        - created_at
        - updated_at
      properties:
        aggregation:
          $ref: '#/components/schemas/MeterAggregation'
        business_id:
          type: string
        created_at:
          type: string
          format: date-time
        description:
          type:
            - string
            - 'null'
        event_name:
          type: string
        filter:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/MeterFilter'
        id:
          type: string
        measurement_unit:
          type: string
        name:
          type: string
        updated_at:
          type: string
          format: date-time
    MeterAggregation:
      type: object
      title: Meter Aggregation
      required:
        - type
      properties:
        key:
          type:
            - string
            - 'null'
          description: Required when type is not COUNT
        type:
          $ref: '#/components/schemas/AggregationType'
          description: Aggregation type for the meter
    MeterFilter:
      type: object
      title: Meter Filter
      description: >-
        A filter structure that combines multiple conditions with logical
        conjunctions (AND/OR).


        Supports up to 3 levels of nesting to create complex filter expressions.

        Each filter has a conjunction (and/or) and clauses that can be either
        direct conditions or nested filters.
      required:
        - conjunction
        - clauses
      properties:
        clauses:
          $ref: '#/components/schemas/FilterType'
          description: >-
            Filter clauses - can be direct conditions or nested filters (up to 3
            levels deep)
        conjunction:
          $ref: '#/components/schemas/Conjunction'
          description: Logical conjunction to apply between clauses (and/or)
      examples:
        - clauses:
            - key: user_id
              operator: equals
              value: user123
            - key: amount
              operator: greater_than
              value: 100
          conjunction: and
        - clauses:
            - key: plan
              operator: equals
              value: premium
            - key: plan
              operator: equals
              value: enterprise
          conjunction: or
        - clauses:
            - clauses:
                - key: user_type
                  operator: equals
                  value: premium
                - key: user_type
                  operator: equals
                  value: enterprise
              conjunction: or
            - key: active
              operator: equals
              value: true
          conjunction: and
    AggregationType:
      type: string
      enum:
        - count
        - sum
        - max
        - last
    FilterType:
      oneOf:
        - type: array
          title: MeterFilterConditionList
          items:
            $ref: '#/components/schemas/MeterFilterCondition'
          description: Array of filter conditions.
          maxItems: 10
          minItems: 1
        - type: array
          title: NestedMeterFilterList
          items:
            $ref: '#/components/schemas/MeterFilter'
          description: Array of nested filters.
          maxItems: 10
          minItems: 1
      title: FilterType
      description: >-
        Filter clauses — either a flat list of `MeterFilterCondition`s or a list
        of nested `MeterFilter`s. Up to 3 levels of nesting are accepted; the
        limit is enforced at runtime.
    Conjunction:
      type: string
      enum:
        - and
        - or
    MeterFilterCondition:
      type: object
      title: Meter Filter Condition
      required:
        - key
        - operator
        - value
      properties:
        key:
          type: string
          description: Filter key to apply
          maxLength: 100
          minLength: 1
        operator:
          $ref: '#/components/schemas/FilterOperator'
          description: Filter operator
        value:
          oneOf:
            - type: string
            - type: number
            - type: boolean
          title: Filter Value
          description: Filter value - can be string, number, or boolean
    FilterOperator:
      type: string
      enum:
        - equals
        - not_equals
        - greater_than
        - greater_than_or_equals
        - less_than
        - less_than_or_equals
        - contains
        - does_not_contain
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````