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"
}
Create a new meter.
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"
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Meter created successfully
The response is of type object
.
Was this page helpful?