Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 8.2 KB

metercreate.md

File metadata and controls

29 lines (24 loc) · 8.2 KB

MeterCreate

Example Usage

import { MeterCreate } from "@polar-sh/sdk/models/components/metercreate.js";

let value: MeterCreate = {
  name: "<value>",
  filter: {
    conjunction: "or",
    clauses: [],
  },
  aggregation: {
    func: "avg",
    property: "<value>",
  },
};

Fields

Field Type Required Description
metadata Record<string, components.MeterCreateMetadata> Key-value object allowing you to store additional information.

The key must be a string with a maximum length of 40 characters.
The value must be either:

* A string with a maximum length of 500 characters
* An integer
* A boolean

You can store up to 50 key-value pairs.
name string ✔️ The name of the meter. Will be shown on customer's invoices and usage.
filter components.Filter ✔️ N/A
aggregation components.MeterCreateAggregation ✔️ The aggregation to apply on the filtered events to calculate the meter.
organizationId string The ID of the organization owning the meter. Required unless you use an organization token.