Getting started with API Monetization

For API monetization, there are typically two integrations you need to install.

The first step is to get your raw events in Moesif which can be in form of API logs or custom actions.

Log API Calls via Server Integration

Install a server integration to automatically log API traffic to Moesif. Moesif has many server integrations including plugins for most API gateways like Kong and AWS API Gateway along with most web frameworks like Node.js and Django. The server integration also handles governance. Your server integration should be configured to also identify the user or company. For most gateway plugins, this is handled automatically. However, the SDKs provide and identifyUser and identifyCompany option which enables you to set the request’s user id or company id.

Ingest Custom Actions

Instead of a server integration, you can directly send custom events to Moesif’s Track Action API. This can be done such as from an event stream like AWS Firehose and Logstash. See Options to Ingest Custom Actions.

Overview of Metered Billing

Connect Billing Provider

Once you have your raw events in Moesif, you can connect Moesif to a billing provider like Stripe or Zuora. The integration enables Moesif to automatically invoice customers and collect payments.

Lastly, you’ll want to create your plan, price, and billing meters in Moesif.

  1. Create plans and prices through Moesif product catalog for your pricing model such as PAYG, tiered, etc.
  2. Then create a billing meter which represents the billable metric like API Calls or Unique Users to charge for.

Create Plans and Billing Meters

Once you ingest your events into Moesif, you can start creating plans, prices, and billing meters.

  • A plan is the item you are selling like “Starter Plan”
  • A price is how the usage is rated which can contain tiers.
  • A billing meter represents the metric you want to charge on such as “API Calls” or “Gigabytes”

A full diagram on Moesif entities is below.

Moesif Entity Data Model