POST
/
meters
JavaScript
import DodoPayments from 'dodopayments';

const client = new DodoPayments({
  bearerToken: 'My Bearer Token',
});

const meter = await client.meters.create({
  aggregation: { type: 'count' },
  event_name: 'event_name',
  measurement_unit: 'measurement_unit',
  name: 'name',
});

console.log(meter.id);
{
  "aggregation": {
    "key": "<string>",
    "type": "count"
  },
  "business_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "event_name": "<string>",
  "filter": null,
  "id": "<string>",
  "measurement_unit": "<string>",
  "name": "<string>",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Response

201
application/json

Meter created successfully

The response is of type object.