Was this helpful?

Introduction

You can set up a rate card plan where the developer is charged based on a custom attribute within each transaction. For example, you can set up a plan such that the developer is charged for the number of bytes transmitted in a transaction. Other than that, the rate plan is the same as the rate card type. In particular, you need to provide the same additional details about the charging model (for example, whether developers are charged at a fixed rate or a variable rate) and pricing (such as the rate charged).

You can set up a rate card with custom attribute plan only if you specify custom attributes for the API product and only for an API package that has one product. (Learn how to specify custom attributes in Create a transaction recording policy)

You can also set up a freemium plan for the product (rather than for an API package) — you can do this only for a product-specific plan.

Toolbox

You can specify rate card plan details using the management UI or monetization API. If you use the UI, you specify the details in the Rate Card window.

If you use the API, you specify rate card plan details in the ratePlanDetails property within the request body in a call to the /organizations/{org_name}/monetization-packages/{package_id}/rate-plans resource (when you create the rate plan).

Specifying details for a rate card plan with custom attributes using the UI

  1. Select Rate Card. As is the case for the Rate Card type, this link appears below the Specific or Generic field when you select Rate Card with Custom Attribute as the rate plan type.

    This opens the Rate Card window.

    Notice that fields for Custom Attribute and Rating Unit appear in the Rate Card window.

  2. Select a custom attribute in the Custom Attribute drop-down menu. The menu lists custom attributes created for the product in a Transaction Recording policy. The developer is charged based on the selected custom attribute within each transaction.
  3. Enter a name in the Rating Unit field. This name is used to identify the custom attribute in reports and billing documents.
  4. Optionally, set up a freemium plan as described in Specify rate card plan details .
  5. Set up a charging model as described in Specify rate card plan details. Note, however, that for the Rate Card with Custom Attribute rate plan type, the charging model is based on the custom attribute you select. For example, if you choose Flat Rate as the charging model, the developer is charged a fixed rate based on the custom attribute, such as the number of bytes transmitted in each transaction (not a fixed rate for each transaction).

Specifying details for a rate card plan with custom attributes using the API

You specify details for a rate card plan with custom attributes when you create the rate plan. You specify the details in the ratePlanDetails property within the request body in a call to /organizations/{org_name}/monetization-packages/{package_id}/rate-plans. In the details, you specify a rating parameter value that identifies the name of the custom attribute. You can also specify a rating parameter value that aggregates the custom attribute over a specified time interval.

See Rate plan details configuration settings for a complete list of rate plan detail options.

For example, the following creates a rate card plan based on a custom attribute named user (the custom attribute-related specifications are highlighted.)

$ curl -H "Content-Type:application/json" -X POST -d \
'{
   "name": "Custom attribute-based rate card plan",
   "developer":null,
   "developerCategory":null,
   "currency": {
     "id" : "usd"
     },     
   "description": "Custom attribute-based rate card plan",
   "displayName" : "Custom attribute-based rate card plan",
   "frequencyDuration": "1",
   "frequencyDurationType": "MONTH",
   "earlyTerminationFee": "10",
   "monetizationPackage": {
      "id": "location"
        },
      "organization": {
       "id": "{org_name}"
      },    
   "paymentDueDays": "30",
   "prorate": "false",
   "published": "false",     
   "ratePlanDetails":[
      {
        "currency":{
           "id":"usd"
        },
      "duration":1,
      "durationType":"MONTH",
      "meteringType":"VOLUME",
      "paymentDueDays":"30",
      "ratingParameter":"user",
      "organization":{
         "id":"{org_name}"
      },
      "ratePlanRates":[
         {
           "rate":0.15,
           "startUnit":0,
           "type":"RATECARD",
           "endUnit":1000
         },
         {
           "rate":0.1,
           "startUnit":1000,
           "type":"RATECARD",
           "endUnit":null
         }
      ],
      "freemiumUnit":0,
      "freemiumDuration":0,
      "freemiumDurationType":"MONTH",
      "type":"RATECARD",
      "product":{
         "id":"location",
         "displayName":"Location"
      },
      "ratingParameterUnit":"MB",
      "customPaymentTerm":false
      }
    ],
    "freemiumUnit":0,
    "freemiumDuration":0,
    "freemiumDurationType":"MONTH",
    "contractDuration":"1",
    "contractDurationType":"YEAR", 
    "recurringStartUnit": 1,
    "recurringType": "CALENDAR",
    "recurringFee": "10",
    "setUpFee": "10",
    "startDate": "2013-09-15 00:00:00",
    "type": "STANDARD"
}' \
"https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/monetization-packages/location/rate-plans" \
-u myname:mypass

Get help

For help, see Apigee Customer Support.

Next steps

After you create the rate plan and provide rate plan details, you can publish the plan or save it as a draft. See Publish rate plans for more information.

Help or comments?

  • Something's not working: See Apigee Support
  • Something's wrong with the docs: Click Send Feedback in the lower right.
    (Incorrect? Unclear? Broken link? Typo?)