put https://{host}/api_gateway/v1/promotions/
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
Field | Type | Required | Description |
---|---|---|---|
name | string | Yes | Indicates the name for the cart promotion. You can use the expired or disabled promotion names in cart promotions. |
orgId | long | Yes | Indicates the unique identifier of the organization. |
priority | int | Optional | Indicates the priority of the promotion within a campaign. Higher value means higher priority. Default is 0. |
active | boolean | Optional | Indicates whether the promotion is currently active. Possible values: true, false. |
messageLabel | string | Optional | Indicates the unique message that is displayed to the end user to describe the promotion. |
type | enum | Yes | Indicates the type of promotion. Possible values: EARNING, POS, CUSTOMER, or CODE. |
startDate | long | Yes | Indicates the start date of the promotion, in milliseconds since epoch (UTC). |
endDate | long | Yes | Indicates the end date of the promotion, in milliseconds since epoch (UTC). |
campaignId | long | Optional | Indicates the identifier of the associated campaign. |
createdBy | long | Optional | Indicates the unique identifier of the user who created the promotion. |
createdOn | long | Optional | Indicates the creation date and time of the promotion, in Epoch time format. |
lastUpdatedBy | long | Optional | Indicates the unique identifier of the user who last updated the promotion. |
lastUpdatedOn | long | Optional | Indicates the last update date and time of the promotion, in Epoch time format. |
customerActivationRequired | boolean | Optional | Indicates if the promotion must be manually activated by the customer before it can be applied. |
isLoyaltyOnly | boolean | Optional | Indicates if only loyalty program members can avail the promotion. |
mode | enum | Optional | Indicates the type of benefit provided. Possible values: DISCOUNT, PAYMENT_VOUCHER. |
maxIssuancePerCustomer | int | Optional | Defines the maximum number of times a customer can use the cart promotion. Set to -1 for no limit. |
isStackable | boolean | Optional | Indicates if the promotion is stackable. Stackable promotions can be combined within a single transaction. |
expiryDateChangeJobList | array | Optional | Indicates the list of scheduled jobs to update the expiry date of the promotion. |
customFieldValues | object | Optional | Indicates custom key-value pairs related to the promotion. |
condition.cartCondition.kpi | enum | Optional | Defines the KPI used to evaluate qualifying conditions for the promotion. Example: SUBTOTAL, QUANTITY, ITEMCOUNT, AMOUNT. |
condition.cartCondition.operator | enum | Optional | Defines the operator for the cart condition. Supported operators: EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL. |
condition.cartCondition.value | decimal | Optional | Defines the value to compare against for the cart condition. |
condition.productCondition.kpi | enum | Optional | Defines the KPI for the product condition. Possible values: AMOUNT, QUANTITY, NONE. |
condition.productCondition.operator | enum | Optional | Defines the operator for the product condition. |
condition.productCondition.value | decimal | Optional | Defines the value to compare against for the product condition. |
condition.productCondition.criteriaList | array | Optional | Indicates the list of criteria for filtering products (by SKU, category, brand, etc.). |
condition.comboProductCondition.productConditions | array | Optional | Indicates the array of product conditions for combo promotions. |
condition.comboProductCondition.productConditions[].criteriaList | array | Optional | Indicates the criteria for each product in the combo. |
condition.comboProductCondition.productConditions[].kpi | enum | Optional | Defines the KPI for each product in the combo. |
condition.comboProductCondition.productConditions[].operator | enum | Optional | Defines the operator for each product in the combo. |
condition.comboProductCondition.productConditions[].value | decimal | Optional | Defines the value for each product in the combo. |
condition.tenderCondition.type | enum | Optional | Indicates the type of payment mode. Example: CARD, CASH, PAYMENT_VOUCHER. |
condition.tenderCondition.identifier | string | Optional | Indicates the identifier for the payment mode (e.g., card network or bank code). |
action.cartBasedAction.type | enum | Optional | Indicates the type of discount applied to the cart. Possible values: ABSOLUTE, PERCENTAGE. |
action.cartBasedAction.value | decimal | Optional | Defines the value of the discount (fixed amount or percentage). |
action.productBasedAction.type | enum | Optional | Indicates the type of discount applied to products. Possible values: ABSOLUTE, PERCENTAGE. |
action.productBasedAction.value | decimal | Optional | Defines the value of the discount for products. |
action.productBasedAction.includeItemsFromConditionSet | boolean | Optional | Indicates if the discount applies to the items that triggered the condition. |
action.productBasedAction.productBasedCondition.type | enum | Optional | Indicates the type of product-based condition. Possible values: PRODUCT, CART, COMBO_PRODUCT. |
action.productBasedAction.productBasedCondition.productCondition | object | Optional | Indicates the product condition for the product-based action. |
action.productBasedAction.productBasedCondition.cartCondition | object | Optional | Indicates the cart condition for the product-based action. |
action.productBasedAction.productBasedCondition.comboProductCondition | object | Optional | Indicates the combo product condition for the product-based action. |
action.tenderBasedAction.type | enum | Optional | Indicates the type of discount for tender-based action. |
action.tenderBasedAction.value | decimal | Optional | Defines the value of the discount for tender-based action. |
loyaltyEarningExpiryDays | int | Optional | Defines the number of days until earned points expire. |
maxEarningPerCustomer | int | Optional | Defines the maximum points that can be issued per customer. |
earningCriteria | object | Optional | Indicates the criteria for earning loyalty points. |
promotionRestrictions | object | Optional | Indicates the promotion limits configuration. |
earnLimitedToSpecificAudience | boolean | Optional | Indicates if earning is restricted to a specific audience. |
timeCriteria | object | Optional | Indicates the time-based criteria for the promotion (days, hours, holidays). |
storeCriteria | object | Optional | Indicates the store-based criteria for the promotion. |
supplementaryCriteria | object | Optional | Indicates supplementary program criteria for the promotion. |
redeemableFromCriteria | object | Optional | Indicates the criteria for when the promotion can be redeemed. |
ownershipCriteria | object | Optional | Indicates the ownership configuration for the promotion. |
onEarnCommunicationChannels | object | Optional | Indicates the communication channels for notifications when promotion is earned. |
languagesConfigured | array | Optional | Indicates the list of languages configured for the promotion. |
fixedPriceAction.value | decimal | Optional | Defines the fixed price to charge for items in a fixed price promotion. |
freeProductAction.productCriteria | object | Optional | Indicates the criteria for selecting free products in a promotion. |
freeProductAction.quantity | decimal | Optional | Defines the quantity of free products to be given. |
perUnitAction.type | enum | Optional | Indicates the type of per-unit discount. Possible values: PERCENTAGE, ABSOLUTE. |
perUnitAction.value | decimal | Optional | Defines the value of the per-unit discount. |
perUnitAction.unitType | enum | Optional | Indicates 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
Field | Type | Description |
---|---|---|
id | string | Indicates the unique identifier for the promotion. |
name | string | Indicates the name for the cart promotion. Max 50 characters. |
orgId | long | Indicates the unique identifier of the organization. |
priority | int | Indicates the priority of the promotion within a campaign. Higher value means higher priority. |
active | boolean | Indicates whether the promotion is currently active. |
messageLabel | string | Indicates the unique message that is displayed to the end user to describe the promotion. |
type | enum | Indicates the type of promotion. |
condition | object | Indicates the qualifying conditions for the promotion. |
condition.type | enum | Indicates the entity on which the condition is to be evaluated. |
condition.cartCondition.kpi | string | Indicates the KPI used to evaluate qualifying conditions for the cart. |
condition.cartCondition.operator | enum | Indicates the operator for the cart condition. |
condition.cartCondition.value | string | Indicates the value to compare against for the cart condition. |
action | object | Indicates the reward or discount action of the promotion. |
action.type | enum | Indicates the type of action. |
action.cartBasedAction.type | enum | Indicates the type of discount applied to the cart. |
action.cartBasedAction.value | decimal | Indicates the value of the discount . |
createdBy | long | Indicates the unique identifier of the user who created the promotion. |
createdOn | long | Indicates the creation date and time of the promotion, in Epoch time format. |
lastUpdatedBy | long | Indicates the unique identifier of the user who last updated the promotion. |
lastUpdatedOn | long | Indicates the last update date and time of the promotion, in Epoch time format. |
startDate | long | Indicates the start date of the promotion, in milliseconds since epoch (UTC). |
endDate | long | Indicates the end date of the promotion, in milliseconds since epoch (UTC). |
campaignId | long | Indicates the identifier of the associated campaign. |
promotionRestrictions | object | Indicates the promotion limits configuration. |
earnLimitedToSpecificAudience | boolean | Indicates if earning is restricted to a specific audience. |
mode | enum | Indicates the type of benefit provided. |
maxIssuancePerCustomer | int | Defines the maximum number of times a customer can use the cart promotion. |
isStackable | boolean | Indicates if the promotion is stackable. |
Error codes
Code | Description |
---|---|
400 | Invalid request. Check required parameters. |
400 | Enum value is invalid. Check type , kpi , operator fields for valid values. |
401 | Unauthorized. Check your authentication credentials. |
500 | Internal server error. Retry the request after a short delay. |