Understanding API Monetization with WSO2 API Manager

Himasha Guruge
2 min readMar 2, 2020

This is a write up explaining how WSO2 API Manager[3.0] supports API monetization out of the box by integrating with Stripe as the billing engine.By extending the monetization interface (https://github.com/wso2/carbon-apimgt/blob/master/components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/model/Monetization.java) you can integrate with your preferred billing engine to monetize the APIs.

Stripe Accounts Concept

Stripe Tenant and Publisher Accounts

Stripe billing engine integration is based on the tenant admin and publisher accounts that are created. The association of these accounts can be understood with a real world example. Let’s assume an Org1 organization that consists of multiple units such as Insurance, Advertising, Finance etc and that Insurance and Advertising related APIs would need to be monetized based on the API usage. In such a case the tenant admin account that is created in Stripe represents the overall organization while separate publisher accounts (2 in this case) can be created to represent the different units. These publisher accounts will be connected with the Tenant account through a connectedID. Afterwards, when a new customer is registered from WSO2 end, each customer record is added to the tenant account and then copied to the relevant publisher account, and any subscription/billing plans of that customer will be generated under the publisher account.

Please take a look at https://youtu.be/Owe_xSTEc_Q for a demonstration of the above monetization flow using WSO2 API Manager 3.0 and Stripe. Following table depicts the changes that take place in Stripe accounts based on the different steps carried out in WSO2 API Manager.

--

--