Metering Elements

Metering Elements are key:value pairs that allow you to track and/or monetize specific elements (such as the content of query parameters) within calls to your API service

Metering Elements Overview

Monetization Use Case

Metering Elements are commonly used in monetization when a transactional pricing model is not appropriate for the service you are selling. A common scenario for element usage is when certain API calls cost you far more to deliver than others, and where the cost scales based on information contained in the API call.

For example, imagine that you operate a shipping tracking service, and you want to charge a subscription fee based on how many regions that an end user accessed in a subscription period. In this example, you don't want to charge transactionally, but instead you will charge a flat fee per region accessed. You can accomplish this type of pricing model using Metering Elements.

Steps to Enable Element-Based Pricing Models:

  1. Create the metering element key value pair using the instructions on this page.

  2. Configure the relevant asset with the possible metering elements for Revenium to monitor on the Asset configuration page. This allows the transaction engine to capture metering element information during API transactions to the targeted API assets.

  3. Add element-based pricing to your Product configuration (note, the assets configured in step 2 must be included in the Product). This will tell the Revenium metering engine how to charge the end user when the metering elements are used in an API call.

Access to Metering Elements

  1. Navigate to the "Manage" section of the left navigation menu.

  2. Search for the 'Metering Elements' link to view the related dashboard.

Create & Manage Metering Elements

Click the 'plus' sign or 'edit' icon to create or manage existing elements respectively. A modal will open allowing you to create or edit an existing Metering Element. (Figure 2)

  • Element Description - this is a human readable value that will help you to identify the purpose of the element when viewed in reports, on invoices, etc.

  • Element Key Name - this is the key in the JSON key-value pair that makes up the element. Revenium will look for this key value in your API call headers as well as an associated value pair and store the information contained in the value.

  • Element Type - defining your Element as a string or number will enable additional functionality in the future to build more complex pricing models. If your use case will contain a mix of numbers and strings, define the value as a string. (If you require additional element functionality to be implemented to support your use case, please let us know by using the in-app support tools)

    • See the element definition on the Product page for information on how Elements can be used to define the pricing model for a Product.

Analytics Use Case

If you simply wish to capture the usage of different query parameters in your API calls, the configuration is exactly the same as the monetization use case, with the exception of Step 3. There is no need to define a pricing model for metering element usage if you are not charging users based on the elements used in an API call.

Sending Element Usage Data to Revenium

Once you have followed the steps above to enable elements in your account, you can send test element data to the Revenium platform using a curl call like the one below.

Note that many of our data provider policies have built in capabilities to convert query parameters and their values into element data as well.

// Sending element data to Revenium

curl --verbose --request POST \
     --url 'https://api.revenium.io/meter/v1/api/meter' \
     --header 'content-type: application/json' \
     --header 'x-api-key: ENTER_APIKEY_HERE' \
     --data '
{
  "url": "https://test-asset-url.com/test/",
  "application": "any_application_id",
  "contentType": "application/json",
  "httpProtocol": "HTTP/1.0",
  "method": "POST",
  "responseCode": 200,
  "elements": [{"name": "yourElementName",
                "value": "yourElementValue"}]
}

Last updated

© Revenium - www.revenium.io