Calculate Price
post
/rest/v7/pricing/actions/calculatePrice
The Calculate Price REST API allows an external application to query CPQ Cloud for pricing information. CPQ Cloud executes contract rules and relevant profiles to calculate and return the final list price.
Request
Root Schema : pricing-calculatePriceRequest
Type:
Show Source
object-
currencyCode:
string
Title:
Currency CodeCurrency code for the currency. -
customerId(optional):
string
Title:
Customer IDCustomer ID of the customer (account). -
headerAttributeValues(optional):
object Header Attribute Values
Title:
Header Attribute ValuesValues of pricing attributes at the header level. -
items(optional):
array Items
Title:
ItemsInput data for items to be priced. -
priceBookVarName(optional):
string
Title:
Price Book Variable NameVariable name of the CPQ price book.
Nested Schema : Header Attribute Values
Type:
objectTitle:
Header Attribute ValuesValues of pricing attributes at the header level.
Show Source
Nested Schema : items
Type:
Show Source
object-
itemAttributeValues(optional):
object Item Attribute Values
Title:
Item Attribute ValuesValues of pricing attributes at the item level for a specific item. -
itemIdentifier:
string
Title:
Item IdentifierAn item's unique identifier. This can be any identifier desired by the client. -
partNumber:
string
Title:
Part NumberPart Number of the CPQ product.
Nested Schema : Item Attribute Values
Type:
objectTitle:
Item Attribute ValuesValues of pricing attributes at the item level for a specific item.
Show Source
Response
Default Response
Root Schema : pricing
Type:
Show Source
object-
items(optional):
array Priced Items
Title:
Priced ItemsItems with their price calculated.
Nested Schema : Priced Items
Type:
arrayTitle:
Priced ItemsItems with their price calculated.
Show Source
Nested Schema : itemPrice
Type:
Show Source
object-
calculationInfo(optional):
array All Calculation Info
Title:
All Calculation InfoCalculation info from each price profile, in order of execution during the price calculation. -
itemIdentifier(optional):
string
Title:
Item IdentifierAn item's unique identifier. This matches the item's identifier from the request. -
partNumber(optional):
string
Title:
Part NumberPart Number of the CPQ product. -
unitPrice(optional):
number
Title:
Unit PriceFinal calculated unit price of the item.
Nested Schema : All Calculation Info
Type:
arrayTitle:
All Calculation InfoCalculation info from each price profile, in order of execution during the price calculation.
Show Source
-
Array of:
object Profile Calculation Info
Title:
Profile Calculation InfoAdditional information provided by a single price profile that contributed calculations to the final price.
Nested Schema : Profile Calculation Info
Type:
objectTitle:
Profile Calculation InfoAdditional 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/v7/pricing/actions/calculatePrice
Request Body Sample
{
"currencyCode": "USD",
"priceBookVarName": "_default_price_book",
"customerId": "accountX",
"headerAttributeValues": {
"myPricingType": "recurring",
...
},
"items": [{
"itemIdentifier": "2",
"partNumber": "part1",
"itemAttributeValues": {
"myUsage": 15.2,
...
}
}, {
"itemIdentifier": "3",
"partNumber": "part1",
"itemAttributeValues": {
"myUsage": 80,
...
}
}, {
"itemIdentifier": "4",
"partNumber": "part2"
}
]
}
Response Body Sample
{
"items": [{
"itemIdentifier": "2",
"partNumber": "part1",
"unitPrice": 2.34,
"calculationInfo": [{
...
}, ...]
}, {
"itemIdentifier": "3",
"partNumber": "part1",
"unitPrice": 5.67,
"calculationInfo": [{
...
}, ...]
}, {
"itemIdentifier": "4",
"partNumber": "part2",
"unitPrice": 80.00,
"calculationInfo": [{
...
}, ...]
}
]
}