Post Evaluate Cart Promotions

Evaluates and returns the cart promotions applicable on the cart

The Evaluate Promotions API returns the list of promotions applicable to a transaction by evaluating the current cart and customer data.

Headers

Header NameTypeDescription
X-CAP-API-ATTRIBUTION-TILL-CODEstringThis header maps the provided till code to its corresponding till identifier. The API uses this identifier to fetch the correct organizational hierarchy and return only those cart promotions applicable to the transactions at that specific till and its associated store hierarchy.

Request Body

Parameter
(Parameters marked with * are required)
Data TypeDescription
amount*BigDecimalTotal value of the products in the cart.
customerId*LongUnique ID of the customer.
cartItemsObjectObject containing details of the products in the cart
- sku*StringUnique identifier (SKU) for the product.
- amount*BigDecimalPrice of the product.
- qty*BigDecimalTotal quantity of the product
- discountBigDecimalDiscount applied to the item, if any.
- categoryListArrayCategories the product belongs to. For example, ["Fuel", "Premium"].
- brandListArrayBrands associated with the product. For example, ["MaxFuel", "FuelCo"].
cartTendersObjectObject containing details of the payment method used for purchase.
- identifier*StringIdentifier of the payment method used for the purchase.
- amountBigDecimalTotal amount paid using the payment method.
{
    "amount": "2000.00",
    "customerId": 98662653,
    "cartItems": [
        {
            "sku": "Sku#Fuel",
            "amount": "1000.00",
            "qty": "1.000000",
            "discount": null,
            "categoryList": [
                "Fuel",
                "Premium"
            ],
            "brandList": [
                "MaxFuel",
                "FuelCo"
            ]
        },
        {
            "sku": "Sku#food",
            "amount": "1000.00",
            "qty": "1.00",
            "discount": null
        }
    ],
    "promoCodes": null,
    "paymentVouchers": null,
    "cartTenders": [
        {
            "identifier": "CreditCard",
            "amount": "500.00"
        }
    ],
    "categoryHierarchySentInPayload": true
}

Response Body

ParameterDescription
amountTotal value of the products in the cart.
customerIdUnique ID of the customer.
evaluationIdUnique identifier generated for this specific evaluation of the cart.
cartItemsObject containing details of the products in the cart
- referenceIdUnique identifier for the cart item.
- skuUnique identifier (SKU) for the product.
- amountPrice of the product.
- qtyTotal quantity of the product
- discountDiscount applied to the item, if any.
appliedPromotionsObject containing details of cart promotions applied to this cart.
- promotionIdUnique ID of the cart promotion.
- nameUnique name of the cart promotion.
- messageLabelUnique message that is displayed to the end user to describe the promotion.
- promotionModeType of cart promotion. Possible values:
DISCOUNT: Promotion is a standard discount promotion.
PAYMENT_VOUCHER:Promotion includes a payment voucher promotion.
- redemptionCountTotal number of times the cart promotion is redeemed.
- discountTotal discount applied to the cart.
- identifierUnique identifier for the specific instance of the applied promotion. This can be used to track and reference the promotion during redemption.
appliedPaymentVouchersPayment vouchers applied, if any.
cartTendersObject contains details of the payment methods used for the purchase.
- identifierIdentifier of the payment method used for the purchase.
- amountTotal amount paid using the payment method.
- referenceIdUnique ID for the cart tender.
- adjustedAmountTotal amount paid using the payment method.
categoryHierarchySentInPayloadIndicates whether the product category hierarchy was included in the request.
{
    "data": {
        "amount": "2000.000000",
        "customerId": 98662653,
        "cartItems": [
            {
                "referenceId": "f297716f-c3ee-4936-b88e-a5e0ed91d262",
                "sku": "Sku#food",
                "amount": "1000.000000",
                "qty": "1.000000",
                "discount": "0",
                "appliedPromotions": []
            },
            {
                "referenceId": "20f142ec-9a10-49f6-a326-abc48f58d904",
                "sku": "Sku#Fuel",
                "amount": "1000.000000",
                "qty": "1.000000",
                "discount": "0",
                "appliedPromotions": []
            }
        ],
        "evaluationId": "67ea9543e1c34e7d8e936839",
        "appliedPromotions": [
            {
                "promotionId": "67dd2a7cef21a64211227d02",
                "name": "promotion-cart",
                "messageLabel": "test!!",
                "promotionMode": "DISCOUNT",
                "redemptionCount": 1,
                "discount": "100.000000",
                "identifier": "eyJwcm9tb3Rpb25JZCI6IjY3ZGQyYTdjZWYyMWE2NDIxMTIyN2QwMiIsImRpc2NvdW50IjoiMTAwLjAwMDAwMCIsImFtb3VudCI6IjIwMDAuMDAwMDAwIiwicmVkZW1wdGlvbkNvdW50IjoxLCJ2ZXJzaW9uIjoidjEifQ=="
            }
        ],
        "appliedPaymentVouchers": [],
        "promoCodeEvaluationLogs": [],
        "paymentVoucherEvaluationLogs": [],
        "cartTenders": [
            {
                "identifier": "CreditCard",
                "amount": "500.00",
                "referenceId": "67ea9543e1c34e7d8e936831",
                "adjustedAmount": "500.00"
            },
            {
                "identifier": "CASH",
                "amount": "1400.000000",
                "referenceId": "67ea9543e1c34e7d8e936836",
                "adjustedAmount": "1400.000000"
            }
        ],
        "categoryHierarchySentInPayload": false
    }
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!