Promotions model
All promotions include the following fields (header data):
Promotions common header data
| Property | Description |
|---|---|
startDate |
Start date |
endDate |
End date of the promotion |
promotionERPId |
Promotion identifier in the ERP. Number |
rateCode |
The identifier of the base rate. Default GENERAL |
onlyLoyalty |
Only apply loyal customers. Logical |
exclusive |
Exclusive promotion. Logical |
discountType |
How to apply the discount: (0) Discount percentage // less margin (1) Discount amount // less income (2) Discount for future purchase (coupon issue) // Descuento future en forma de cupón |
onlyAccessByCouponCode |
Coupon code to access the promotion. Used for NON-nominative promotions where a promoted code is distributed and gives access to a certain promotion. |
stores-store |
List of store identifiers where the promotion applies. If not indicated, in all stores |
headerConditionsRules |
Rules to check if the ticket is a candidate to apply this discount. JSON or XML BASE64 encoded structure of Promotions rules model. |
futureDiscountCoupon |
Optional, in the event that the discount type is 2, the following information must be included for the generation of the coupon with the discount achieved. |
applyPromotionDes |
Promotion associated with the new coupon that will be generated. Text |
applyPromotionId |
Identifier in comerzzia of the promotion associated with the coupon that will be generated. Whole |
couponCode |
Code associated with the coupon. Do not complete for comerzzia to generate a random code. Codes must be unique. Text (128) |
couponDescription |
Description of the coupon. Text (255) |
couponImageUrl |
URL of an image associated with the coupon. It must start with https. Text (255) |
couponTitle |
Title of the coupon. Text (50) |
couponTypeCode |
Code of the comerzzia method for the generation of coupon codes. Use DEFAULT. |
couponTypeName |
Name of the comerzzia method for generating coupon codes. Use DEFAULT. |
customerMaxUses |
Number of uses a customer can make. Whole |


Promotions types
Price
Optional reduction of the rate price.
| Property | Description |
|---|---|
promotionItems – promotionItem |
List of promotional items |
itemCode |
Item Code |
salesPrice |
Promotion price without taxes |
salesPriceWithTaxes |
Promotion price with taxes |
combinationCode1 |
The identifier of variation 1 associated with the price. If not indicated, applies to all variations. |
combinationCode2 |
The identifier of variation 2 associated with the price. If not indicated, applies to all variations. |
promotionText |
Promotional text |
startDate |
Option to reduce the duration, within the period of validity of the promotion, for the article |
endDate |
|
points |
Number of loyalty points generated by the loyal customer if they make the purchase of the item |


<PromotionsDTO>
<documentId>Prueba-01</documentId>
<promotionsTypePrice>
<promotionTypePrice>
<promotionERPId>10001</promotionERPId>
<rateCode>GENERAL</rateCode>
<description>Descripción promoción de precio</description>
<startDate>2022-01-01T00:00:00.000+02:00</startDate>
<endDate>2023-12-31T00:00:00.000+02:00</endDate>
<onlyLoyalty>false</onlyLoyalty>
<exclusive>false</exclusive>
<discountType>1</discountType>
<onlyAccessByCouponCode>PROMOCIÓN-BIENVENIDA</onlyAccessByCouponCode>
<promotionItems>
<promotionTypePriceItem>
<itemCode>100001</itemCode>
<combination1Code>*</combination1Code>
<combination2Code>*</combination2Code>
<promotionText>Texto promoción</promotionText>
<salesPrice>1</salesPrice>
<salesPriceWithTaxes>1.21</salesPriceWithTaxes>
<points>100</points>
</promotionTypePriceItem>
</promotionItems>
</promotionTypePrice>
</promotionsTypePrice>
</PromotionsDTO>
NxM
Discount percentage applied to the cheapest unit of N products purchased.
| Property | Description |
|---|---|
groupId |
Article grouping ID for NxM. Integer |
comboUnits |
Number of units to carry. Integer |
comboUnitsToPay |
Number of units to be paid. M. Integer |
applyDiscount |
Discount percentage or Discount amount. Decimal |
groupDes |
Description of item grouping |
applyDiscountTypeId |
Group promotion type [1|2] (1) Discount percentage, (2) Discount amount |
promotionText |
Promotion title |
promotionImageURL |
URL including http/s of the descriptive image. Recommended for use https. Text (255) |
promotionItems – promotionItem |
Within the group, list of articles |
itemCode |
Item Code |
combinationCode1 |
The identifier of variation 1 associated with the price. If not indicated, applies to all variations. |
combinationCode2 |
The identifier of variation 2 associated with the price. If not indicated, applies to all variations. |
promotionText |
Promotional text |
startDate |
Option to reduce the duration, within the period of validity of the promotion, for the article |
endDate |

<PromotionsDTO>
<documentId>123456789</documentId>
<nxmPromotions>
<promotionERPId>2</promotionERPId>
<rateCode>GENERAL</rateCode>
<description>Descripcion 2 NxM APP</description>
<startDate>2021-05-17T00:00:00+02:00</startDate>
<endDate>2021-05-25T00:00:00+02:00</endDate>
<onlyLoyalty>false</onlyLoyalty>
<exclusive>false</exclusive>
<discountType>0</discountType>
<itemsGroups>
<groupId>10019</groupId>
<groupDes>Abrillantadores</groupDes>
<comboUnits>3</comboUnits>
<comboUnitsToPay>2</comboUnitsToPay>
<discountTypeId>1</discountTypeId>
< applyDiscount>5.0</ applyDiscount>
<promotionText>texto promocion Agru</promotionText>
<promotionImageURL>http://www.aapp.com</promotionImageURL>
<items>
<itemCode>900329</itemCode>
<combinationCode1>*</combinationCode1>
<combinationCode2>*</combinationCode2>
<promotionText>texto promocion item</promotionText>
</items>
</itemsGroups>
</nxmPromotions>
</PromotionsDTO>
Discount
Reduction of a percentage applied to the rate price of a set of items.
| Property | Description |
|---|---|
promotionItems - promotionItem |
List of discount promotions |
itemCode |
Item Code |
salesPrice |
Promotion price without taxes. Decimal |
salesPriceWithTaxes |
Promotion price with taxes. Decimal |
Discount |
Applied discount. Decimal |
combinationCode1 |
The identifier of variation 1 associated with the price. If not indicated, applies to all variations. |
combinationCode2 |
The identifier of variation 2 associated with the price. If not indicated, applies to all variations. |
promotionText |
Promotional text |
startDate |
Option to reduce the duration, within the period of validity of the promotion, for the article |
endDate |
|
applyDiscountTypeId |
Group promotion type [1|2] (1) Discount percentage, (2) Discount amount |
promotionImageURL |
URL including http/s of the descriptive image. Recommended for use https. Text (255) |

<PromotionsDTO>
<documentId>-Prueba-02</documentId>
<promotionsTypeDiscount>
<!--Zero or more repetitions:-->
<promotionTypeDiscount>
<promotionERPId>$\{Data Source#promotionERPId}</promotionERPId>
<rateCode>GENERAL</rateCode>
<description>$\{Data Source#description}</description>
<startDate>2022-01-01T00:00:00.000+02:00</startDate>
<endDate>2023-12-31T00:00:00.000+02:00</endDate>
<onlyLoyalty>false</onlyLoyalty>
<exclusive>false</exclusive>
<discountType>0</discountType>
<stores>
<store>0000</store>
<store>T31</store>
<store>T84</store>
</stores>
<headerConditionsRules>...</headerConditionsRules>
<promotionItems>
<!--1 or more repetitions:-->
<promotionTypeDiscountItem>
<itemCode>$\{Data Source#itemCode}</itemCode>
<combination1Code>$\{Data Source#combination1Code}</combination1Code>
<combination2Code>$\{Data Source#combination2Code}</combination2Code>
<promotionText>$\{Data Source#promotionText}</promotionText>
<startDate>2022-01-01T00:00:00.000+02:00</startDate>
<endDate>2023-12-31T00:00:00.000+02:00</endDate>
<salesPrice>1.00</salesPrice>
<salesPriceWithTaxes>1.21</salesPriceWithTaxes>
<applyDiscountTypeId>1</applyDiscountTypeId>
<discount>$\{Data Source#discount}</discount>
<promotionImageURL>$\{Data Source#promotionImageURL}</promotionImageURL>
</promotionTypeDiscountItem>
</promotionItems>
</promotionTypeDiscount>
</promotionsTypeDiscount>
</PromotionsDTO>
Combined line discount
Application of a discount percentage, discount amount or promotional price to the set of lines of a sales document that meet the application condition specified in the promotion.
| Property | Description |
|---|---|
applyDiscount |
Discount to apply. Decimal |
itemsConditionsRules |
Conditions that the ticket items must meet to access the promotion. JSON or XML BASE64 encoded of Promotions rules model. |
itemsApplyRules |
Apply rules for sales items (JSON or XML BASE64 encoded). |
applyDiscountTypeId |
Type of line promotion [1|2|3] (1) Percentage discount, (2) Discount amount, (3) Price |
applyQuantityLimit |
Maximum number of times the combo can be applied to each purchase. Integer |
promotionText |
Promotion title. Text (255) |
promotionImageURL |
URL including http/s of the descriptive image. Recommended for use https. Text (255). Text (255) |

<PromotionsDTO>
<documentId>PROMOTIONS_CENTRAL_20221231010101</documentId>
<promotionsTypeComboLine>
<promotionTypeComboLine>
<promotionERPId>ERP-DCL01</promotionERPId>
<rateCode>GENERAL</rateCode>
<description>Descuento combinado de línea</description>
<startDate>2022-10-01T00:00:00.000+02:00</startDate>
<endDate>2023-10-30T00:00:00.000+02:00</endDate>
<onlyLoyalty>true</onlyLoyalty>
<exclusive>false</exclusive>
<discountType>2</discountType>
<headerConditionsRules>
ewogICJjb25kaXRpb24iOiAiQU5EIiwKICAicnVsZXMiOiBbCiAgICB7CiAgICAgICJpZCI6ICJJTVBPUlRFLVRPVEFMIiwKICAgICAgImZpZWxkIjogIklNUE9SVEUtVE9UQUwiLAogICAgICAidHlwZSI6ICJpbnRlZ2VyIiwKICAgICAgImlucHV0IjogInRleHQiLAogICAgICAib3BlcmF0b3IiOiAiZ3JlYXRlciIsCiAgICAgICJ2YWx1ZSI6ICIxMDAiCiAgICB9CiAgXQp9</headerConditionsRules>
<itemsConditionsRules>
ewogICJjb25kaXRpb24iOiAiT1IiLAogICJydWxlcyI6IFsKICAgIHsKICAgICAgImlkIjogIlNFQ0NJT04iLAogICAgICAiZmllbGQiOiAiU0VDQ0lPTiIsCiAgICAgICJ0eXBlIjogImF5dWRhIiwKICAgICAgImlucHV0IjogInRleHQiLAogICAgICAib3BlcmF0b3IiOiAiZXF1YWwiLAogICAgICAidmFsdWUiOiAiMDIiLAogICAgICAiZGVzIjogIkJFQklEQVMiCiAgICB9LAogICAgewogICAgICAiaWQiOiAiRkFNSUxJQVMiLAogICAgICAiZmllbGQiOiAiRkFNSUxJQVMiLAogICAgICAidHlwZSI6ICJheXVkYSIsCiAgICAgICJpbnB1dCI6ICJ0ZXh0IiwKICAgICAgIm9wZXJhdG9yIjogImVxdWFsIiwKICAgICAgInZhbHVlIjogIjAxMDciLAogICAgICAiZGVzIjogIkFMSU1FTlRBQ0lPTiBJTkZBTlRJTCIKICAgIH0KICBdCn0=</itemsConditionsRules>
<applyDiscountTypeId>3</applyDiscountTypeId>
<applyDiscount>10.5</applyDiscount>
<applyQuantityLimit>1</applyQuantityLimit>
<promotionText>Texto para el cliente</promotionText>
</promotionTypeComboLine>
</promotionsTypeComboLine>
</PromotionsDTO>
Coupon generation
Issuance of the coupon associated with the promotion, in sales that meet the requirements specified in the conditions of issuance of the coupon.
In this type of promotion always, the discount rate is set to value 2 – Future discount in the form of a coupon and it is mandatory to fill in the future coupon generation information: futureDiscountCoupon.
| Property | Description |
|---|---|
futureDiscountCoupon |
Optional, in the event that the discount type is 2, the following information must be included for the generation of the coupon with the discount achieved. |
applyPromotionDes |
Promotion associated with the new coupon that will be generated. Text |
applyPromotionId |
Identifier in comerzzia of the promotion associated with the coupon that will be generated. Whole |
couponCode |
Code associated with the coupon. Do not complete for comerzzia to generate a random code. Codes must be unique. Text (128) |
couponDescription |
Description of the coupon. Text (255) |
couponImageUrl |
URL of an image associated with the coupon. It must start with https. Text (255) |
couponTitle |
Title of the coupon. Text (50) |
couponTypeCode |
Code of the comerzzia method for the generation of coupon codes. Use DEFAULT. |
couponTypeName |
Name of the comerzzia method for generating coupon codes. Use DEFAULT. |
customerMaxUses |
Number of uses a customer can make. Integer |
aleatoryPrintIndexRange |
Random number to implement a type of coupon that is generated to the customer randomly. Default integer 0 |
permitManualPrint |
Allow manual printing. False default logical |
itemsConditionsRules |
Conditions that must be met by the items of the ticket to access the promotion. JSON or XML BASE64 encoded of the RULES structure. |

Combined header discount
Application of an amount or percentage of discount to the total to the sales document that meets the entry conditions of the promotion.
| Property | Description |
|---|---|
itemsConditionsRules |
Conditions that the ticket items must meet to access the promotion. JSON or XML BASE64 encoded of the RULES structure. |
itemsApplyRules |
Rules that define the items that enter the total calculation to calculate the discount defined in rangesApplyRules. JSON or XML BASE64 encoded of the Promotions rules model. |
rangesApplyRules |
Rules to define the discount to be applied according to the total calculated in itemsApplyRules or failing that, in the ticket. JSON or XML BASE64 encoded of the Promotions rules model. |
applyDiscountTypeId |
Type of line promotion [1|2|3] (1) Percentage discount, (2) Discount amount, (3) Price |
promotionText |
Promotion title. Text (255) |
promotionImageURL |
URL (includes http/s, recommended to use https) of descriptive image. Text (255) |

Points
Accumulation of points associated with the loyalty account for making purchases that meet the criteria established in the conditions of the promotion. Requires LOYALTY module.
| Property | Description |
|---|---|
amountForPoint |
Amount needed to earn one point. Decimal |
itemsConditionsRules |
Conditions that the ticket items must meet to access the promotion. JSON or XML BASE64 encoded of the RULES structure. |
promotionText |
Promotion title. Text (255) |
promotionImageURL |
URL including http/s of the descriptive image. Recommended for use https. Text (255). Text (255) |

Combined discount NxM
Application of a discount percentage to the cheapest unit of N products to the sales document that meets the entry conditions of the promotion.
| Property | Description |
|---|---|
comboUnits |
Number of units to carry. Integer |
comboUnitsToPay |
Number of units to be paid. Integer |
applyDiscount |
Discount percentage or Discount amount. Decimal |
itemsConditionsRules |
Conditions that the ticket items must meet to access the promotion. JSON or XML BASE64 encoded of the RULES structure. |
applyDiscountTypeId |
Type of line promotion [1|2|3] (1) Percentage discount, (2) Discount amount, (3) Price |
promotionText |
Promotion title. Text (255) |
promotionImageURL |
URL (includes http/s) of descriptive image. Text (255) |


Packs
Allows you to set rules that define a pack of items and set a fixed sales amount on it. The discount generated falls proportionately on the different items that make up the pack.
| Property | Description |
|---|---|
packPrice |
Price of the pack. Decimal |
itemsConditionsRules |
Conditions that the ticket items must meet to access the promotion. JSON or XML BASE64 encoded of the RULES structure. |
itemsApplyRules |
Rules that define the items that enter the total calculation to calculate the discount defined in rangesApplyRules. JSON or XML BASE64 encoded of the Promotions rules model. |
applyQuantityLimit |
Maximum number of times the pack can be applied to each purchase. Integer |
promotionText |
Promotion title. Text (255) |
promotionImageURL |
URL including http/s of the descriptive image. Recommended for use https. Text (255) |


Scaled
Application of a final price, amount or percentage discount to the items configured according to the volume of purchases, that is, the number of units sold, that meet the entry conditions of the promotion.
| Property | Description |
|---|---|
itemsGroups - group |
List of groups of items with rappelling discount |
groupId |
Article grouping ID for NxM. Integer |
groupDes |
Description of item grouping |
applyDiscountTypeId |
Group promotion type [1|2] (1) Discount percentage, (2) Discount amount |
promotionText |
Promotion title |
promotionImageURL |
URL including http/s of the descriptive image. Recommended for use https. Text (255) |
promotionItems – promotionItem |
Within the group, list of items |
itemCode |
Item Code |
combinationCode1 |
The identifier of variation 1 associated with the price. If not indicated, applies to all variations. |
combinationCode2 |
The identifier of variation 2 associated with the price. If not indicated, applies to all variations. |
promotionText |
Promotional text |
startDate |
Option to reduce the duration, within the period of validity of the promotion, for the article |
endDate |


<PromotionsDTO>
<documentId>Prueba-03</documentId>
<promotionsTypeRappel> <!--Zero or more repetitions:-->
<promotionTypeRappel>
<promotionERPId>PR0001</promotionERPId>
<rateCode>GENERAL</rateCode>
<description>DESCRIPCIÓN</description>
<startDate>2022-01-01T00:00:00.000+02:00</startDate>
<endDate>2023-12-31T00:00:00.000+02:00</endDate>
<onlyLoyalty>false</onlyLoyalty>
<exclusive>false</exclusive>
<discountType>0</discountType>
<stores> <!--Zero or more repetitions:-->
<store>0001</store>
<store>0002</store>
<store>0003</store>
</stores>
<futureDiscountCoupon>
<applyPromotionId>1001</applyPromotionId>
<couponDescription>Cupón generado</couponDescription>
<couponImageUrl>https://www.comerzzia.com/imagen.jpg</couponImageUrl>
<couponTitle>REGALO</couponTitle>
<couponTypeCode>DEFAULT</couponTypeCode>
<customerMaxUses>1</customerMaxUses>
</futureDiscountCoupon>
<headerConditionsRules>...</headerConditionsRules>
<itemsGroups> <!--1 or more repetitions:-->
<promotionTypeRappelGroup>
<groupId>1</groupId>
<groupDes>Productos 1</groupDes>
<applyDiscountTypeId>1</applyDiscountTypeId>
<promotionText>Descuento en productos 1</promotionText>
<promotionItems> <!--1 or more repetitions:-->
<promotionItem>
<itemCode>1002</itemCode>
<combination1Code>*</combination1Code>
<combination2Code>*</combination2Code>
</promotionItem>
<promotionItem>
<itemCode>10001</itemCode>
<combination1Code>*</combination1Code>
<combination2Code>*</combination2Code>
</promotionItem>
</promotionItems>
<ranges> <!--1 or more repetitions:-->
<promotionTypeRappelRange>
<quantityFrom>10</quantityFrom>
<quantityTo>100</quantityTo>
<applyDiscountValue>10.5</applyDiscountValue>
</promotionTypeRappelRange>
</ranges>
</promotionTypeRappelGroup>
</itemsGroups>
</promotionTypeRappel>
</promotionsTypeRappel>
</PromotionsDTO>
Text
It allows the visualization and printing of texts at the point of sale when the sales document meets the entry conditions of the promotion.
| Property | Description |
|---|---|
itemsConditionsRules |
Conditions that must be met by the items of the ticket to access the promotion. JSON or XML BASE64 encoded of the RULES structure. |
showToOperator |
Flag to indicate whether the text will be displayed to the checkout operator. Logical |
promotionText |
Text to display on the ticket. Text (255) |
promotionImageURL |
URL including http/s of the descriptive image. Recommended for use https. Text (255) |

Coupon discount application
Allows you to establish the conditions of use associated with a coupon of specific amount existing in the system. In order to benefit from the coupon, the established conditions must be validated. The value of the benefit for the loyalty is stated in the coupon (not in this promotion).
| Property | Description |
|---|---|
packPrice |
Price of the pack. Decimal |
itemsConditionsRules |
Conditions that must be met by the items of the ticket in order to apply the benefit of the coupon. JSON or XML BASE64 encoded of the Promotions rules model. |
itemsApplyRules |
Rules that define the items that enter the discount calculation defined on the coupon. JSON or XML BASE64 encoded of the Promotions rules model. |
promotionText |
Promotion title. Text (255) |
promotionImageURL |
URL including http/s of the descriptive image. Recommended for use https. Text (255) |

