How can we integrate 3rd party billing to the WSO2 API Manager?
WSO2 API Manager with the integration of WSO2 Business Activity Monitor (WSO2 BAM) provides out of the box capability to generate API statistics. However some organisation would require the API Manager to be used with their own (3rd party) billing systems. There are few ways that this can be done. These methods are illustrated in the diagram below
1. The API Manager already collects all API related data when an API invocation is made by a service consumer. The API Manager can publish them to WSO2 BAM, which the WSO2 BAM uses to generate information required for API statistics. The same process can be utilized by a 3rd party tool to access API information from the API Manager. Once the data is published to the WSO2 BAM, WSO2 BAM would stores the data in a Cassandra data-store and summarize these data periodically based on a set of Apache Hive queries. The summarized information can then be inserted to a RDBMS which can be accessed by the 3rd party billing tool.
2. API Manager can publish to any thrift data endpoint which can be utilized by the 3rd party billing system to recieve data from WSO2 API Manager. This would provide direct integration with the 3rd party billing system.
3. API Manager uses a thrift data publisher to publish data to a billing system, it is possible to write an extension in the WSO2 API Manager to provide the capability to publish data in a different protocol to a 3rd party billing tool. This extends the capability of API Manager to work with any billing system that can recieve data using standard web API’s.
The WSO2 API Manager is shipped with a standard set of Hive queries(As part of the BAM toolbox) to summarize API data. It is possible to modify or write your own Hive queries to summarize the API information based on your own KPI’s to fit the needs of the 3rd party billing system. The billing system can directly access the RDBMS and use it as a data source to generate billing information.