Creating an API Project
Refer the Manage API Projects section to create an API Project.
Click the icon beside the respective project to open it.
Creating a Monetization Limit Check policy
Click the Policy Configurations icon on the left margin in the API Projects screen and perform the following actions:
Create a Monetization Limit Check policy.
- Click the environment in which configuration needs to be set, select the Enabled option and click the save icon to save the policy.
Adding the policy to the Project Level Policies repository
- Click the Project Level Policies icon and go to the Proxy Response tab.
- Click the Add button and select the Monetization policy from the dialog box
- Click OK to add the Monetization policy and click the Save icon to apply the changes.
Creating a product and Adding to the Monetization Project
Go to the Applications page and perform the following in the Products section.
- Add a new API Product
- Provide the values as per requirement and click the Edit icon in the Projects in product section to add the project added in Step 1.
- In the Add/remove projects section, select the new project created and click the OK icon.
- Click the Save icon to save the product configuration.
- Add a new API Product
Configuring Monetization
Click the Monetization tab under the Product Configuration section.
Adding a Transaction Recording Policy
- Expand the Transaction Recording Policy section and click the Add button.
- Add the parameters to be checked to the context variables and click OK.
- Click the Add button in the Transaction Success Criteria section and add an attribute named "Status" to configure success criteria. Select Checking Criteria as "EQUALS".
- Click the Save icon to save the configuration.
Adding Product rate plans
- Expand the Rate Plan section, click the Add icon and add a Rate Plan ID. Click OK.
- Under the Plan Details tab, select the "Metering Type" from the options UNIT, STAIR_STEP, and VOLUME, specify the "Duration", "Renewal Term" and the "Payment Due" details. Specify the Freemium Package (optional); else select "NO".
- In the "Rate Plan Rates" tab, click the Add icon to add the Rate for transactions depending on the "Metering Type".
- Click the Fees tab and enter all other fees details.
- Click the Save icon to save the product.
Creating Client
- Click the Clients icon on the left pane in the Applications page, click the Add button and provide a valid email ID.
- Specify configuration details and click the Save icon to save the client details.
Creating Client Subscription with the Monetization product
Click the Client Subscriptions icon present below the Clients icon and perform the following actions:
- create a new client subscription choosing the client added above.
- Provide the subscription details and click the Edit button in the Subscribed Products property.
- Use the "Subscribed Products" option to select the product and the rate plans associated with the product.
- Click the Save icon to save the Client Subscription.
Verifying Monetization Setup
To verify whether monetization is enabled, the rate plan ID is set correctly and the limit was successfully executed, perform the following actions in the Analytics page.
Go to the Advanced tab in the Analytics screen. In the Group by drop-down, select the options below as required:
- MONETIZATION_ENABLED: To verify whether Monetization is enabled or not.
- MONETIZATION_SUCCESS: To verify whether Monetization Limit Check is applied correctly or not.
API_APPLICATION_RATEPLAN_ID: To verify whether the rate plan ID is set correctly or not.
The green color in the graph represents successful completion of the above tasks and the blue represents failure.