ProductUsageRule
Version: 1.33
Query ProductUsageRule directly for information, or query and use through Product, RecurringProductPrice, OneTimeProductPrice, FormulaProductUsageRule, GlobalProductUsageRule, MatchAllProductUsageRule.
Usage Events are governed by Usage Rules. Usage Rules detect a condition within a Usage Event and evaluate whether that condition is true or false. If the Usage Rule evaluates the condition as "true," an action occurs that could lead to a Customer charge. If the Usage Rule evaluates as "false," no action is taken and the event that is being evaluated passes to the next Usage Rule for evaluation.
To evaluate an event in the correct order, Usage Rules must be in a hierarchical order that you determine and change as needed. The customized Usage Rules and the order in which they are listed make up the Rate Plan.
Gotransverse has three types of Usage Rules:
-
Global Usage Rules -- complex Usage Rules that can be associated with, and used by any Product
-
Formula Usage Rules -- created as part of a Product definition and associated only with that Product, and uses equations and may use Lookup Tables
-
Match-All Usage Rules -- uses one of the following rates:
-
FlatUsageRate
-
PassThroughUsageRate - with the rate in the Event
-
Table including RateTable and UsageLookupTable
-
Usage Rules process events using the amount of usage reported, applying conditions and predefined Rates to the usage, and adding the results to the Customer's Billing Account for invoicing.
Further Gotransverse API information for this entity of ProductUsageRule:
Parameters
When you query an ProductUsageRule, the following table provides information about the values returned from the query:
Element Name | Query Key |
Element Type | Field Length |
Description |
---|---|---|---|---|
queryScope |
QueryScope |
- - |
Whether default query results are |
|
eid |
Y |
Long |
System |
System generated unique identity |
chargeCategory |
UsagePriceCategory |
- - |
Select the Usage Price Category. |
|
Choice of one of the |
One of the following |
- - |
Click on one of the following links |
|
limit |
decimal |
As |
||
usageUom |
UsageDurationUom |
- - |
Unit of measurement of the usage event to be measured |
|
name |
String |
255 |
The name of the Product Usage Rule. |
|
order |
Int |
As |
||
proratedOnOrder |
Boolean |
Shown either: |
Is this usage rate prorated on Order or not? |
|
proratedOnCancel |
Boolean |
Shown either: |
Is this usage rate prorated on Cancellation or not? |
|
rollOverType |
RollOverType |
255 One of the |
The type of rollover. See RollOverType for definitions. |
|
allowanceType |
AllowanceType |
255
|
The type of Allowance. See AllowanceType for definitions. |
|
validFrom |
dateTime |
See |
The date and time the ProductUsageRule begins. |
|
validTo |
dateTime |
See |
The date and time the ProductUsageRule ends. |
|
ruleType |
RuleType |
255
One of the |
The type of Rule. See RuleType. |
|
status |
ProductUsageRuleStatus |
255
One of the |
The status of the ProductUsageRuleStatus. |
Entity ProductUsageRules
The entity ProductUsageRules enables you to see multiple pages of the entity ProductUsageRule.
Element Name | Element Type | Field Length | Description | ||
---|---|---|---|---|---|
pageNumber |
Integer |
as needed |
Shows the current page number. |
||
pageSize |
Integer |
as needed |
Shows the page size. |
||
totalElements |
Long |
as needed |
Shows the total number of items found. |
||
elementCount |
Integer |
as needed |
Shows the current count of the item |
||
totalPages |
Integer |
as needed |
Shows the total number of pages. |
||
Select one: |
MatchAllOrderItemUsageRule |
- - |
Shows one of the following choices: |
Information for the related entity of ProductUsageRules:
-
Entity ProductUsageRules
How to Query for a ProductUsageRule
Query Key Information for SOAP and REST
Querying to see ProductUsageRules needs to include one of the following parameters. If you do not know the value for the parameter, query separately to learn the value.
Query Key Parameters
Query Key | Value | Definition | |||
---|---|---|---|---|---|
eid |
Long |
The unique eid number for the ProductUsageRule. |
|||
productEid |
Long |
The unique eid of the Product. |
|||
productPriceEid |
Long |
The unique eid of the ProductPrice. |
|||
status |
The status of the ProductUsageRule: |
Query | Query for | Parameter Name and Value | Returns | ||
---|---|---|---|---|---|
SimpleDataQuery | ProductUsageRule | <parameter name><parameter value> | List of your ProcuctUsageRules for that parameter name and value. |
SOAP Examples
SOAP Example Query
In the following example SOAP query, the parameter of productEid was used. The Product's EID value (in this example "1273"), was learned through a previous query on Product.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:query xmlns="http://www.tractbilling.com/billing/1_24/domain"xmlns:ns2="http://www.tractbilling.com/billing/1_24/service"> <ns2:queryRequest> <simpleDataQuery startIndex="0" size="50"> <type>ProductUsageRule</type> <parameter parameter="productEid" parameterValue="1273"/> </simpleDataQuery> </ns2:queryRequest> </ns2:query> </soap:Body> </soap:Envelope>
Move Product Usage Rule Up
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.tractbilling.com/billing/1_31/service" xmlns:dom="http://www.tractbilling.com/billing/1_31/domain"> <soapenv:Header/> <soapenv:Body> <ser:command> <!--Optional:--> <ser:commandRequest> <dom:moveProductUsageRuleUp> <dom:productUsageRule eid="96"> </dom:productUsageRule> </dom:moveProductUsageRuleUp> </ser:commandRequest> </ser:command> </soapenv:Body> </soapenv:Envelope>
Move Product Usage Rule Down
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.tractbilling.com/billing/1_31/service" xmlns:dom="http://www.tractbilling.com/billing/1_31/domain"> <soapenv:Header/> <soapenv:Body> <ser:command> <!--Optional:--> <ser:commandRequest> <dom:moveProductUsageRuleDown> <dom:productUsageRule eid="96"> </dom:productUsageRule> </dom:moveProductUsageRuleDown> </ser:commandRequest> </ser:command> </soapenv:Body> </soapenv:Envelope>
Activate Product Usage Rule
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.tractbilling.com/billing/1_31/service" xmlns:dom="http://www.tractbilling.com/billing/1_31/domain"> <soapenv:Header/> <soapenv:Body> <ser:command> <!--Optional:--> <ser:commandRequest> <dom:activateProductUsageRule> <dom:productUsageRule eid="116"> </dom:productUsageRule> </dom:activateProductUsageRule> </ser:commandRequest> </ser:command> </soapenv:Body> </soapenv:Envelope>
Deactivate(End Date) Product Usage Rule
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://www.tractbilling.com/billing/1_31/service" xmlns:dom="http://www.tractbilling.com/billing/1_31/domain"> <soapenv:Header/> <soapenv:Body> <ser:command> <!--Optional:--> <ser:commandRequest> <dom:deactivateProductUsageRule validTo="2016-06-04"> <dom:productUsageRule eid="99"> </dom:productUsageRule> </dom:deactivateProductUsageRule> </ser:commandRequest> </ser:command> </soapenv:Body> </soapenv:Envelope>
REST Examples
Query
GET https://my.tractbilling.com/t/s/r/1.24/productUsageRules/<eid>
GET https://my.tractbilling.com/t/s/r/1.24/productUsageRules?eid=<eid>
GET https://my.tractbilling.com/t/s/r/1.24/productUsageRules?productEid=<productEid>
GET https://my.tractbilling.com/t/s/r/1.24/productUsageRules?productPriceEid=<productPriceEid>
GET https://my.tractbilling.com/t/s/r/1.24/productUsageRules?status=<status>
REST Example Query and Response
The following example is a Query in REST for ProductUsageRule using a parameter of Product. The Product's EID value (in this example "1273"), was learned through a previous query on Product.
Query
GET https://my.tractbilling.com/t/s/r/1.24/productUsageRules?productEid=1273
The response shows the ProductUsageRule for this Product. This Product Name is "Tanning - 10 minutes per day" with
a description of "Tanning in a tanning bed for 10 minutes per day for a maximum of 60 minutes per week for Customers
who want to tan gradually. Tanning time rolls over to a maximum of 70 minutes."
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <productUsageRules xmlns="http://www.tractbilling.com/billing/1_24/domain/rest" xmlns:ns2="http://www.tractbilling.com/billing/1_24/domain" pageNumber="1" pageSize="50" totalElements="1" elementCount="1" totalPages="1"> <ns2:matchAllProductUsageRule status="ACTIVE" limit="70.00000" usageUom="WEEK" name="Rollover of Tanning Minutes" order="1" proratedOnOrder="true" proratedOnCancel="true" rollOverType="Uncapped" allowanceType="Recurring" validFrom="2012-02-22T00:00:00-06:00" ruleType="TAPERED" eid="421"> <ns2:chargeCategory name="Customer Tanning Usage Charge" priority="2" status="ACTIVE" eid="536"/> <ns2:flatUsageRate rate="0.60000" uom="MINUTE" validFrom="2012-02-22T00:00:00-06:00" eid="422"/> </ns2:matchAllProductUsageRule> </productUsageRules>
Move Product Usage Rule Up
POST https://my.tractbilling.com/t/s/r/1.33/productUsageRules/96/moveUp
<dom:moveProductUsageRuleUp xmlns:dom="http://www.tractbilling.com/billing/1_31/domain"> <dom:productUsageRule eid="96"> </dom:productUsageRule> </dom:moveProductUsageRuleUp>
Move Product Usage Rule Down
POST https://my.tractbilling.com/t/s/r/1.33/productUsageRules/96/moveDown
<dom:moveProductUsageRuleDown xmlns:dom="http://www.tractbilling.com/billing/1_31/domain"> <dom:productUsageRule eid="96"> </dom:productUsageRule> </dom:moveProductUsageRuleDown>
Activate Product Usage Rule
POST https://my.tractbilling.com/t/s/r/1.33/productUsageRules/96/activate
<dom:activateProductUsageRule validTo="2016-06-03" xmlns:dom="http://www.tractbilling.com/billing/1_31/domain"> <dom:productUsageRule eid="117"> </dom:productUsageRule> </dom:activateProductUsageRule>
Deactivate(End Date) Product Usage Rule
POST https://my.tractbilling.com/t/s/r/1.33/productUsageRules/99/deactivate/
<dom:deactivateProductUsageRule validTo="2016-06-03" xmlns:dom="http://www.tractbilling.com/billing/1_31/domain"> <dom:productUsageRule eid="99"> </dom:productUsageRule> </dom:deactivateProductUsageRule>