Was this Helpful?

Introduction

After you create a rate plan, you can publish it for viewing by developers or save it as a draft. If you publish the rate plan, all developers (if this is a standard rate plan), developers in the applicable category (if this is a developer category rate plan) or a specific developer (if this is a developer rate plan) will see the rate plan in the catalog in the developer portal. This also saves a copy of the rate plan in the package catalog.

Alternatively, you can save a draft of the rate plan without publishing it. This allows you to edit the plan as needed and publish it later. You can also discontinue a published rate plan.

After you publish a rate plan, the only property you can update is the end date. In addition, you cannot delete a published rate plan, so make sure it's final before you publish it.

Toolbox

You can publish a rate plan or save it as a draft using the management UI or monetization API. If you use the UI, you publish the plan by specifying an effective date and end date for the plan in the Publish Date section of the Rate Plan window. You can save a draft by clicking Save Draft in the Rate Card window.

If you use the API, you publish a rate plan by setting the published property to true in the request body in a call to the /organizations/{org_name}/monetization-packages/{package_id}/rate-plans resource (when you create the rate plan). You save the plan as a draft by setting the published property to false in the request body.

Publishing a rate plan using the UI

  1. In the Publish Date section of the Rate Plan window, enter an effective period for the plan:
    Field Description
    Effective Date

    The date when the plan starts. Developers are able to view the rate plan starting on this date.

    End Date

    The date when the plan ends. Developers are not able to view the rate plan after this date. If you don’t want the rate plan to end on a specific date, click No End Date.

  2. Click Save & Publish in the Rate Card window. This marks the plan as Published.
  3. Close the Rate Plan window by clicking the x at the top of the window.

    The rate plan is added to the Rate Plan list for the API package in the package catalog.

Saving a rate plan draft using the UI

  1. Click Save Draft in the Rate Card window.
  2. Close the Rate Plan window by clicking the x at the top of the window.

    The rate plan draft is added to the Rate Plan list for the API package in the package catalog. The draft is marked as a draft in the Draft/Future column.

Editing a rate plan draft using the UI

  1. Select the rate plan draft in the Rate Plan list.

    This opens the Rate card window for the rate plan draft.

  2. Click Edit.
  3. Edit the plan as appropriate.
  4. Click Save & Publish to publish the edited rate plan and save it in the package catalog. Or click Save to save the edited draft without publishing it. Before you publish or save the edited plan, you can also cancel the edits (and return to the previously saved version) by clicking Revert.

Deleting a rate plan draft using the UI

To delete a rate plan draft:

  1. Select the rate plan draft in the Rate Plan list.

    This opens the Rate card window for the rate plan draft.

  2. Click Delete Draft Plan.

    The rate plan is removed from the Rate Plan list in the Package Catalog.

Discontinuing a published rate plan using the UI

  1. Select the rate plan in the Rate Plan list.

    This opens the Rate card window for the rate plan.

  2. In the Publish Date section of the Rate Plan window, click Edit End Date.
  3. Enter a termination date in the End Date field.
  4. Click Save.

Publishing a rate plan using the API

To publish a rate plan, set the published property value to true when you create the rate plan. Developers will be able to view the rate plan starting on the date specified in the startDate property for the plan.

For example, the following creates a rate card plan and publishes it (only part of the request is shown):

$ curl -H "Content-Type:application/json" -X POST -d \
'{ 
     "name": "Flat rate card plan",
     "developer":null,
     "developerCategory":null,
     "advance": "false",
     …
     "published": "true",
     "ratePlanDetails": [
     …
      ],     
     …
     "type": "RATECARD"
     }],
     …
}' \
"https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/monetization-packages/location/rate-plans" \
-u myname:mypass

Saving a rate plan draft using the API

To save a rate plan without publishing it, set the published property value to false when you create the rate plan.

Updating a rate plan draft using the API

To update a rate plan draft, issue a PUT request to /organizations/{org_name}/monetization-packages/{package_id}/rate-plans/{plan_Id}, where{package_id} is the identification of the API package, and {plan_Id} is the identification of the rate plan. When you make the update, you need to specify in the request body the updated settings and the ID of the rate plan. If you update a rate plan rate, you also need to specify the ID of the rate plan rate. For example, the following request updates the rate plan rate in a rate plan whose ID is location_flat_rate_card_plan (the update is highlighted):

$ curl -H "Content-Type: application/json" -X PUT -d \
 '{ 
      "id" : "location_flat_rate_card_plan",
      "name": "Flat rate card plan",
      "advance": "false",
      "currency": {
       "id" : "usd"
      },     
      "description": "Flat rate card plan",
      "displayName" : "Flat rate card plan",
      "frequencyDuration": "30",
      "frequencyDurationType": "DAY",
      "earlyTerminationFee": "10",     
      "monetizationPackage": {
       "id": "location"
      },
      "organization": {
       "id": "{org_name}"
      },
      "paymentDueDays": "30",
      "prorate": "false",
      "published": "false",
      "ratePlanDetails": [
      {
       "currency": {
        "id" : "usd"
       },
       "paymentDueDays": "30",      
       "meteringType": "UNIT",
       "organization": {
        "id": "{org_name}"
       },
       "ratePlanRates": [
        {         
         "id" : "26b69b0b-9863-48c9-ba73-74a5b918fcec", 
         "type": "RATECARD",
         "rate": "0.15",
         "startUnit": "0"       
        }      
       ],     
      "ratingParameter": "VOLUME",
      "type": "RATECARD"
      }],
      "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/location_flat_rate_card_plan" \
-u myname:mypass

The response includes the updated rate plan rate (only part of the response is shown):

…
"ratePlanRates" : [ {
  "id" : "26b69b0b-9863-48c9-ba73-74a5b918fcec",
  "rate" : 0.15,
  "startUnit" : 0,
  "type" : "RATECARD"
} ],
…

Deleting a rate plan draft using the API

To delete a rate plan draft, issue a DELETE request to /organizations/{org_name}/monetization-packages/package_id}/rate-plans/{plan_Id}, where {plan_Id} is the identification of the rate plan to be deleted, and {package_id} is the identification of the API package for the rate plan. For example:

$ curl -H "Accept:application/json" -X DELETE \
"https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/monetization-packages/location/rate-plans/location_flat_rate_card_plan" \
-u myname:mypass

Accepting a published rate plan using the API

After a rate plan is published, a developer can accept it by issuing a POST request to /organizations/{org_name}/developers/{developer_id}/developer-rateplans, where {developer_id} is the identification of the developer. The request must specify the following in the request body:

  • The developer ID
  • The rate plan ID
  • The date when the rate plan goes into effect

You can optionally specify other properties in the request body. For a complete list of properties, see Developer acceptance rate plan configuration settings.

For example, the following request accepts a rate plan for a developer:

$ curl -H "Content-Type:application/json" -X POST -d \
'{ 
   "developer":{
     "id":"5cTWgdUvdr6JW3xU"
   },
   "startDate":"2013-08-30",
   "ratePlan":{
     "id":"location_&_messaging"
   },
   "suppressWarning":false
}' \
"https://api.enterprise.apigee.com/v1/mint/organizations/{org_name}/developers/5cTWgdUvdr6JW3xU/developer-rateplans" \
-u myname:mypass

Notice that the suppressWarning property in the example is set to false. This means that if there is a conflict ((due to the developer attempting to accept a rate plan that overlaps another rate plan that has already been accepted), an error is thrown. This enables an application that provides a user interface to monetization to display the conflicting products to the developer and get his consent (as appropriate). If suppressWarning is set to true, monetization terminates all subscriptions that the developer has to API packages that contain the conflicting products. It then subscribes the developer to a new package.

Developer acceptance rate plan configuration settings

The following configuration options are available for developer acceptance of rate plans:

Name Description Default Required?
startDate

The date when the plan starts.

N/A Yes
endDate

The date when the plan ends.

N/A Yes
developer

The developer that is accepting the rate plan. Specify the ID of the developer.

N/A Yes
ratePlan

The rate plan that is accepted. Specify the ID of the rate plan.

N/A Yes
suppressWarning

Indicates whether conflict errors (due to the developer attempting to accept a rate plan that overlaps another rate plan that has already been accepted) are suppressed. The value can be one of the following:

  • true. An error is not thrown if a conflict is detected. Instead, monetization will terminate all subscriptions that the developer has to API packages that contain conflicting products. It then subscribes the developer to a new package.
  • false. An error is thrown if a conflict is detected This enables an application that provides a user interface to monetization to display the conflicting products to the developer and get the developer’s consent (as appropriate). This is the default.

 

false No
waveTerminationCharge

Indicates whether termination fees are waved when an active plan is terminated as part of activating new plan. The value can be one of the following:

  • true. The termination fee is waved when an active plan is terminated as part of activating new plan.
  • false. The termination fee is notwaved when an active plan is terminated as part of activating new plan.

 

N/A No

Get help

For help, see Apigee Customer Support.

Next steps

At a future time, you might want to replace your published rate plan. For example, suppose you created a standard rate plan that expires on December 31, 2013 and you want to replace it with another plan that goes into effect on January 1, 2014. To do that, you can create a future rate plan and set it up to go into effect on January 1, 2014. Learn how in Create future rate plans.

You can also manage and control you API products and packages after they're published. For example, you can limit the number of transactions on an API product. Learn more in Set limits.

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?)