Promotion Calculation

Service Url: POST /promotions/calculate

Request Body:

IPromotionCalculationRequest:

items – List<IPromotionCalculationRequestItem> – a list of items to be requested.

Response Body:

IPromotionCalculationResponse:

promotionCalculation – IPromotionCalculation – the result of the promotion calculation.

Remarks:

The service calcuates the amount of savings and the total amount of points for the given request.

Example Request:

POST: http://localhost:8080/WebRestApi/rest/promotions/calculate
Content-Type: application/json

{
  "creationDate" : {
    "calendar" : 1521129992000
  },
  "honourDate" : { },
  "currency" : {
    "id" : "GBP"
  },
  "employeeSale" : false,
  "employeeStartingBalance" : 0,
  "fascia" : {
    "id" : ""
  },
  "items" : [ {
    "promotionCalculationRequestProductItem" : {
      "product" : {
        "id" : "DF517XM-1"
      },
      "parentProduct" : {
        "id" : "DF517XM"
      },
      "mmGroup" : {
        "groupHierarchyId" : "FASHION",
        "groupTypeId" : "mmGroup",
        "id" : "MENS_SHIRTS",
        "variantGroupHierarchyId" : "All",
        "variantGroupId" : "UK",
        "variantGroupTypeId" : "region"
      },
      "brand" : {
        "groupHierarchyId" : "FASHION",
        "groupTypeId" : "brand",
        "id" : "INTERNAL",
        "variantGroupHierarchyId" : "All",
        "variantGroupId" : "UK",
        "variantGroupTypeId" : "region"
      },
      "priceType" : {
        "id" : "R"
      },
      "loyaltyPoints" : 0,
      "lineNumber" : 1,
      "quantity" : 1.0,
      "unitValue" : 2595,
      "lineNetValue" : 2595,
      "isReturn" : false,
      "honourPromotionItem" : false,
      "manuallyTargetedPromotionId" : [ ],
      "offerPrice" : 0
    }
  } ],
  "itemQuantity" : 1.0,
  "merchandiseItemQuantity" : 1.0,
  "merchandiseItemValue" : 2595,
  "enableReturns" : false,
  "location" : {
    "id" : "0001"
  },
  "loyaltyPointsBalance" : 0,
  "loyaltyPointsTotal" : 0,
  "loyaltyPointsRate" : 0,
  "loyaltyTransaction" : false,
  "priceGroup" : {
    "@entity" : "core:groupKey",
    "groupHierarchyId" : "ALL",
    "groupTypeId" : "priceGroup",
    "id" : "UK",
    "variantGroupHierarchyId" : "All",
    "variantGroupId" : "All",
    "variantGroupTypeId" : "region"
  },
  "region" : {
    "groupHierarchyId" : "All",
    "groupTypeId" : "region",
    "id" : "UK"
  },
  "total" : 2595,
  "ignoreCrossTransactionLimits" : false
}

Example Response

{
    "promotionCalculation": {
        "totalSaving": 2595,
        "totalPoints": 0,
        "itemsArray": [
            {
                "promotionSavingItem": {
                    "saving": 2595,
                    "savingAdjustment": 0,
                    "distributedSavings": [
                        {
                            "distributedPromotionSavingItem": {
                                "lineNumber": 1,
                                "distributedSaving": 2595,
                                "promotionKey": {
                                    "promotionId": "1",
                                    "groupKey": {
                                        "id": "All",
                                        "groupTypeId": "region",
                                        "groupHierarchyId": "All"
                                    }
                                },
                                "modifierType": "PROMOTION",
                                "effectiveValue": -2595
                            }
                        }
                    ],
                    "adjustEmployeeBalance": false,
                    "promotionDescription": "£10000, 10% off",
                    "promotionQuantity": 1,
                    "operationWithDiscounts": "APPLIES_AFTER_ON_GROSS",
                    "promotionKey": {
                        "promotionId": "1",
                        "groupKey": {
                            "id": "All",
                            "groupTypeId": "region",
                            "groupHierarchyId": "All"
                        }
                    },
                    "triggers": [
                        {
                            "rewardValue": 259500000,
                            "lineRewardValue": 2595,
                            "distributeSaving": true,
                            "lineNumber": 1,
                            "quantity": 1,
                            "unitValue": 2595,
                            "triggerCount": 1
                        }
                    ]
                }
            }
        ]
    }
}
Go to Top