Calculate Price

post

/rest/v16/pricing/actions/calculatePrice

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

Request

Supported Media Types
Body ()
Root Schema : pricing-calculatePriceRequest
Type: object
Show Source
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: array
Title: Items
Input data for items to be priced.
Show Source
Nested Schema : items
Type: object
Show Source
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
  • Title: Bom Item Variable Name
    Variable Name of the BOM item definition for a BOM item. It is empty for a part 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 Rate Plan Number
    Requested Rate Plan Number.
  • Title: AccountType
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 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 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 : All Charges
Type: array
Title: All Charges
Charges from all executed price models.
Show Source
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 : Profile Calculation Info
Type: object
Title: Profile Calculation Info
Additional information provided by a single price profile that contributed calculations to the final price.
Nested Schema : Charge
Type: object
Title: Charge
Show Source
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
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 -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"
        }
      ]
    }
  ]
}
Back to Top