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 Code
Currency code for the currency. -
customerId(optional):
string
Title:
Customer ID
Customer ID of the customer (account). -
headerAttributeValues(optional):
object Header Attribute Values
Title:
Header Attribute Values
Values of pricing attributes at the header level. -
items(optional):
array Items
Title:
Items
Input data for items to be priced. -
priceBookVarName(optional):
string
Title:
Price Book Variable Name
Variable name of the CPQ price book.
Nested Schema : Header Attribute Values
Type:
object
Title:
Header Attribute Values
Values 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 Values
Values of pricing attributes at the item level for a specific item. -
itemIdentifier:
string
Title:
Item Identifier
An item's unique identifier. This can be any identifier desired by the client. -
partNumber:
string
Title:
Part Number
Part Number of the CPQ product.
Nested Schema : Item Attribute Values
Type:
object
Title:
Item Attribute Values
Values 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 Items
Items with their price calculated.
Nested Schema : Priced Items
Type:
array
Title:
Priced Items
Items with their price calculated.
Show Source
Nested Schema : itemPrice
Type:
Show Source
object
-
calculationInfo(optional):
array All Calculation Info
Title:
All Calculation Info
Calculation info from each price profile, in order of execution during the price calculation. -
itemIdentifier(optional):
string
Title:
Item Identifier
An item's unique identifier. This matches the item's identifier from the request. -
partNumber(optional):
string
Title:
Part Number
Part Number of the CPQ product. -
unitPrice(optional):
number
Title:
Unit Price
Final calculated unit price of the item.
Nested Schema : All Calculation Info
Type:
array
Title:
All Calculation Info
Calculation info from each price profile, in order of execution during the price calculation.
Show Source
-
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.
Nested Schema : Profile Calculation Info
Type:
object
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/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": [{ ... }, ...] } ] }