Getting started with API Monetization
1.
Install Server Integration
Install a server integration to log API traffic or ingest custom actions directly.
View Integrations
2.
Setup Billing Provider
Connect Moesif to your billing provider like Stripe for automatic invoicing.
View Setup
3.
Create a Plan and Price
Create a pricing model such as tiered, PAYG, and more.
View Product Catalog
4.
Create a Billing Meter
Create a billing meters for usage-based billing or create a quota rule.
View Billing Meters
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.
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.
- Create plans and prices through Moesif product catalog for your pricing model such as PAYG, tiered, etc.
- 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.