Installing Monetization Services

Monetization Services is an extension to Apigee Edge, hence it does not run as a standalone
process. It runs within any existing Apigee Edge setup.

Monetization requirements

If you are installing Monetization on an Edge topology that use multiple Management Server
nodes, such as a 13-node installation, then you must install both Edge Management Server nodes
before installing Monetization.

To install Monetization on Edge where the Edge installation has multiple Postgres nodes,
the Postgres nodes must be configured in Master/Standby mode. You cannot install Monetization
on Edge if you have multiple Postgres master nodes. For more, see Install the Edge apigee-setup utility.

Installation overview

The following steps illustrate how to add Monetization Services on an existing Apigee Edge
installation:

Use the apigee-setup
utility to update the Apigee Management Server node to enable the Monetization Services, for
example, catalog management, limits and notifications configuration, billing and
reporting.

If you have multiple Management Server nodes, such as a 13-node installation, then you must
install both Edge Management Server nodes before installing Monetization.

Use the apigee-setup
utility to update the Apigee Message Processor to enable the runtime components of the
Monetization Services, for example, transaction recording policy and limit enforcement. If you
have multiple Message Processors, install Monetization on all of them.

In a single data center installation, all ZooKeeper nodes are by default configures as
leaders. When you are installing Edge across multiple data centers, some ZooKeeper nodes will
be configured as observers. Ensure that the ZK_HOSTS property above specifies a leader node in
a multiple data center installation.

If you enable Cassandra authentication, you can pass the Cassandra user name and password
by using the following properties:CASS_USERNAME
CASS_PASSWORD

Integrate Monetization Services
with all Management Servers

Use the following procedure to integrate monetization on Management Server nodes.

If you are installing Monetization on an Edge topology that uses multiple Management Server
nodes, such as a 13-node installation, then ensure that you installed both Management Server
nodes before installing Monetization.

The configuration file must be accessible or readable by the "apigee" user.

If you are installing Monetization on multiple Management Server nodes, repeat step 2 on
the second Management Server node.

On successful configuration, an RDBMS schema for Monetization Services is created in the
PostgreSQL database. This completes the integration of Monetization Services and its associated
components with Postgres Server.

Integrate Monetization Services
with all Message Processors

Use the following procedure to integrate monetization on all Message Processor
nodes.

On the first Message Processor node, at the command prompt, run the setup script:>
/opt/apigee/apigee-setup/bin/setup.sh -p mo -f configFile

The “-p mo” option specifies to integrate Monetization.

The configuration file must be accessible or readable by the "apigee" user.

Repeat this procedure on all Message Processor nodes.

On successful configuration, the Message Processor is updated with Monetization Services. This
completes the integration of Monetization Services and its associated components with the Message
Processors.

Monetization Onboarding

To create a new organization with monetization enabled, you first create the organization as
you would for any new organization. For more information, see Onboard an organization.

Additional Onboarding to enable Monetization for an organization

To complete monetization onboarding of an organization, you have to:

Create the monetization group: mxgroup.

Add Qpid to the group.

Enable monetization for the organization.

Enable notification settings for the organization.

Repeat this process for all organizations where you want to enable Monetization.

Use the enable-monetization
command to perform all of these tasks. This script takes a configuration file containing the
following properties:

The configuration file must be accessible or readable by the "apigee" user.

If you have multiple Management Servers, you only have to run this script on one of them.

This script replicates the organization, products, developers and applications from Cassandra
database to Monetization PostgreSQL database. After successful installation of Monetization
Services the data is synchronized automatically.

Repeat this procedure for every organization where you want to enable Monetization.

If you are in a multiple data center environment, repeat this process on the Management
Server in the other data center. Ensure that the config file list only the Qpid nodes in the
data center being configured.

When you next log in to the Edge UI, you see the Monetization entry in the top-level menu for
the organization:

Configure the Developer
Services portal

Adding a Management Server node
to a Monetization Installation

If you add a Management Server to an existing Edge installation, you must ensure that you add
Monetization services to the new Management Server and configure all Management Servers so they
can communicate.

To add a Management Server:

Install the new Management Server.

Install Monetization on the new Management Server.

On the original Management Server, call the following:>
/opt/apigee/apigee-service/bin/apigee-service edge-mint-management-server
mint-configure-mgmt-cluster

Additional configuration

Provide Billing Documents as
PDF Files

Monetization displays billing documents to end users in HTML format. To provide billing
documents as PDF files, you can integrate Monetization with a billing system that provides PDF
generation or license a supported third-party PDF library.

Configure Organization
Settings

Backend settings: The following table lists the organization level attributes
that are available to configure a mint organization. You can use a PUT call to add/update these
attributes as shown below:

Note: If you are using Monetization Services Limits and Notifications
features, please instruct your developers to attach a Limit Policy in the proxy flow after the
access token validation policy.

Limit Policy is an explicit policy designed to block an API call if certain limit has been
reached. The policy checks business limits and raises a fault if there are any limits exceeding
the configured value. This is an extension of raise fault policy but the conditions are derived
from business variables.

A UI template is available in the management UI for proxy developers. Proxy developer should
attach mint policy in the message flow. Upon execution of this policy the fault will be raised
with the fault response as per policy. If ContinueOnError is set to true then the fault
will not be raised and flow variables "mint.limitsViolated", "mint.isDeveloperSuspended" and "mint.limitsPolicyError" variables will be set
which could be used for further exception handling if required.