curl --location --request POST 'https://api.stateset.com/v1/pricing-rules/calculate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"customer_segment": "wholesale",
"channel": "b2b",
"items": [
{
"product_id": "prod_electronics_001",
"quantity": 75,
"list_price": 9999,
"category_id": "cat_electronics"
},
{
"product_id": "prod_accessories_001",
"quantity": 10,
"list_price": 1999,
"category_id": "cat_accessories"
}
]
}'
{
"object": "price_calculation",
"items": [
{
"product_id": "prod_electronics_001",
"quantity": 75,
"list_price": 9999,
"final_price": 8499,
"unit_discount": 1500,
"total_discount": 112500,
"subtotal": 637425,
"applied_rules": [
{
"rule_id": "pr_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"rule_name": "B2B Volume Pricing - Electronics",
"type": "volume_based",
"discount_percentage": 15,
"quantity_tier": "50-99"
}
]
},
{
"product_id": "prod_accessories_001",
"quantity": 10,
"list_price": 1999,
"final_price": 1999,
"unit_discount": 0,
"total_discount": 0,
"subtotal": 19990,
"applied_rules": [],
"reason_no_discount": "category_not_eligible"
}
],
"summary": {
"total_list_price": 769915,
"total_discount": 112500,
"total_final_price": 657415,
"discount_percentage": 14.6,
"currency": "USD"
},
"rules_considered": 3,
"rules_applied": 1,
"calculation_timestamp": "2024-06-20T16:30:00Z"
}
Calculate prices with applicable pricing rules
curl --location --request POST 'https://api.stateset.com/v1/pricing-rules/calculate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"customer_segment": "wholesale",
"channel": "b2b",
"items": [
{
"product_id": "prod_electronics_001",
"quantity": 75,
"list_price": 9999,
"category_id": "cat_electronics"
},
{
"product_id": "prod_accessories_001",
"quantity": 10,
"list_price": 1999,
"category_id": "cat_accessories"
}
]
}'
{
"object": "price_calculation",
"items": [
{
"product_id": "prod_electronics_001",
"quantity": 75,
"list_price": 9999,
"final_price": 8499,
"unit_discount": 1500,
"total_discount": 112500,
"subtotal": 637425,
"applied_rules": [
{
"rule_id": "pr_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"rule_name": "B2B Volume Pricing - Electronics",
"type": "volume_based",
"discount_percentage": 15,
"quantity_tier": "50-99"
}
]
},
{
"product_id": "prod_accessories_001",
"quantity": 10,
"list_price": 1999,
"final_price": 1999,
"unit_discount": 0,
"total_discount": 0,
"subtotal": 19990,
"applied_rules": [],
"reason_no_discount": "category_not_eligible"
}
],
"summary": {
"total_list_price": 769915,
"total_discount": 112500,
"total_final_price": 657415,
"discount_percentage": 14.6,
"currency": "USD"
},
"rules_considered": 3,
"rules_applied": 1,
"calculation_timestamp": "2024-06-20T16:30:00Z"
}
pricing:read
permissions.
Authorization: Bearer YOUR_API_KEY
curl --location --request POST 'https://api.stateset.com/v1/pricing-rules/calculate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"customer_segment": "wholesale",
"channel": "b2b",
"items": [
{
"product_id": "prod_electronics_001",
"quantity": 75,
"list_price": 9999,
"category_id": "cat_electronics"
},
{
"product_id": "prod_accessories_001",
"quantity": 10,
"list_price": 1999,
"category_id": "cat_accessories"
}
]
}'
{
"object": "price_calculation",
"items": [
{
"product_id": "prod_electronics_001",
"quantity": 75,
"list_price": 9999,
"final_price": 8499,
"unit_discount": 1500,
"total_discount": 112500,
"subtotal": 637425,
"applied_rules": [
{
"rule_id": "pr_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"rule_name": "B2B Volume Pricing - Electronics",
"type": "volume_based",
"discount_percentage": 15,
"quantity_tier": "50-99"
}
]
},
{
"product_id": "prod_accessories_001",
"quantity": 10,
"list_price": 1999,
"final_price": 1999,
"unit_discount": 0,
"total_discount": 0,
"subtotal": 19990,
"applied_rules": [],
"reason_no_discount": "category_not_eligible"
}
],
"summary": {
"total_list_price": 769915,
"total_discount": 112500,
"total_final_price": 657415,
"discount_percentage": 14.6,
"currency": "USD"
},
"rules_considered": 3,
"rules_applied": 1,
"calculation_timestamp": "2024-06-20T16:30:00Z"
}