POST
/
billableMetrics
Create a new billable metric
curl --request POST \
  --url https://api.paygentic.io/v0/billableMetrics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "description": "<string>",
  "unit": "<string>",
  "merchantId": "<string>",
  "productId": "<string>",
  "aggregation": "SUM"
}'
{
  "id": "<string>",
  "object": "billableMetric",
  "name": "<string>",
  "description": "<string>",
  "merchantId": "<string>",
  "unit": "<string>",
  "aggregation": "SUM",
  "productId": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json
name
string
required

The name of the billable metric.

description
string
required

A brief description of the billable metric.

unit
string
required

The unit of measurement for the billable metric.

merchantId
string
required

The unique identifier of the merchant organization associated with the billable metric.

productId
string
required

The unique identifier of the product associated with the billable metric.

aggregation
enum<string>
required

The aggregation method to be used for the billable metric. Currently only SUM is supported.

Available options:
SUM

Response

Billable metric created successfully

id
string

Unique identifier for a billable metric

object
enum<string>
default:billableMetric
Available options:
billableMetric
name
string
description
string
merchantId
string

Unique identifier for an organization

unit
string
aggregation
enum<string>
Available options:
SUM,
MAX,
COUNT,
COUNT_UNIQUE
productId
string

Unique identifier for a product

createdAt
string<date-time>
updatedAt
string<date-time>