Calculate Price REST API

Overview

The Calculate Price REST API is used to calculate the unit price for a product within a specific context such as channel, region, or customer. Using this API allows CPQ to serve as the Pricing Engine for third part or other Oracle applications.

Note: Oracle CPQ 24D releases version 17 of Calculate Price REST API which has important differences from version 16. The Calculate Price version 17 REST API simplifies the request and response payloads and streamlines the support for multiple charges.

You should review the difference carefully before uptaking version 17. Refer to Pre-v17 Calculate Price REST API for more information.

  • The 'headerAttributeValues' and 'itemAttributeValues' objects were removed and included their attributes into their respective parent 'pricing-calculatePriceRequest' or 'lines' object.

  • Consolidated product price attributes under charges

  • We renamed the following parameters to align with pricing document attributes:

    • 'items' is now 'lines'

    • 'itemIdentifier' is now '_itemIdentifier'

    • 'currencyCode' is now '_currencyCode'

    • 'customerId' is now '_customerId'

    • 'partNumber' is now '_partNumber'

 

Administration

Calculate Price POST method

Description

The Calculate Price REST API is used to calculate the unit price for a product within a specific context such as channel, region, or customer. Using this API allows CPQ to serve as the Pricing Engine for third part or other Oracle applications.

URI Endpoint

/rest/v17/pricing/actions/calculatePrice

Endpoint Parameters

None

HTTP Method

POST

Request Body Parameters

_buyingAccountId

Buying account ID. Defaults to the customer ID of the current transaction if attribute mapping is not defined. Pricing Engine uses this attribute to locate price agreements for a customer.

_currencyCode

(required) The currency code of the sales transaction. Default to the system currency preference (_system_current_document_currency_pref) of the commerce transaction if attribute mapping is not defined

_customerId

Customer ID. Default to Customer ID (_customer_id) of the commerce transaction if attribute mapping is not defined.", "title": "Customer ID

_priceAsOf

Price as of date. When empty, the current timestamp at the pricing execution is used.

enableWaterfall

When enableWaterfall is true, calculationInfo output from an advanced price model will be stamped with the pricing rule, price model and running unit price.

lines

An array of input data for items to be priced. This object can contain the following items:

_bomItemVariableName

Variable Name of the BOM item definition for a BOM item. It is empty for a part item.

_itemIdentifier

An item's unique identifier. This can be any identifier desired by the client.", "title": "Item Identifier

_linePriceAsOf

Price as of date for a line. When empty, the header price as of date is used.

_partNumber

Part number of a line item.

_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.

_requestedAgreementNumber

The price agreement that will be applied to the line if applicable. Note if the supplied agreement number is not applicable, then a default agreement will be applied.

_requestedRatePlanNumber

Requested Rate Plan Number.

_serviceDuration

The duration to service a product, measured in the unit of Service Duration Period. Only applicable to a product that fulfills a service contract.

_serviceDurationPeriod

The time period unit in which a product is service, e.g., month or year. Only applicable to a product that fulfills a service contract.

priceBookVarName

Variable name of the CPQ price book. Only applicable for customers who enable CPQ price books.

returnAvailableAgreements

Flag to return the available agreements for the lines for the customer.

returnAvailableRatePlans

Flag to return the available rate plans for the lines.

Response Body Parameters The itemPrice array with priced items. This object can contain the following items:

_bomItemVariableName

Variable Name of the CPQ BOM Item.

_itemIdentifier

An item's unique identifier. This matches the item's identifier from the request

_partNumber

Part Number of the CPQ product.

appliedAgreementIntegrationId

The integration ID of the applied Price Agreement.

appliedAgreementName

Name of the Price Agreement applied to item.

appliedAgreementNumber

Unique Variable Name of the Price Agreement applied to the item.

appliedRatePlanIntegrationId

The integration ID of the applied Pricing Rate Plan.

appliedRatePlanLabel

Name of the Pricing Rate Plan applied to item.", "title": "Rate Plan Label

availableAgreements

Available price agreements for each item.

availableRatePlans

Available rate plans info from each price model item, in order of execution during the price calculation.

appliedRatePlanNumber

Unique Variable Name of the Pricing Rate Plan applied to the item.

charges

Charges from all executed price models. This object can contain the following items:

calculationInfo

Calculation info from each price model, in order of execution during the price calculation.

chargeDefinition

The display label of the charge definition.

chargeDefinitionCode

The code of the charge definition.

chargeDefIntegrationId

The charge definition code in the integrated order management system.

chargeKey

The unique identifier for this charge

chargeType

The element of the product or service which carries a price for the customer.

dynamicPricingType

The type of dynamic pricing used to define this charge: static, tiered, volume, rateCard, advanced.

pricePeriod

The time period, frequency or recurrence with which the price or charge is levied.

priceType

The charge definition code in the integrated order management system

rateCardName

Display label for the Rate Card applied in calculating this charge's price.

rateCardStructure

The rate card used to calculate this charge's price.

rateCardVariableName

Variable Name for the Rate Card applied in calculating this charge's price.

unitPrice

The unit price to be paid by the customer for this charge. usage

usageUOM

The unit of measure of usage for usage charges, which generally differs from the unit of measure used for the parent product.

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v17/pricing/actions/calculatePrice


ClosedSample Request Body

{ "_currencyCode": "USD", "priceBookVarName": "_default_price_book", "returnAvailableRatePlans": true, "lines": [{ "_itemIdentifier": "1", "_partNumber": "10KWhBattery", "_quantity": 1 } ], "enableWaterfall": true }


ClosedSample Response Body

{ "lines": [{ "_partNumber": "10KWhBattery", "_itemIdentifier": "1", "_bomItemVariableName": "", "charges": [{ "unitPrice": 899, "calculationInfo": [{ "_priceProfileVar": "_defaultPriceModel", "_priceProfileName": "Base Price Model", "_isAgreement": false, "_pricingEngineRuleVar": "_defaultPricingRule", "_pricingEngineRuleName": "Base Pricing Rule", "_runningUnitPrice": 899 } ], "chargeType": "ORA_SALE", "priceType": "One Time", "dynamicPricingType": "static", "isProductPrice": true, "chargeDefinitionCode": "ONE_TIME_SALES_PRICE", "chargeDefIntegrationId": "QP_SALE_PRICE", "chargeDefinition": "One-time Price" } ] } ] }


 

Related Topics

Related Topics Link IconSee Also