Cloud Services

ModernOps

Rate cards
Published On May 30, 2024 - 1:04 PM

Rate cards

Get a description of rate cards and learn the different actions you can take on them.
A rate card is the price of the service offerings that appears on each page of the catalog once the pricing information has been uploaded.
The rate cards in Kyndryl Modern Operations Applications is a collection of pricing rules, which are organized into a set of plans that contain groups and items. Each rate card must contain a minimum of one plan, one group, and one item; and there are no maximums.
The rate cards service provides the ability to price a service based on its usage and it can be used to price any service whose usage can be obtained in public clouds, private clouds, or datacenters.
The type of currency that is used for the rate card is based on your currency selection in the Kyndryl Modern Operations Applications. The default is United States dollars (USD).

Creating a pricing JSON file

Before you can create a rate card, you need to create a pricing JSON payload, which is sent with the API request. This file can be created from a provider template or from scratch. The RateCard/Pricing adapter creates a rate card using the POST API.
A rate card is a collection of formulas and stack of plan types. Every rate card has one or more plans, and every plan has one or more groups, and each group has one or more items. Every rate card has a minimum of one plan, one group, and one item.
A rate card therefore has the following structure:
  • rate_card_plans
  • rate_card_groups
  • rate_card_items
The price of a product is described by a rate plan. A rate plan represents a collection of groups that the customers may incur in when buying the product.
If you want to purchase a product, you can choose from one of the available rate plans. By using rate plans, a rate card provides the power and flexibility to handle complex pricing plans for any product or service and supports a business model where the amount to charge is calculated and invoiced periodically based on the number of services consumed.
Each product rate plan contains one or more groups with items, which are the individual charges associated to the product. The estimated price for a service displayed in the Enterprise Marketplace Catalog is calculated as follows:
(Estimated) Price of a service = (Estimated) Cost of service + One-time charges (if any) – Discounts/Upcharge + taxes
To execute a rate card, you must look at the named variables within the rate card and expressions within the rate_card_items to be sure the right formulas are applied for services offered. Focus on the when and then keys of the expression key of the rate_card_items.
If the input_data is equal to the
when expression
, you should expect the rate card execution to return an output that lists the then variable and value that correspond with the when under review.
A pricing JSON file is created using the following parameters:
  • Plan Name:
    The name of the plan, such as Gold.
  • Plan Description:
    A description of the plan, such as "to consume a medium usage VM."
  • Variable:
    Variables are items that are defined once and can then be used across the rate card. It is common to define a base price as a variable that is then modified with variables for different plans. This type of variable is useful if you want the price or recurring price dynamically calculated based on how a user completes the Order in Enterprise Marketplace.
  • Pricing rules:
    One or more rules that determine when the plan is implemented. Pricing rules are used by the system to determine which plan is used for each request. There can be one or more rules for each plan. Rules consist of the following parameters:
    • Rule Name:
      The name of the rule.
    • Payment Type:
      This parameter determines the frequency at which the pricing is applied. The available values are:
      monthly
      ,
      hourly
      ,
      yearly
      , and
      once
      .
    • Rule Condition:
      Enables you to define pricing conditions that you can link to multiple parameters. The pricing engine evaluates the formula, and then chooses one of these factors, depending into which range the actual pricing attribute of the item falls.
    • Pricing Formula:
      Defines a formula for the price condition to evaluate. You can only select one type of target, such as field, tested variable, or tested formula, per price condition.
    • UOM:
      The unit of measurement that is used when calculating the cost.
    • Value:
      The amount of the unit of measurement to increment by.
The following is an example of a pricing rule that takes effect if the disk size is greater than 40 and less than or equal to 100:
"when": { "and": [ { ">": [ { "var": "disk_size" }, 40 ] }, { "<=": [ { "var": "disk_size" }, 100 ] } ] }
When the rule is true, it executes a
then
block like the one shown in the following example:
"then": [ { "uom": { "code": "GB", "value": 1 }, "name": "basePrice", "json_formula": { "var": "base_price" } }, { "uom": { "code": "", "value": 1 }, "name": "increment", "raw_formula": "max(min(60, disk_size - 40), 0) * increment" } ]
In this example, the value of base_price is set to 49 as seen in the variables block. Assuming disk_size is set to 70,
increment
will be set to 60 going by the raw_formula above and the value of increment set in rate_card_groups with id: 8c174830-8e54-4d7d-95c5-e2b4bdcafc94 as shown in the following code block:
{ "id": "increment", "value": 2, "data_type": "number" }
Variables are overwritten if they are redefined in a formula.

Creating rate cards

At a conceptual level, creating rate cards involves the following stages:
  • Export metadata from the service provider as a JSON file or create your own pricing JSON.
  • Run the NAME API to fetch the pricing information using the JSON file as the payload.
  • Import the pricing information from the API into Enterprise Marketplace as a rate card.
Use the following API to create a rate card. Provide the pricing JSON file that you created as the payload.
POST: /ratecard/ratecards ()
The payload should look like the following example pricing JSON file:
{ "name": "testratecard2", "client_id": "testclient002", "description": "This is a test ratecard2", "currency_code": "USD", "applicable_for": [ { "is_metadata": false, "id": "trc002", "label": "trclbl002", "values": [ { "id": "trcval002", "label": "valbl002" } ], "sequence": 2 } ], "variables": [ { "id": "randomstring2", "value": 14, "values": [ { "value_id": "number", "label": "sdskjkjnd" } ], "data_type": "number" } ], "rate_card_plans": [ { "id": "002", "name": "rc002", "sequence": 2, "description": "p0lan1", "variables": [ { "id": "randomstring2", "value": 14, "values": [ { "value_id": "number", "label": "lbl02" } ], "data_type": "number" } ], "rate_card_groups": [ { "id": "idstring", "name": "nmstring", "sequence": 2, "description": "desc string", "variables": [ { "id": "string16", "value": 16, "values": [ { "value_id": "number", "label": "lblstring" } ], "data_type": "number" } ], "rate_card_items": [ { "id": "item2", "name": "item002", "sequence": 1, "description": "test item2", "frequency": { "code": "YEAR", "value": 2013 }, "expression": { "when": {}, "then": [ { "uom": { "code": "sdqdsing", "value": 35 }, "name": "dddring", "raw_formula": "string", "json_formula": {} } ] } } ] } ] } ], "parameters": [ { "id": "prm2", "name": "testparam2", "description": "This is a test param2", "data_type": "number", "uom": [ { "code": "oidhwd2", "value": 200 } ], "range": [ { "min": 0, "max": 0, "step": 0 } ], "min_size": 0, "max_size": 0, "regex": "string", "value": 13, "values": [ { "value_id": "number", "label": "lblstr1" } ] } ] }

Retrieving a rate card

This API retrieves a list of rate cards based on the
client_id
and
applicable_for
details that you supply in the payload, supplying the details in the output.
POST: /ratecard/ratecards/applicablefor
Supply the
client_id
and the
applicable_for
details of the desired rate card in the payload as shown in the following sample payload:
{ "client_ids": [ "testclient002" ], "applicable_for": [ { "id": "trc002", "label": "trclbl002", "values": [ { "id": "trcval002", "label": "valbl002" } ] } ] }

Getting a rate card

To get a specified rate card based on the
rc_id
, use the following API:
GET: /ratecard/ratecards/rc_id
The API returns the complete rate card. You can also get a list of all rate cards by not specifying a
rc_id
.

Testing a rate card

If you want to test your rate card without making any changes to your database, you can do so using the following APIs.

Creating a testing web page

You can create a web page that allows you to test your rate card. You do not have to supply any parameters. Just click the
Playground to test a raw RateCard
link to open a new window where you can test the rate card.
GET: /ratecard/ratecards/play

Opening the testing web page

After you open the testing web page, you need to activate it using the following API. When you have done so, you can freely create and execute rate cards without altering your database.
POST: /ratecard/ratecards/play

Executing a rate card

After you have created and tested your rate card, this API executes it and returns an output that verifies that the rate card is properly constructed.
POST: /ratecard/ratecards/rc_id/execute
For details on the description of the process of viewing rate cards in the Kyndryl Modern Operations Applications, see Rate cards view.
Do you have two minutes for a quick survey?
Take Survey