POST
/
products
curl --request POST \
  --url https://connect.withvayu.com/products \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "eventName": "<string>",
  "aggregationMethod": {
    "operator": "Count",
    "field": "<string>",
    "instanceKey": "<string>"
  },
  "filter": {
    "conditions": [
      {
        "criterions": [
          {
            "field": "<string>",
            "operator": "Equals",
            "value": "<string>"
          }
        ]
      }
    ]
  },
  "pricing": {
    "pricingModel": "PerUnit",
    "priceConfiguration": {
      "price": 1,
      "chunkSize": 1
    }
  }
}'
{
  "product": {
    "name": "<string>",
    "eventName": "<string>",
    "aggregationMethod": {
      "operator": "Count",
      "field": "<string>",
      "instanceKey": "<string>"
    },
    "filter": {
      "conditions": [
        {
          "criterions": [
            {
              "field": "<string>",
              "operator": "Equals",
              "value": "<string>"
            }
          ]
        }
      ]
    },
    "pricing": {
      "pricingModel": "PerUnit",
      "priceConfiguration": {
        "price": 1,
        "chunkSize": 1
      }
    },
    "id": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "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
name
string
required

The name of the meter

Minimum length: 1
eventName
string
required

The name of the event that the meter is tracking.

Minimum length: 1
aggregationMethod
object
required

The aggregation method defines how the events should be summed to represent a usage value.

filter
object

The filter to apply to the events to be included in the meter. The filter object contains an array of Conditions, each condition represents a logical OR statement. Each condition contains an array of Criteria (criterions), each criterion represents a logical AND statement.

pricing
object

The pricing data of the meter. The pricing data contains the pricing model and the pricing details.

Response

200
application/json
RequestSuccess
product
object
required