> ## Documentation Index
> Fetch the complete documentation index at: https://lago-ftr-wallet-improvements.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# The billable metric object

> This object represents a billable metric that is a pricing component of your application.

<RequestExample>
  ```json The billable metric object
  {
    "billable_metric": {
      "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
      "name": "Storage",
      "code": "storage",
      "description": "GB of storage used in my application",
      "recurring": false,
      "created_at": "2022-09-14T16:35:31Z",
      "field_name": "gb",
      "aggregation_type": "sum_agg",
      "weighted_interval": "seconds",
      "filters": [
        {
          "key": "region",
          "values": [
            "us-east-1"
          ]
        }
      ],
      "active_subscriptions_count": 4,
      "draft_invoices_count": 10,
      "plans_count": 4
    }
  }
  ```
</RequestExample>

## Attributes

<ResponseField name="billable_metric" type="object">
  <Expandable title="object" defaultOpen="true">
    <ResponseField name="lago_id" type="string" required>
      Unique identifier of the billable metric created by Lago.
    </ResponseField>

    <ResponseField name="name" type="string" required>
      Name of the billable metric.
    </ResponseField>

    <ResponseField name="code" type="string" required>
      Unique code used to identify the billable metric associated with the API
      request. This code associates each event with the correct metric.
    </ResponseField>

    <ResponseField name="description" type="string | null">
      Internal description of the billable metric.
    </ResponseField>

    <ResponseField name="created_at" type="string" required>
      Creation date of the billable metric.
    </ResponseField>

    <ResponseField name="recurring" type="boolean" required>
      Defines if the billable metric is persisted billing period over billing
      period. - if set to `true`: the accumulated number of units calculated
      from previous the previous billing period is persisted to the next billing
      period. - if set to `false`: the accumulated number of units is reset to 0
      at the end of the billing period. If not defined in the request, default
      value is `false`.
    </ResponseField>

    <ResponseField name="field_name" type="string | null">
      Property of the billable metric used for aggregating usage data. This
      field is not required for `count_agg`.
    </ResponseField>

    <ResponseField name="aggregation_type" type="enum<string>" required>
      Aggregation method used to compute usage for this billable metric.
      Possible values are `count_agg`, `sum_agg`, `max_agg`, `unique_count_agg`,
      `latest_agg` or `weighted_sum_agg`.
    </ResponseField>

    <ResponseField name="weighted_interval" type="string">
      Parameter exclusively utilized in conjunction with the `weighted_sum_agg`
      aggregation type. It serves to adjust the aggregation result by assigning
      weights and proration to the result based on time intervals. When this
      field is not provided, the default time interval is assumed to be in
      `seconds`.
    </ResponseField>

    <ResponseField name="filters" type="object">
      <Expandable title="object">
        <ResponseField name="key" type="string" required>
          Filter key to add to the event properties payload.
        </ResponseField>

        <ResponseField name="values" type="array" required>
          List of possible filter values.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="active_subscriptions_count" type="integer" required>
      Number of active subscriptions using this billable metric.
    </ResponseField>

    <ResponseField name="draft_invoices_count" type="integer" required>
      Number of draft invoices for which this billable metric is listed as an
      invoice item.
    </ResponseField>

    <ResponseField name="plans_count" type="integer" required>
      Number of plans using this billable metric.
    </ResponseField>
  </Expandable>
</ResponseField>
