Skip to content

Calculate

Calculates discounts for the specified basket.

/PemCalculation-1-0/json/Calculate

Example request:

{
    "Request": {
        "CalculationMoment": "2024-11-07T17:43:19.924Z",
        "LanCode": "nl-NL",
        "Sales": [

        ],
        "SiteId": "9999",
        "PosTypeId" : "VK"
    }
}

See Request Elements.

On request level the following properties exist:

Name Commentary Type Mandatory
SiteId A value indicating the unique ID of the requesting site (shop). This can be either a physical shop, or a webshop. This ID can be used to filter promotions, for example based on geographical conditions. String Yes
PosTypeId Pos type String No
CalculationMoment The local time of the calculation. Map this to the starting point of your basket. It is advised to not use Now() because that may cause sudden disappearance of promotions between requests. DateTime Yes
LanCode ISO lan code for descriptions DateTime Yes

Pre-calculate elements

Certain elements in the basket can be marked with a PreCalculate flag. This flag indicates the element will not be processed as included on the transaction and will thus not trigger rewards. However, the element is included in possible discount calculation and the calculation result will include the discount rewarded for these elements – if they were to be included.

This can be used for pre-calculating the discount a voucher would give – if the customer were to redeem or purchase it. Or the discount amount the customer would receive if a customer card would have been added to the basket.

Please note this pre-calculate result is an indication and not the effective discount result. Because discount calculation is layered rewarding the discount from the discount element may affect/reduce later rewarded discounts. However, it is safe to assume that the net discount value will be positive, so the customer will benefit.

This is currently supported for customer cards and transaction attributes/vouchers.