Bookmark this page

Guided Exercise: Configuring Pricing Rules for API Consumption

In this exercise, you will configure both fixed and variable costs for a product. Because invoices are generated monthly, you will not be able to verify the reports immediately.

Outcomes

You should be able to:

  • Configure fixed costs for a product.

  • Create pricing rules for a metric.

As the student user on the workstation machine, use the lab command to prepare your system for this exercise.

[student@workstation ~]$ lab start monetizing-pricing

Procedure 7.2. Instructions

  1. View the echo product, which points to the 3scale Echo API.

    1. In the 3scale Admin Portal, navigate to the Products page. Click echo.

    2. In the left pane, click ApplicationsApplication Plans. The custom application plan is displayed.

    3. Click custom to access the settings page of the plan.

  2. Update the custom application plan to include a setup fee of 5 USD, and a cost per month of 3 USD.

    1. Complete the Setup fee field with 5.00.

    2. Complete the Cost per month field with 3.00.

    3. Click Update Application plan to save the changes.

  3. Update the custom application plan to charge 0.5 USD per request for the first 120 requests.

    1. Click custom to access the settings page of the plan.

    2. In the Metrics, Methods, Limits & Pricing Rules section, click Pricing (0) for the Hits metric row. The pricing rules are applied to the Hits metrics, which captures all paths.

    3. Click new pricing rule and complete the form:

      FieldValue
      From 1
      To 120
      Cost Per Unit 0.5

      Then, click Create pricing rule.

  4. Update the custom application plan to charge 0.3 USD per request for the following 1000 requests.

    1. Click new pricing rule and complete the form:

      FieldValue
      From 121
      To 1121
      Cost Per Unit 0.3

      Then, click Create pricing rule.

  5. Update the custom application to charge 0.1 USD per request from the 1122th request.

    1. Click new pricing rule and complete the form:

      FieldValue
      From 1122
      To (blank)
      Cost Per Unit 0.1

      Then, click Create pricing rule.

      Important

      To verify that the pricing rules work as expected, you can use the invoice reports generated by 3scale API Management. Because the reports are generated monthly, you can not verify the pricing rules of this guided exercise immediately.

Finish

On the workstation machine, use the lab command to complete this exercise. This is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab finish monetizing-pricing

This concludes the guided exercise.

Revision: do240-2.11-40390f6