Skip to main content
POST
/
organizations
/
{orgId}
/
counters
Create Counter
curl --request POST \
  --url https://api.m3ter.com/organizations/{orgId}/counters \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "unit": "<string>",
  "version": 123,
  "code": "<string>",
  "productId": "<string>"
}
'
{
  "id": "<string>",
  "version": 123,
  "dtCreated": "2023-11-07T05:31:56Z",
  "dtLastModified": "2023-11-07T05:31:56Z",
  "createdBy": "<string>",
  "lastModifiedBy": "<string>",
  "code": "<string>",
  "productId": "<string>",
  "name": "<string>",
  "unit": "<string>"
}

Authorizations

Authorization
string
header
required

m3ter supports machine to machine authentication using the clientCredentials OAuth2 flow.

The authorizationCode flow controls access for human users via the m3ter Console application.

Path Parameters

orgId
string
required

UUID of the Organization. The Organization represents your company as a direct customer of m3ter.

Body

application/json
name
string
required

Descriptive name for the Counter.

Required string length: 1 - 200
unit
string
required

User defined label for units shown on Bill line items, and indicating to your customers what they are being charged for.

Minimum string length: 1
version
integer<int64>

The version number of the entity:

  • Create entity: Not valid for initial insertion of new entity - do not use for Create. On initial Create, version is set at 1 and listed in the response.
  • Update Entity: On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.
code
string

Code for the Counter. A unique short code to identify the Counter.

Maximum string length: 80
productId
string

UUID of the product the Counter belongs to. (Optional) - if left blank, the Counter is Global. A Global Counter can be used to price Plans or Plan Templates belonging to any Product.

Required string length: 36

Response

Return the created Counter

id
string
required

The UUID of the entity.

version
integer<int64>

The version number:

  • Create: On initial Create to insert a new entity, the version is set at 1 in the response.
  • Update: On successful Update, the version is incremented by 1 in the response.
dtCreated
string<date-time>

The DateTime when this item was created (in ISO-8601 format).

dtLastModified
string<date-time>

The DateTime when this item was last modified (in ISO-8601 format).

createdBy
string

The ID of the user who created this item.

lastModifiedBy
string

The ID of the user who last modified this item.

code
string

Code of the Counter. A unique short code to identify the Counter.

productId
string

UUID of the product the Counter belongs to. (Optional) - if no productId is returned, the Counter is Global. A Global Counter can be used to price Plans or Plan Templates belonging to any Product.

name
string

Name of the Counter.

unit
string

Label for units shown on Bill line items, and indicating to customers what they are being charged for.