Calculate Price
/rest/v16/pricing/actions/calculatePrice
Request
- application/json
object
-
currencyCode(required):
string
Title:
Currency Code
Currency code for the currency. -
customerId:
string
Title:
Customer ID
Customer ID of the customer (account). -
headerAttributeValues:
object Header Attribute Values
Title:
Header Attribute Values
Values of pricing attributes at the header level. -
items:
array Items
Title:
Items
Input data for items to be priced. -
priceBookVarName:
string
Title:
Price Book Variable Name
Variable name of the CPQ price book.
object
Header Attribute Values
-
_priceAsOf:
string
Title:
Price As Of
Price as of date. When empty, the current timestamp at the pricing execution is used. -
region:
string
Title:
Region
-
vehicleAmount:
integer
Title:
Vehicle Amount
object
-
itemAttributeValues:
object Item Attribute Values
Title:
Item Attribute Values
Values of pricing attributes at the item level for a specific item. -
itemIdentifier(required):
string
Title:
Item Identifier
An item's unique identifier. This can be any identifier desired by the client. -
partNumber(required):
string
Title:
Part Number
Part Number of the CPQ product.
object
Item Attribute Values
-
_bomItemVariableName:
string
Title:
Bom Item Variable Name
Variable Name of the BOM item definition for a BOM item. It is empty for a part item. -
_quantity:
integer
Title:
Quantity
The exploded line quantity used in Pricing Engine. For example, in a product hierarchy with 2 child products per root product and 3 grandchild parts per child product, this value will be '6' for the grandchild product when the root quantity is '1', and 12 when the root quantity is '2'. This attribute implicitly maps to the Quantity (_price_quantity) attribute in the quote line Price Attribute Set, but the default can be overridden by explicitly defining a different mapping. -
_requestedRatePlanNumber:
string
Title:
Requested Rate Plan Number
Requested Rate Plan Number. -
accountType:
string
Title:
AccountType
Response
- application/json
Default Response
object
-
items:
array Priced Items
Title:
Priced Items
Items with their price calculated.
array
Priced Items
object
-
_bomItemVariableName:
string
Title:
BOM Item Variable Name
Variable Name of the CPQ BOM Item. -
appliedRatePlanIntegrationId:
string
Title:
Rate Plan Integration Id
The integration ID of the applied Pricing Rate Plan. -
appliedRatePlanLabel:
string
Title:
Rate Plan Label
Name of the Pricing Rate Plan applied to item. -
appliedRatePlanNumber:
string
Title:
Rate Plan Number
Unique Variable Name of the Pricing Rate Plan applied to the item. -
availableRatePlans:
array Available Rate Plans
Title:
Available Rate Plans
Available rate plans info from each price model item, in order of execution during the price calculation. -
calculationInfo:
array All Calculation Info
Title:
All Calculation Info
Calculation info from each price model, in order of execution during the price calculation. -
charges:
array All Charges
Title:
All Charges
Charges from all executed price models. -
chargeType:
string
Title:
Charge Type
The element of the product or service which carries a price for the customer. -
itemIdentifier:
string
Title:
Item Identifier
An item's unique identifier. This matches the item's identifier from the request. -
partNumber:
string
Title:
Part Number
Part Number of the CPQ product. -
pricePeriod:
string
Title:
Price Period
The time period, frequency or recurrence with which the price or charge is levied. -
priceType:
string
Title:
Price Type
The basis on which a price or charge is levied, whether one time, on a periodic basis or based on usage. -
unitPrice:
number
Title:
Unit Price
Final calculated unit price of the item.
array
Available Rate Plans
-
Array of:
object availableRatePlan
Title:
availableRatePlan
Instance of an available Rate Plan.
array
All Calculation Info
-
Array of:
object Profile Calculation Info
Title:
Profile Calculation Info
Additional information provided by a single price profile that contributed calculations to the final price.
array
All Charges
-
Array of:
object Charge
Title:
Charge
object
availableRatePlan
-
integrationId:
string
Title:
integrationId
The integration ID of the applicable Pricing Rate Plan. -
label:
string
Title:
label
Name of the Pricing Rate Plan applicable to the item. -
number:
string
Title:
number
Unique Variable Name of the Pricing Rate Plan applicable to the item.
object
Profile Calculation Info
object
Charge
-
calculationInfo:
array All Calculation Info
Title:
All Calculation Info
Calculation info from each price model, in order of execution during the price calculation. -
chargeDefinition:
string
Title:
Charge Definition
The display label of the charge definition. -
chargeDefinitionCode:
string
Title:
Charge Definition Code
The code of the charge definition. -
chargeDefIntegrationId:
string
Title:
Charge Definition Integration ID
The charge definition code in the integrated order management system. -
chargeKey:
string
Title:
Charge Key
The unique identifier for this charge -
chargeType:
string
Title:
Charge Type
The element of the product or service which carries a price for the customer. -
dynamicPricingType:
string
Title:
Dynamic Pricing Type
The type of dynamic pricing used to define this charge: static, tiered, volume, rateCard, advanced. -
globalMarkets_c:
string
Title:
Global Markets
Charge Attribute for Global Markets -
pricePeriod:
string
Title:
Price Period
The time period, frequency or recurrence with which the price or charge is levied. -
priceType:
string
Title:
Price Type
The basis on which a price or charge is levied, whether one time, on a periodic basis or based on usage. -
rateCardName:
string
Title:
Rate Card
Display label for the Rate Card applied in calculating this charge's price. -
rateCardStructure:
string
Title:
Rate Card Structure
The rate card used to calculate this charge's price. -
rateCardVariableName:
string
Title:
Rate Card Variable Name
Variable Name for the Rate Card applied in calculating this charge's price. -
unitPrice:
number
Title:
Unit Price
The unit price to be paid by the customer for this charge. -
usageUOM:
string
Title:
Usage UOM
The unit of measure of usage for usage charges, which generally differs from the unit of measure used for the parent product.
array
All Calculation Info
-
Array of:
object Profile Calculation Info
Title:
Profile Calculation Info
Additional information provided by a single price profile that contributed calculations to the final price.
Examples
The following example shows how to access a pricing information by submitting a POST request to the REST resource using cURL. For more information about cURL, see Use cURL.
curl -X POST -i -H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQg" -H "Accept: application/json" https://sitename.oracle.com/rest/v16/pricing/actions/calculatePrice
Request Body Sample
{ "customerId": "ATT", "currencyCode": "USD", "priceBookVarName": "_default_price_book", "headerAttributeValues": { "oRCL_pRC_priceAsOfDate": "2018-04-23" }, "items": [{ "itemIdentifier": "1", "partNumber": "Consumption Fee", "itemAttributeValues": { "oRCL_pRC_externalParentKey": "Premium Cloud Backup Service", "oRCL_pRC_contractStartDate": "2018-04-23", "oRCL_pRC_quantity": 1990 } } ] }
Response Body Sample
{ "items": [{ "itemIdentifier": "1", "partNumber": "Consumption Fee", "unitPrice": 0.251256, "calculationInfo": [{ "listPrice": 500, "tierList": [{ "TierSequence": 1, "TierFrom": 1, "TierTo": 100, "ListPrice": 0, "PriceFormat": "ORA_PER_UNIT", "BlockSize": 1 }, { "TierSequence": 2, "TierFrom": 101, "TierTo": 1000, "ListPrice": 0.5, "PriceFormat": "ORA_PER_UNIT", "BlockSize": 1, }, { "TierSequence": 3, "TierFrom": 1001, "TierTo": 0, "ListPrice": 1, "PriceFormat": "ORA_PER_BLOCK", "BlockSize": 20, } ], "hasErrors": false } ] } ] }
BOM Item Examples
Request Body Sample
{ "priceBookVarName": "_default_price_book", "customerId": "account112", "headerAttributeValues": { "useChargingStation": true }, "currencyCode": "USD", "items": [{ "partNumber": "Floor Mats", "itemIdentifier": "item1", "itemAttributeValues": { "_quantity": 2 } }, { "partNumber": "Floor Mats2", "itemIdentifier": "item2", "itemAttributeValues": { "_bomItemVariableName": "MFGBOM3", "_quantity": 2 } } ] }
Response Body Sample
{ "items": [{ "itemIdentifier": "item1", "partNumber": "part14", "unitPrice": 200.0000, "calculationInfo": [{ "_priceProfileVar": "additionalProfile", "_priceProfileName": "Additional Profile" } ], "_bomItemVariableName": "" }, { "itemIdentifier": "item2", "partNumber": "part13", "unitPrice": 13.0000, "calculationInfo": [], "_bomItemVariableName": "MFGBOM3" } ] }
Example with Charges
Customers can use this web service to calculate and return both product prices and any charges defined in Pricing Engine.
Response Body Sample
{ "items": [{ "itemIdentifier": "bOMPricingRoot", "unitPrice": 2222.0000, "calculationInfo": [{ "_priceProfileVar": "chargeModel2", "_priceProfileName": "chargeModel2", "_pricingEngineRuleVar": "_defaultPricingRule", "_pricingEngineRuleName": "Default Pricing Rule", "_runningUnitPrice": 2222.00 } ], "_bomItemVariableName": "bOMPricingRoot", "priceType": "oneTime", "pricePeriod": "yearly", "charges": [{ "unitPrice": 10, "priceUOM": "ea", "chargeType": "installationFee", "priceType": "recurring", "pricePeriod": "yearly", "chargeKey": "installationFee_recurring_yearly_ea", "customAttribute1": "", "customAttribute2": "", "customAttribute3": "", "calculationInfo": [{ "_priceProfileVar": "chargeModel2", "_priceProfileName": "chargeModel2", "_pricingEngineRuleVar": "_defaultPricingRule", "_pricingEngineRuleName": "Default Pricing Rule", "_runningUnitPrice": 10.00 } ] } ] }, { "itemIdentifier": "bOMPricingChildPart", "partNumber": "part100", "unitPrice": 111.0000, "calculationInfo": [{ "_priceProfileVar": "chargeModel2", "_priceProfileName": "chargeModel2", "_pricingEngineRuleVar": "_defaultPricingRule", "_pricingEngineRuleName": "Default Pricing Rule", "_runningUnitPrice": 111.00 } ], "_bomItemVariableName": "bOMPricingChildPart", "priceType": "oneTime", "pricePeriod": "yearly", "charges": [{ "unitPrice": 10, "priceUOM": "ea", "chargeType": "installationFee", "priceType": "recurring", "pricePeriod": "yearly", "chargeKey": "installationFee_recurring_yearly_ea", "customAttribute1": "", "customAttribute2": "", "customAttribute3": "", "calculationInfo": [{ "_priceProfileVar": "chargeModel2", "_priceProfileName": "chargeModel2", "_pricingEngineRuleVar": "_defaultPricingRule", "_pricingEngineRuleName": "Default Pricing Rule", "_runningUnitPrice": 10.00 } ] } ] } ] }
Example with Rate Plans
Customers can use this web service to calculate prices with Rate Plans.
Sample Calculate Price Request Body
{ "priceBookVarName": "", "returnAvailableRatePlans": true, "customerId": "", "headerAttributeValues": { "ratePlanTrigger_c": true, "_priceAsOf": "2023-05-27T17:07:51" }, "currencyCode": "USD", "items": [{ "itemIdentifier": "ratePlanPart", "partNumber": "ratePlanPart", "itemAttributeValues": { "_requestedRatePlanNumber": "summerPlan", "_quantity": 1 } } ] }
Sample Calculate Price Response Body
{ "items": [{ "itemIdentifier": "ratePlanPart", "partNumber": "ratePlanPart", "appliedRatePlanIntegrationId": "qp-rm3", "appliedRatePlanNumber": "rm3", "appliedRatePlanLabel": "RatePlan M3", "availableRatePlans": [{ "number": "rm3", "label": "RatePlan M3", "integrationId": "qp-rm3" }, { "number": "rp-1", "label": "RatePlan 1", "integrationId": "qp-summer-plan" }, { "number": "rp-2", "label": "RatePlan 2", "integrationId": "qp-special-plan" } ], "_bomItemVariableName": "", "unitPrice": 0.0000, "calculationInfo": [{ "_priceProfileVar": "m5", "_priceProfileName": "M5", "_pricingEngineRuleVar": "ratePlanRule", "_pricingEngineRuleName": "RatePlanRule", "_runningUnitPrice": 0.0 } ], "charges": [{ "unitPrice": 498.0000, "calculationInfo": [{ "_priceProfileVar": "m3", "_priceProfileName": "M3", "_pricingEngineRuleVar": "ratePlanRule", "_pricingEngineRuleName": "RatePlanRule", "_runningUnitPrice": 500.0 }, { "_priceProfileVar": "m5", "_priceProfileName": "M5", "_pricingEngineRuleVar": "ratePlanRule", "_pricingEngineRuleName": "RatePlanRule", "_runningUnitPrice": 498.0 } ], "chargeKey": "One Time__ORA_SALE", "chargeType": "ORA_SALE", "priceType": "One Time", "rate_c": "22", "boolean_c": false, "dateAtt_c": "2023-02-16T08:00:00Z", "integerAttr_c": 11 }, { "unitPrice": 6.0000, "calculationInfo": [{ "_priceProfileVar": "m3", "_priceProfileName": "M3", "_pricingEngineRuleVar": "ratePlanRule", "_pricingEngineRuleName": "RatePlanRule", "_runningUnitPrice": 10.0 }, { "_priceProfileVar": "m5", "_priceProfileName": "M5", "_pricingEngineRuleVar": "ratePlanRule", "_pricingEngineRuleName": "RatePlanRule", "_runningUnitPrice": 6.0 } ], "chargeKey": "One Time__activationFee", "chargeType": "activationFee", "priceType": "One Time", "rate_c": "22", "boolean_c": true, "dateAtt_c": "2023-02-16T08:00:00Z", "integerAttr_c": 11 }, { "unitPrice": 7.0000, "calculationInfo": [{ "_priceProfileVar": "m3", "_priceProfileName": "M3", "_pricingEngineRuleVar": "ratePlanRule", "_pricingEngineRuleName": "RatePlanRule", "_runningUnitPrice": 10.0 }, { "_priceProfileVar": "m5", "_priceProfileName": "M5", "_pricingEngineRuleVar": "ratePlanRule", "_pricingEngineRuleName": "RatePlanRule", "_runningUnitPrice": 7.0 } ], "chargeKey": "One Time__purchasePrice", "chargeType": "purchasePrice", "priceType": "One Time", "rate_c": "22", "boolean_c": true, "dateAtt_c": "2023-02-16T08:00:00Z", "integerAttr_c": 11 } ] } ] }
Charge Definition Example
Customers can use this web service to calculate prices with Charge Definitions.
Sample Charges with Charge Definitions
{ "primaryCharge": true, "dynamicPricingType": "static", "chargeDefinitionCode": "USAGE_SALES_PRICE_c", "prices": [{ "currencyCode": "USD", "value": 20 }, { "currencyCode": "JPY", "value": 20 }, { "currencyCode": "GBP ", "value": 20 }, { "currencyCode": "EUR", "value": 20 }, { "currencyCode": "ALL", "value": 20 } ] }
Sample Calculate Price Request Body
{ "customerId": "account138", "currencyCode": "USD", "items": [{ "itemIdentifier": "part12", "itemAttributeValues": { "_bomItemVariableName": "ABOSampleChild", "_quantity": 1 } }, { "itemIdentifier": "part2000", "partNumber": "part2000", "itemAttributeValues": { "_quantity": 1 } } ] }
Sample Calculate Price Response Body
{ "items": [{ "itemIdentifier": "part12", "chargeDefIntegrationId": "QP_USAGE_SALE_PRICE", "chargeDefinitionCode": "USAGE_SALES_PRICE_c", "chargeDefinition": "Usage Price", "_bomItemVariableName": "ABOSampleChild", "unitPrice": 20, "calculationInfo": [{ "_priceProfileVar": "testStaticAPModel1", "_priceProfileName": "Test Static AP Model1", "_pricingEngineRuleVar": "alwaysTrueRule1", "_pricingEngineRuleName": "Always True Rule1", "_runningUnitPrice": 20 } ], "priceType": "Usage", "charges": [{ "unitPrice": 3000, "calculationInfo": [{ "_priceProfileVar": "testStaticAPModel1", "_priceProfileName": "Test Static AP Model1", "_pricingEngineRuleVar": "alwaysTrueRule1", "_pricingEngineRuleName": "Always True Rule1", "_runningUnitPrice": 3000 } ], "chargeKey": "discountPrice_c__quantityBased_c", "chargeType": "discountPrice_c", "priceType": "quantityBased_c", "chargeDefinition": "Quantity Based Discount Price", "chargeDefIntegrationId": "QUANTITY_BASED_DISCOUNT_PRICE", "chargeDefinitionCode": "QUANTITY_BASED_DISCOUNT_PRICE_c", "testCustomStringCA1_c": "value1_c" } ] } ] }