Calculate Price
POST /v2/price/calculate
Calculates prices for one or more products based on the specified account and applicable price rules. The pricing engine evaluates all active rules that match the account, products, and current date, then applies discounts or markups according to the rule configuration. Returns the calculated prices for each product including original prices, applied discounts, and final prices.
Request Body
{
"account": "685498954146b339e63e71b1",
"products": [
{
"id": "68b18763d5fcff509086501d",
"quantity": 1
},
{
"id": "68b18763d5fcff5090865023",
"quantity": 1
}
]
}
Response Example
{
"products": [
{
"id": "product-id-1",
"quantity": 1,
"originalPrice": 1000,
"discount": 100,
"finalPrice": 900,
"appliedRules": [
{
"ruleId": "rule-id-1",
"ruleName": "Customer Discount",
"type": "discount",
"percentage": 10
}
]
},
{
"id": "product-id-2",
"quantity": 1,
"originalPrice": 500,
"discount": 0,
"finalPrice": 500,
"appliedRules": []
}
],
"total": {
"originalPrice": 1500,
"totalDiscount": 100,
"finalPrice": 1400
}
}