POST
/
meters
Create a meter
curl --request POST \
  --url https://sandbox-api.billingrails.com/v1/meters \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "code": "<string>",
  "event": "<string>",
  "description": "<string>",
  "account_mapping": {
    "type": "id",
    "event_property": "billingrails_account_id"
  },
  "profiles": [
    {
      "id": "<string>",
      "name": "<string>",
      "code": "<string>",
      "recurring": true,
      "aggregation_property": "<string>",
      "aggregation_method": "sum",
      "aggregation_time_window": "hour",
      "filters": [
        {
          "property": "<string>",
          "operator": "in",
          "value": [
            "<string>"
          ]
        }
      ]
    }
  ]
}'
{
  "meter": {
    "object": "meter",
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "status": "active",
    "name": "<string>",
    "code": "<string>",
    "event": "<string>",
    "description": "<string>",
    "account_mapping": {
      "type": "id",
      "event_property": "billingrails_account_id"
    },
    "profiles": [
      {
        "id": "<string>",
        "name": "<string>",
        "code": "<string>",
        "recurring": true,
        "aggregation_property": "<string>",
        "aggregation_method": "sum",
        "aggregation_time_window": "hour",
        "filters": [
          {
            "property": "<string>",
            "operator": "in",
            "value": [
              "<string>"
            ]
          }
        ]
      }
    ],
    "default_profile": {
      "id": "<string>",
      "name": "<string>",
      "code": "<string>",
      "recurring": true,
      "aggregation_property": "<string>",
      "aggregation_method": "sum",
      "aggregation_time_window": "hour",
      "filters": [
        {
          "property": "<string>",
          "operator": "in",
          "value": [
            "<string>"
          ]
        }
      ]
    }
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Meter payload

The body is of type object.

Response

200 - application/json

Meter created

The response is of type object.