Send Docs Feedback

Note: Most user interface tasks can be performed in Edge Classic or the New Edge experience. For an overview, getting started topics, and release notes specific to the New Edge experience, see the docs.

Create a limit notification for a rate plan

You can create a limit notification for a rate plan using the monetization API.

You can notify developers through email when they're nearing or have reached a certain limit of a Volume Banded or Bundle rate card plan they've purchased. For example, if developers purchase a volume-banded plan with 1,000 calls in a bundle, you can notify them when they reach 800 calls (80% usage) or when they've spent $500 on API calls.

Notifications work with a single currency. You can't use this notification type if products use different currencies.

To set up a limit notification for a rate plan using the API, perform the following steps:

  1. Customize the notification template that will be used to notify the developer.
  2. Configure the notification condition and action.

Customizing the notification template

The following provides an example of how to customize the notification template that will be used to notify the developer. For more information, see Managing notification templates using the API.

$ curl -H "Content-Type: application/json " -X POST -d \    
'{
    "name": "RATE_PLAN_LIMIT_TEMPLATE",
    "subject": "Nearing your rate plan limit",
    "htmlImage": "<p>Hi ${developer.name} - Wanted to let you know that you have used 1000 API calls from your ${ratePlan.displayName} rate plan, which started on ${ratePlan.startDate} under the ${ratePlan.monetizationPackage.displayName} package and ${ratePlan.monetizationPackage.products.displayName} product. Just a friendly reminder that your API calls will be charged double after you cross 1500 calls. Thanks for using the API!</p>",
    "source": "Postman API call"
    }' \
"https://api.enterprise.apigee.com/v1/mint/organizations/myorg/notification-email-templates" \
    -u email:password

Configuring the notification condition and action

Configure a notification condition and action using the API, as described in Configuring notification conditions and actions using the API.

To trigger the notification for a rate plan limit, set the following attributes:

  • RATEPLAN - Type of notification to send.
  • PUBLISHED - Set this attribute to TRUE in order to trigger notifications on published rate plans.

Then, specify one of the following attributes:

  • Transactions - Number of transactions. For example, notify developers when they reach 1000 transactions. Must be an integer value, and only >  and = operators are allowed.
  • FeeExposure - Amount of dollars or points accumulated on transactions. Must be an integer value. FeeExposure doesn't include setup fee or recurring fee amounts. For example, notify developers when the cost of their API transactions reaches $500. FeeExposure calculations vary depending on the tax rate.

If a single transaction qualifies for more than one notification, multiple notifications are sent.

The following payload triggers an email notification when the number of transactions reaches 800:

$ curl -H "Content-Type:application/json" -X POST -d \
    '{
    "notificationCondition": [
      {
        "attribute": "RATEPLAN",
        "value": "{RATE_PLAN_ID}"
      },
      {
        "attribute": "PUBLISHED",
        "value": "TRUE"
      },
      {
        "attribute": "Transactions",
        "value": "= 1000"
      }     
    ],
   "actions": [{
          "actionAttribute": "DEV_ID",
          "value": "ANY",
          "templateId": "{EMAIL_TEMPLATE_ID}"
        }]
  }' \
"https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/notification-conditions" \
    -u email:password

Help or comments?