Update Cart Promotion

This endpoint allows you to update a cart promotion.

Example request

curl --location --globoff --request PUT 'https://eu.intouch.capillarytech.com/api_gateway/v1/promotions/{promotionid}' \
--header 'Content-Type: application/json' \
--header 'X-CAP-API-AUTH-ORG-ID: 100232' \
--header 'user-agent: pyapps_auto_Promotion_Engine_Eucrm_Smoke' \
--header 'Authorization: Basic bmFtYW5fZG9jOmEzYjRjYjgyMzA3MWJmYjM5OGM5ZmM2YjZlY2I2MmEy' \
--data '{
    "name": "Gold_star",
    "orgId": 100027,
    "priority": 0,
    "active": true,
    "messageLabel": "test!!",
    "type": "CODE",
    "condition": {
      "type": "CART",
      "cartCondition": {
        "kpi": "SUBTOTAL",
        "operator": "EQUALS",
        "value": 250.0
      }
    },
    "action": {
      "type": "CART_BASED",
      "cartBasedAction": {
        "type": "ABSOLUTE",
        "value": 25.0
      }
    },
    "createdBy": 70707,
    "createdOn": 0,
    "lastUpdatedBy": 70707,
    "startDate": "1757388651000",
    "endDate": "1757475051000",
    "campaignId": 39077,
    "mode": "DISCOUNT",
    "promotionRestrictions": {
      "Code": [
        {
          "kpi": "REDEMPTION",
          "limit": 1
        }
      ]
    },
    "isStackable": false
  }'

Pre requisites

  • Authentication: Basic or OAuth authentication.
  • Default access group

Rate limit

  • Demo and Testing Clusters: 1,000 requests per minute per API key
  • Other Organizations: The rate limit is brand-specific.

To modify the limit, create a ticket with the Capillary Product support team.

Body parameters

FieldTypeRequiredDescription
namestringYesIndicates the name for the cart promotion. You can use the expired or disabled promotion names in cart promotions.
orgIdlongYesIndicates the unique identifier of the organization.
priorityintOptionalIndicates the priority of the promotion within a campaign. Higher value means higher priority. Default is 0.
activebooleanOptionalIndicates whether the promotion is currently active. Possible values: true, false.
messageLabelstringOptionalIndicates the unique message that is displayed to the end user to describe the promotion.
typeenumYesIndicates the type of promotion. Possible values: EARNING, POS, CUSTOMER, or CODE.
startDatelongYesIndicates the start date of the promotion, in milliseconds since epoch (UTC).
endDatelongYesIndicates the end date of the promotion, in milliseconds since epoch (UTC).
campaignIdlongOptionalIndicates the identifier of the associated campaign.
createdBylongOptionalIndicates the unique identifier of the user who created the promotion.
createdOnlongOptionalIndicates the creation date and time of the promotion, in Epoch time format.
lastUpdatedBylongOptionalIndicates the unique identifier of the user who last updated the promotion.
lastUpdatedOnlongOptionalIndicates the last update date and time of the promotion, in Epoch time format.
customerActivationRequiredbooleanOptionalIndicates if the promotion must be manually activated by the customer before it can be applied.
isLoyaltyOnlybooleanOptionalIndicates if only loyalty program members can avail the promotion.
modeenumOptionalIndicates the type of benefit provided. Possible values: DISCOUNT, PAYMENT_VOUCHER.
maxIssuancePerCustomerintOptionalDefines the maximum number of times a customer can use the cart promotion. Set to -1 for no limit.
isStackablebooleanOptionalIndicates if the promotion is stackable. Stackable promotions can be combined within a single transaction.
expiryDateChangeJobListarrayOptionalIndicates the list of scheduled jobs to update the expiry date of the promotion.
customFieldValuesobjectOptionalIndicates custom key-value pairs related to the promotion.
condition.cartCondition.kpienumOptionalDefines the KPI used to evaluate qualifying conditions for the promotion. Example: SUBTOTAL, QUANTITY, ITEMCOUNT, AMOUNT.
condition.cartCondition.operatorenumOptionalDefines the operator for the cart condition. Supported operators: EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL.
condition.cartCondition.valuedecimalOptionalDefines the value to compare against for the cart condition.
condition.productCondition.kpienumOptionalDefines the KPI for the product condition. Possible values: AMOUNT, QUANTITY, NONE.
condition.productCondition.operatorenumOptionalDefines the operator for the product condition.
condition.productCondition.valuedecimalOptionalDefines the value to compare against for the product condition.
condition.productCondition.criteriaListarrayOptionalIndicates the list of criteria for filtering products (by SKU, category, brand, etc.).
condition.comboProductCondition.productConditionsarrayOptionalIndicates the array of product conditions for combo promotions.
condition.comboProductCondition.productConditions[].criteriaListarrayOptionalIndicates the criteria for each product in the combo.
condition.comboProductCondition.productConditions[].kpienumOptionalDefines the KPI for each product in the combo.
condition.comboProductCondition.productConditions[].operatorenumOptionalDefines the operator for each product in the combo.
condition.comboProductCondition.productConditions[].valuedecimalOptionalDefines the value for each product in the combo.
condition.tenderCondition.typeenumOptionalIndicates the type of payment mode. Example: CARD, CASH, PAYMENT_VOUCHER.
condition.tenderCondition.identifierstringOptionalIndicates the identifier for the payment mode (e.g., card network or bank code).
action.cartBasedAction.typeenumOptionalIndicates the type of discount applied to the cart. Possible values: ABSOLUTE, PERCENTAGE.
action.cartBasedAction.valuedecimalOptionalDefines the value of the discount (fixed amount or percentage).
action.productBasedAction.typeenumOptionalIndicates the type of discount applied to products. Possible values: ABSOLUTE, PERCENTAGE.
action.productBasedAction.valuedecimalOptionalDefines the value of the discount for products.
action.productBasedAction.includeItemsFromConditionSetbooleanOptionalIndicates if the discount applies to the items that triggered the condition.
action.productBasedAction.productBasedCondition.typeenumOptionalIndicates the type of product-based condition. Possible values: PRODUCT, CART, COMBO_PRODUCT.
action.productBasedAction.productBasedCondition.productConditionobjectOptionalIndicates the product condition for the product-based action.
action.productBasedAction.productBasedCondition.cartConditionobjectOptionalIndicates the cart condition for the product-based action.
action.productBasedAction.productBasedCondition.comboProductConditionobjectOptionalIndicates the combo product condition for the product-based action.
action.tenderBasedAction.typeenumOptionalIndicates the type of discount for tender-based action.
action.tenderBasedAction.valuedecimalOptionalDefines the value of the discount for tender-based action.
loyaltyEarningExpiryDaysintOptionalDefines the number of days until earned points expire.
maxEarningPerCustomerintOptionalDefines the maximum points that can be issued per customer.
earningCriteriaobjectOptionalIndicates the criteria for earning loyalty points.
promotionRestrictionsobjectOptionalIndicates the promotion limits configuration.
earnLimitedToSpecificAudiencebooleanOptionalIndicates if earning is restricted to a specific audience.
timeCriteriaobjectOptionalIndicates the time-based criteria for the promotion (days, hours, holidays).
storeCriteriaobjectOptionalIndicates the store-based criteria for the promotion.
supplementaryCriteriaobjectOptionalIndicates supplementary program criteria for the promotion.
redeemableFromCriteriaobjectOptionalIndicates the criteria for when the promotion can be redeemed.
ownershipCriteriaobjectOptionalIndicates the ownership configuration for the promotion.
onEarnCommunicationChannelsobjectOptionalIndicates the communication channels for notifications when promotion is earned.
languagesConfiguredarrayOptionalIndicates the list of languages configured for the promotion.
fixedPriceAction.valuedecimalOptionalDefines the fixed price to charge for items in a fixed price promotion.
freeProductAction.productCriteriaobjectOptionalIndicates the criteria for selecting free products in a promotion.
freeProductAction.quantitydecimalOptionalDefines the quantity of free products to be given.
perUnitAction.typeenumOptionalIndicates the type of per-unit discount. Possible values: PERCENTAGE, ABSOLUTE.
perUnitAction.valuedecimalOptionalDefines the value of the per-unit discount.
perUnitAction.unitTypeenumOptionalIndicates the unit type for per-unit discount (e.g., EACH, LITER, GALLON).

Example response

{
    "data": {
        "id": "68c01c8aaa0d7a770cbaec76",
        "name": "CODd_Promotion_Test_17573886",
        "orgId": 100737,
        "priority": 0,
        "active": true,
        "messageLabel": "test!!",
        "type": "CODE",
        "condition": {
            "type": "CART",
            "cartCondition": {
                "kpi": "SUBTOTAL",
                "operator": "EQUALS",
                "value": "250.000000"
            }
        },
        "action": {
            "type": "CART_BASED",
            "cartBasedAction": {
                "type": "ABSOLUTE",
                "value": "25.000000"
            }
        },
        "createdBy": 75152721,
        "createdOn": 1757420682387,
        "lastUpdatedBy": 75152721,
        "lastUpdatedOn": 1757420682387,
        "startDate": 1757388651000,
        "endDate": 1757475051000,
        "campaignId": 39077,
        "promotionRestrictions": {
            "Code": [
                {
                    "kpi": "REDEMPTION",
                    "limit": "1.000000"
                }
            ]
        },
        "earnLimitedToSpecificAudience": false,
        "mode": "DISCOUNT",
        "maxIssuancePerCustomer": 1,
        "isStackable": false
    }
}

Response parameters

FieldTypeDescription
idstringIndicates the unique identifier for the promotion.
namestringIndicates the name for the cart promotion. Max 50 characters.
orgIdlongIndicates the unique identifier of the organization.
priorityintIndicates the priority of the promotion within a campaign. Higher value means higher priority.
activebooleanIndicates whether the promotion is currently active.
messageLabelstringIndicates the unique message that is displayed to the end user to describe the promotion.
typeenumIndicates the type of promotion.
conditionobjectIndicates the qualifying conditions for the promotion.
condition.typeenumIndicates the entity on which the condition is to be evaluated.
condition.cartCondition.kpistringIndicates the KPI used to evaluate qualifying conditions for the cart.
condition.cartCondition.operatorenumIndicates the operator for the cart condition.
condition.cartCondition.valuestringIndicates the value to compare against for the cart condition.
actionobjectIndicates the reward or discount action of the promotion.
action.typeenumIndicates the type of action.
action.cartBasedAction.typeenumIndicates the type of discount applied to the cart.
action.cartBasedAction.valuedecimalIndicates the value of the discount .
createdBylongIndicates the unique identifier of the user who created the promotion.
createdOnlongIndicates the creation date and time of the promotion, in Epoch time format.
lastUpdatedBylongIndicates the unique identifier of the user who last updated the promotion.
lastUpdatedOnlongIndicates the last update date and time of the promotion, in Epoch time format.
startDatelongIndicates the start date of the promotion, in milliseconds since epoch (UTC).
endDatelongIndicates the end date of the promotion, in milliseconds since epoch (UTC).
campaignIdlongIndicates the identifier of the associated campaign.
promotionRestrictionsobjectIndicates the promotion limits configuration.
earnLimitedToSpecificAudiencebooleanIndicates if earning is restricted to a specific audience.
modeenumIndicates the type of benefit provided.
maxIssuancePerCustomerintDefines the maximum number of times a customer can use the cart promotion.
isStackablebooleanIndicates if the promotion is stackable.

Error codes

CodeDescription
400Invalid request. Check required parameters.
400Enum value is invalid. Check type, kpi, operator fields for valid values.
401Unauthorized. Check your authentication credentials.
500Internal server error. Retry the request after a short delay.
Language
URL
Click Try It! to start a request and see the response here!