Rating Engine and PAYG Services
Rating Engine is one of the components that ensures that Pay As You Go services work in CloudBlue Commerce. This section contains information on how Rating Engine operates with Pay As You Go services.
CloudBlue Commerce PAYG Solution Components
To be a fully functional solution for usage-based services, your CloudBlue Commerce installation must include the following components:
Distribution Chain Structure
Rating Engine calculates charges for the following three interrelated distribution parties:
- Provider: the owner of the distribution contract with the vendor (distribution contract owner)
- Reseller (can be several reseller levels)
- End Customer
- Reseller (can be several reseller levels)
These roles can be played by different parties depending on the distribution chain structure. However, the relationship between them is always the same:
- Distribution through regional operating units ("OPCOs"):
- L0 (Provider): CloudBlue Commerce installation owner
- L1 (Provider's OPCO): Provider (distribution contract owner)
- L2 (Reseller): Reseller
- ...
- Li (Reseller): Reseller
- Li+1(Reseller's OPCO): Reseller
- ...
- Ln (Customer): End Customer
- ...
- Li+1(Reseller's OPCO): Reseller
- Li (Reseller): Reseller
- ...
- L2 (Reseller): Reseller
- L1 (Provider's OPCO): Provider (distribution contract owner)
- L0 (Provider): CloudBlue Commerce installation owner
- Distribution through third-party resellers:
- L0 (Provider): Provider (distribution contract owner)
- L1 (Reseller): Reseller
- ...
- Ln-1 (Reseller): Reseller
- Ln (Customer): End Customer
- Ln-1 (Reseller): Reseller
- ...
- L1 (Reseller): Reseller
- L0 (Provider): Provider (distribution contract owner)
- Direct distribution:
- L0 (Provider or Reseller): Provider (distribution contract owner)
- L2 (Customer): End Customer
- L0 (Provider or Reseller): Provider (distribution contract owner)
Data Processing Prerequisites
To be able to process usage data, Rating Engine requires that all reported usage items have:
- MPNs
- Reconciliation IDs
-
Vendor Contract IDs: must be set at the level of the vendor contract owner or vendor contract owner’s operating unit that owns the service plan.
Usage Data Flow Diagram
The functional diagram below illustrates a high level usage data flow for CloudBlue Commerce installations that support usage-based services, including the Rating Engine function:
How Usage Reports Are Processed
-
Usage Collector receives usage reports from service vendors through API:
-
Batch Import API, which is used by VRD Collector and can be used by service vendor systems.
-
File Import API , which is used by CloudBlue Connect and UX1 for Providers UI and can also be used by service vendor systems.
-
-
Usage Collector stores usage report source files to a file storage. Providers can download them for reconciliation purposes from the UX1 for Providers UI.
-
Usage Collector validates the uploaded usage report.
-
The periodic OSS task Usage Collector ... guiding schedule guides usage reports: discovers CloudBlue Commerce Resource IDs and Subscription IDs by the reported Reconciliation IDs and MPNs.
-
If guiding of all records is successful, the usage report gets the Validated status and is now ready to be rated.
-
If guiding of at least one record fails, the usage report gets the Data Validation Failed status and cannot proceed to the rating stage. To continue the processing, the provider must download the error report, troubleshoot the errors, and re-upload the usage report in the UX1 for Providers UI.
-
The periodic OSS task Rating Orchestrator ... schedule (brought by Rating Orchestrator) processes usage reports with the Validated status (the default interval is 30 minutes):
-
Rating Orchestrator requests unprocessed usage reports from Usage Collector.
-
Rating Orchestrator sends records from usage report to Rating Engine to rate.
-
Rating Engine rates the delivered usage records and stores the calculated charges in the Rating Engine database.
-
If Rating Engine completes the rating of all usage records of a usage report, the report receives the Rated status.
-
If Rating Engine cannot rate at least one record from a usage report, the report receives the Rating Failed status and cannot proceed to further processing. To continue processing, the provider must download the error report, troubleshoot the errors, and resubmit the usage report for processing in the UX1 for Providers UI.
-
-
When the rating process for all usage records is completed:
-
For the CR, PR, and TR rating models: With the help of Order Management, Rating Orchestrator immediately places billing orders for each subscription from the usage report. When all the necessary billing orders are placed, the usage report receives the Processed status.
-
For the QT rating model: If the processing is successful, the usage report receives the Processed status. Then, for each subscription from the usage report, the Daily Billing Process creates a billing order on the next subscription billing date.
-
-
After all the necessary billing orders are placed:
-
For each billing order, the BSS Order Flow requests Rating Engine to bill subscriptions from the billing order.
-
Rating Engine returns order details (including the usage data from the usage reports).
-
-
The applicable BSS Order Flow continues: The order details are added to the billing order, taxes are applied and so on.
How Rating Engine Receives and Processes Usage Data
Usage data for PAYG services is rated by service vendors for a distribution chain of three main parties:
-
Provider: a "distribution contract owner" who distributes through regional operating units ("OPCOs") or third-party resellers
-
Reseller: an "OPCO" or a third-party reseller
-
End Customer: a service consumer
Note: Variable distribution network compositions are supported. There can be several provider parties and multiple reseller parties and a third-party reseller can have a distribution contract with the service vendor and play the provider role for its subresellers.
Rating Engine supports the following rating models (or "schemas") for usage data exported by vendors:
-
Usage data rated by the vendor for all parties ('Tier Rated' or 'TR'): The vendor calculates the costs and prices for consumed services for the Provider, Reseller, and End Customer based on sales margins configured in the vendor's system. No additional calculations are necessary.
-
Usage data rated by the vendor for the End Customer ('Price Rated' or 'PR'): The vendor calculates the charges for the End Customer. The costs for the Provider and Reseller must be calculated on the Provider's side based on the End Customer prices and sales margins configured in CloudBlue Commerce.
-
Usage data rated by the vendor for the Provider ('Cost Rated' or 'CR'): The vendor calculates the charges for the Provider. The prices for the Reseller and End Customer must be calculated on the Provider's side based on the Provider costs and sales markups configured in CloudBlue Commerce.
-
Non-rated quantity-only usage data ('Quantity' or 'QT'): The vendor reports only the consumed resource quantity. The extended price is calculated based on the reported quantity and resource prices configured in CloudBlue Commerce.
Important: The QT schema works only with the Product Lifecycle Management component.
Rating Engine receives usage data from Rating Orchestrator and processes it in the following way:
-
Rating Engine processes the vendor-calculated charges and calculates the remaining charges based on the imported data and margins and markups configured in CloudBlue Commerce in the following way:
-
Usage data rated by the vendor for all parties ('Tier Rated' or 'TR'): For this data type, the microservice makes no additional calculations. The imported charges are included in invoices without modifications.
If usage data is reported without provider ("distribution contract owner") costs for the Tiers Rated model:
The usage data is processed but reconciliation may be complicated. If a PAYG application does not report provider costs for the Tiers Rated model, contact the application developer and the service vendor.
Note: Azure NCE version 1.5 mandatorily reports provider costs data, which simplifies reconciliation. If your Azure NCE application does not report provider costs for the Tiers Rated model, upgrade it to version 1.5.
-
Usage data rated by the vendor for the End Customer ('Price Rated' or 'PR'): For this data type, the microservice calculates the costs for the other distribution chain parties (from the lowest level Reseller to the Contract Owner) based on the configured margins using the following formula:
Cost = Price * (1 - Margin / 100)
Where the fields have the following values depending on the distribution party*:
- Cost is the distributor’s cost (a contract owner’s cost or a reseller's cost).
- Price is the subscription price of the resource received from the vendor and paid by the End Customer.
- Margin is the TOTAL MARGIN value at the contract owner's or reseller level.
*Contract Owner can be a distribution contract owner or its OPCO at any level depending on the distribution chain structure.
-
Usage data rated by the vendor for the Provider ('Cost Rated' or 'CR'): For this data type, the microservice calculates the prices for the other distribution chain parties - the Reseller and the End Customer - based on the configured markups using the following formula:
Price = Cost * (1 + Markup / 100)
Where the fields have the following values depending on the distribution party*:
- Price is the distributor's sales price (a contract owner's or reseller's sales price).
- Cost is the distributor's cost (the price paid for the product item usage to the immediate upper-level distributor).
- Markup is the YOUR MARKUP value defined by the distributor.
Note: The End Customer pays the price calculated at the lowest reseller's level. Distributors can regulate the price using markups depending on market conditions. The effective price for the End Customer depends on markups defined by all distributors and does not depend on markup recommendations distributors give to their resellers.
*Contract Owner can be a distribution contract owner or its OPCO at any level depending on the distribution chain structure.
-
Non-rated quantity-only usage data ('Quantity' or 'QT'): For this data type, Rating Engine calculates charges based on the reported resource quantity consumed and the resource overuse fee.
-
- The resulting charges are included in billing orders and invoices (customer invoices, reseller transactions, and future reseller invoices).