Price Calculation and Messaging for Products
Method Description
The service calculates product prices for a specific customer and returns a list of messages to display.
The method is invoked with a POST request. Operation name is set up via Maestra framework.
{
"productList": {
"calculationDateTimeUtc": "<Discount calculation date & time (UTC +0)>",
"area": {
"ids": {
"externalId": "<Area external ID>"
}
},
"items": [
{
"basePricePerItem": "<Product base price per unit>",
"minPricePerItem": "<Minimum price per unit of product>",
"product": {
"ids": {
"website": "<Product ID in website>"
}
},
"requestedPromotions": [
{
"type": "<discount>",
"amount": "<Discount size>",
"promotion": {
"ids": {
"externalId": "<Promotion external ID>"
}
},
"coupon": {
"ids": {
"code": "<Promo code ID>"
},
"pool": {
"ids": {
"promoCodePoolId": "<Promo code pool ID>",
"externalId": "<Promo code pool external ID>"
}
}
}
},
{
"type": "<discount>",
"amount": "<Discount size>",
"promotion": {
"ids": {
"externalId": "<Promotion external ID>"
}
},
"coupon": {
"ids": {
"code": "<Promo code ID>"
},
"pool": {
"ids": {
"promoCodePoolId": "<Promo code pool ID>",
"externalId": "<Promo code pool external ID>"
}
}
}
}
]
},
{
"basePricePerItem": "<Product base price per unit>",
"minPricePerItem": "<Minimum price per unit of product>",
"product": {
"ids": {
"website": "<Product ID in website>"
}
},
"requestedPromotions": [
{
"type": "<discount>",
"amount": "<Discount size>",
"promotion": {
"ids": {
"externalId": "<Promotion external ID>"
}
},
"coupon": {
"ids": {
"code": "<Promo code ID>"
},
"pool": {
"ids": {
"promoCodePoolId": "<Promo code pool ID>",
"externalId": "<Promo code pool external ID>"
}
}
}
},
{
"type": "<discount>",
"amount": "<Discount size>",
"promotion": {
"ids": {
"externalId": "<Promotion external ID>"
}
},
"coupon": {
"ids": {
"code": "<Promo code ID>"
},
"pool": {
"ids": {
"promoCodePoolId": "<Promo code pool ID>",
"externalId": "<Promo code pool external ID>"
}
}
}
}
]
}
]
},
"customer": {
"ids": {
"customerId": "<Maestra customer ID>"
}
}
}
Response
{
"status": "<Request execution response: Success on successful execution, ValidationError on user error, ProtocolError on integration error, InternalServerError on server unavailability.>",
"productList": {
"items": [
{
"basePricePerItem": "<Product base price per unit>",
"minPricePerItem": "<Minimum price per unit of product>",
"priceForCustomer": "<Item price for current customer>",
"product": {
"ids": {
"website": "<продукта ID in website>"
}
},
"appliedPromotions": [
{
"type": "<Applied promotion type>",
"amount": "<Value of the applied promotion>",
"promotion": {
"name": "<Promotion name>",
"type": "<Promotion type>",
"ids": {
"externalId": "<Promotion external ID>"
}
}
}
],
"placeholders": [
{
"ids": {
"externalId": "<Text display area ID>"
},
"content": [
{
"type": "<text>",
"message": "<Message displayed by receipt item line>",
"promotion": {
"name": "<Promotion name>",
"type": "<Promotion type>",
"ids": {
"externalId": "<Promotion external ID>"
}
}
},
{
"type": "<possibleDiscounts>",
"promotion": {
"name": "<Promotion name>",
"type": "<Promotion type>",
"ids": {
"externalId": "<Promotion external ID>"
}
},
"possibleDiscounts": {
"discountsCount": "<Number of items to which discount applies>",
"discount": {
"amount": "<Discount size>",
"amountType": "<Discount type - Percentage/Absolute>"
},
"products": [
{
"ids": {
"retailOrderId": "<Maestra id>",
"website": "<product category ID in website>"
}
},
{
"ids": {
"retailOrderId": "<Maestra id>",
"website": "<product category ID in website>"
}
}
]
}
}
]
},
{
"ids": {
"externalId": "<Text display area ID>"
},
"content": [
{
"type": "<text>",
"message": "<Message displayed by receipt item line>",
"promotion": {
"name": "<Promotion name>",
"type": "<Promotion type>",
"ids": {
"externalId": "<Promotion external ID>"
}
}
},
{
"type": "<possibleDiscounts>",
"promotion": {
"name": "<Promotion name>",
"type": "<Promotion type>",
"ids": {
"externalId": "<Promotion external ID>"
}
},
"possibleDiscounts": {
"discountsCount": "<Number of items to which discount applies>",
"discount": {
"amount": "<Discount size>",
"amountType": "<Discount type - Percentage/Absolute>"
},
"products": [
{
"ids": {
"retailOrderId": "<Maestra id>",
"website": "<product category ID in website>"
}
},
{
"ids": {
"retailOrderId": "<Maestra id>",
"website": "<product category ID in website>"
}
}
]
}
}
]
}
]
}
]
}
}
Updated 20 days ago