Calculate Price

post

/rest/v19/pricing/actions/calculatePrice

This operation calculates the price of items using the CPQ pricing engine.

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 Calculate Price REST API (v16) to compare differences.

Request

Supported Media Types
Body ()
Root Schema : pricing-calculatePriceRequest
Type: object
Show Source
  • Title: Buying Account ID
    Buying account ID. Default 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.
  • Title: Currency Code
    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.
  • Title: Customer ID
    Customer ID. Default to Customer ID (_customer_id) of the commerce transaction if attribute mapping is not defined.
  • Title: Price As Of
    Price as of date. When empty, the current timestamp at the pricing execution is used.
  • Title: Return Enable Waterfall
    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
    Title: Lines
    Input data for items(lines) to be priced.
  • Title: Price Book Variable Name
    Variable name of the CPQ price book. Only applicable for customers who enable CPQ price books.
  • Title: Return Available Price Agreements
    Flag to return the available agreements for the lines for the customer.
  • Title: Return Available Rate Plans
    Flag to return the available rate plans for the lines.
Nested Schema : Lines
Type: array
Title: Lines
Input data for items(lines) to be priced.
Show Source
Nested Schema : items
Type: object
Show Source
  • Title: Bom Item Variable Name
    Variable Name of the BOM item definition for a BOM item. It is empty for a part item.
  • Title: Item Identifier
    An item's unique identifier. This can be any identifier desired by the client.
  • Title: Line Price As Of
    Price as of date for a line. When empty, the header price as of date is used.
  • Title: Part Number
    Part number of a line item.
  • 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.
  • Title: Requested Agreement Number
    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.
  • Title: Requested Rate Plan Number
    Requested Rate Plan Number.
  • Title: Service Duration
    The duration to service a product, measured in the unit of Service Duration Period. Only applicable to a product that fulfills a service contract.
  • Title: Service Duration Period
    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.
Back to Top

Response

Supported Media Types

Default Response

Body ()
Root Schema : pricing
Type: object
Show Source
Nested Schema : Priced Items
Type: array
Title: Priced Items
Items with their price calculated.
Show Source
Nested Schema : itemPrice
Type: object
Show Source
Nested Schema : Available Price Agreements
Type: array
Title: Available Price Agreements
Available price agreements for each item.
Show Source
Nested Schema : Available Rate Plans
Type: array
Title: Available Rate Plans
Available rate plans info from each price model item, in order of execution during the price calculation.
Show Source
Nested Schema : All Charges
Type: array
Title: All Charges
Charges from all executed price models.
Show Source
Nested Schema : availableAgreement
Type: object
Title: availableAgreement
Instance of an available Price Agreement.
Show Source
  • Title: integrationId
    The integration ID of the applicable Price agreement.
  • Title: name
    Name of the Price agreement applicable to the item.
  • Title: number
    Unique Variable Name of the Price agreement applicable to the item.
Nested Schema : availableRatePlan
Type: object
Title: availableRatePlan
Instance of an available Rate Plan.
Show Source
  • Title: integrationId
    The integration ID of the applicable Pricing Rate Plan.
  • Title: label
    Name of the Pricing Rate Plan applicable to the item.
  • Title: number
    Unique Variable Name of the Pricing Rate Plan applicable to the item.
Nested Schema : Charge
Type: object
Title: Charge
Show Source
  • All Calculation Info
    Title: All Calculation Info
    Calculation info from each price model, in order of execution during the price calculation.
  • Title: Charge Definition
    The display label of the charge definition.
  • Title: Charge Definition Code
    The code of the charge definition.
  • Title: Charge Definition Integration ID
    The charge definition code in the integrated order management system.
  • Title: Charge Key
    The unique identifier for this charge
  • Title: Charge Type
    The element of the product or service which carries a price for the customer.
  • Title: Dynamic Pricing Type
    The type of dynamic pricing used to define this charge: static, tiered, volume, rateCard, advanced.
  • Title: Extended List Amount
    The extended price of a line item. This is the line unit price multiplied by the quantity.
  • Title: Price Period
    The time period, frequency or recurrence with which the price or charge is levied.
  • Title: Price Type
    The basis on which a price or charge is levied, whether one time, on a periodic basis or based on usage.
  • Title: Rate Card
    Display label for the Rate Card applied in calculating this charge's price.
  • Title: Rate Card Structure
    The rate card used to calculate this charge's price.
  • Title: Rate Card Variable Name
    Variable Name for the Rate Card applied in calculating this charge's price.
  • Title: Unit Price
    The unit price to be paid by the customer for this charge.
  • 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.
Nested Schema : All Calculation Info
Type: array
Title: All Calculation Info
Calculation info from each price model, in order of execution during the price calculation.
Show Source
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.
Back to Top

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 -H "Authorization: Bearer <token>" -H "Accept: application/json"
https://sitename.oracle.com/rest/v19/pricing/actions/calculatePrice

Request Body Sample

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

Response Body Sample

{
  "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"
        }
      ]
    }
  ]
}
Back to Top