[{"data":1,"prerenderedAt":498},["ShallowReactive",2],{"bootstrap":3,"blog-rules-engine-flex-promotion-examples":277},{"navigation":4,"globalConfig":196,"forms":218},{"headerSections":5,"headerFooterLinks":67,"footer":76,"legalLinks":153,"socialLinks":176},[6,39,44,50,57,62],{"hasSubMenu":7,"title":8,"links":9,"columns":38},true,"Product",[10,20,26,32],{"showTag":11,"_modelApiKey":12,"text":13,"subtitle":14,"icon":15,"isExternal":11,"link":16,"openForm":11},false,"navigation_link","Universal checkout","Sell anywhere","globe-simple",{"_modelApiKey":17,"slug":18,"title":19},"page","universal-checkout","Universal Checkout",{"showTag":11,"_modelApiKey":12,"text":21,"subtitle":22,"icon":23,"isExternal":11,"link":24,"openForm":11},"Distributed OMS","Manage orders","package",{"_modelApiKey":17,"slug":25,"title":21},"distributed-oms",{"showTag":11,"_modelApiKey":12,"text":27,"subtitle":28,"icon":29,"isExternal":11,"link":30,"openForm":11},"Promotion engine","Automated discounts","seal-percent",{"_modelApiKey":17,"slug":31,"title":27},"promotion-engine",{"showTag":11,"_modelApiKey":12,"text":33,"subtitle":34,"icon":35,"isExternal":11,"link":36,"openForm":11},"POS system","Operate stores","devices",{"_modelApiKey":17,"slug":37,"title":33},"pos-system",2,{"hasSubMenu":11,"showTag":11,"_modelApiKey":12,"text":40,"isExternal":11,"link":41,"openForm":11,"title":40},"Pricing",{"_modelApiKey":42,"slug":43},"pricing_page","pricing",{"hasSubMenu":11,"showTag":11,"_modelApiKey":12,"text":45,"isExternal":11,"link":46,"openForm":11,"title":45},"Customers",{"_modelApiKey":47,"slug":48,"title":49},"customer_landing_page","customers","Customers page",{"hasSubMenu":11,"showTag":11,"_modelApiKey":12,"text":51,"isExternal":11,"link":52,"openForm":11,"form":54,"title":51},"Partners",{"_modelApiKey":17,"slug":53,"title":51},"partners",{"_modelApiKey":55,"slug":53,"name":56},"form","PartnersForm",{"hasSubMenu":11,"showTag":11,"_modelApiKey":12,"text":58,"label":59,"isExternal":7,"url":60,"openForm":11,"title":61},"Docs Hub","Learn more","https:\u002F\u002Fdocs.commercelayer.io\u002F","Docs",{"hasSubMenu":11,"showTag":11,"_modelApiKey":12,"text":63,"isExternal":11,"link":64,"openForm":11,"title":63},"Blog",{"_modelApiKey":65,"slug":66},"blog_landing_page","blog",[68,72],{"text":69,"link":70},"Sign in",{"_modelApiKey":12,"text":69,"isExternal":7,"url":71,"openForm":11},"https:\u002F\u002Fdashboard.commercelayer.io\u002Fsign_in",{"text":73,"link":74},"Sign up for free",{"_modelApiKey":12,"text":73,"isExternal":7,"url":75,"openForm":11},"https:\u002F\u002Fdashboard.commercelayer.io\u002Fsign_up",[77,89,109,132],{"hasSubMenu":7,"title":8,"links":78},[79,81,83,85,87],{"showTag":11,"_modelApiKey":12,"text":13,"subtitle":14,"icon":15,"isExternal":11,"link":80,"openForm":11},{"_modelApiKey":17,"slug":18,"title":19},{"showTag":11,"_modelApiKey":12,"text":21,"subtitle":22,"icon":23,"isExternal":11,"link":82,"openForm":11},{"_modelApiKey":17,"slug":25,"title":21},{"showTag":11,"_modelApiKey":12,"text":27,"subtitle":28,"icon":29,"isExternal":11,"link":84,"openForm":11},{"_modelApiKey":17,"slug":31,"title":27},{"showTag":11,"_modelApiKey":12,"text":33,"subtitle":34,"icon":35,"isExternal":11,"link":86,"openForm":11},{"_modelApiKey":17,"slug":37,"title":33},{"showTag":11,"_modelApiKey":12,"text":40,"isExternal":11,"link":88,"openForm":11},{"_modelApiKey":42,"slug":43},{"hasSubMenu":7,"title":90,"links":91},"Resources",[92,94,99,104,107],{"showTag":11,"_modelApiKey":12,"text":93,"isExternal":7,"url":60,"openForm":11},"Documentation",{"showTag":11,"_modelApiKey":12,"text":95,"label":95,"isExternal":11,"link":96,"openForm":11},"Agentic Commerce",{"_modelApiKey":17,"slug":97,"title":98},"agentic-commerce-whitepaper","Agentic Commerce Whitepaper",{"showTag":11,"_modelApiKey":12,"text":100,"isExternal":11,"link":101,"openForm":11},"Core concepts",{"_modelApiKey":17,"slug":102,"title":103},"headless-commerce","Headless commerce",{"showTag":11,"_modelApiKey":12,"text":105,"isExternal":7,"url":106,"openForm":11},"Changelog","https:\u002F\u002Fdocs.commercelayer.io\u002Fchangelog\u002F",{"showTag":11,"_modelApiKey":12,"text":63,"isExternal":11,"link":108,"openForm":11},{"_modelApiKey":65,"slug":66},{"hasSubMenu":7,"title":110,"links":111},"Company",[112,116,118,121,126],{"showTag":11,"_modelApiKey":12,"text":113,"isExternal":11,"link":114,"openForm":11},"Vision",{"_modelApiKey":17,"slug":115,"title":113},"vision",{"showTag":11,"_modelApiKey":12,"text":45,"isExternal":11,"link":117,"openForm":11},{"_modelApiKey":47,"slug":48,"title":49},{"showTag":11,"_modelApiKey":12,"text":51,"isExternal":11,"link":119,"openForm":11,"form":120},{"_modelApiKey":17,"slug":53,"title":51},{"_modelApiKey":55,"slug":53,"name":56},{"showTag":11,"_modelApiKey":12,"text":122,"isExternal":11,"link":123,"openForm":11},"Security",{"_modelApiKey":17,"slug":124,"title":125},"security","Security at Commerce Layer",{"showTag":11,"_modelApiKey":12,"text":127,"label":128,"isExternal":11,"openForm":7,"form":129},"Giveback","Giveback program",{"_modelApiKey":55,"slug":130,"name":131},"giveback","GivebackForm",{"hasSubMenu":7,"title":133,"links":134},"Get in touch",[135,140,145,149],{"showTag":11,"_modelApiKey":12,"text":136,"isExternal":11,"openForm":7,"form":137},"Contact",{"_modelApiKey":55,"slug":138,"name":139},"contact","ContactUsForm",{"showTag":11,"_modelApiKey":12,"text":141,"isExternal":11,"openForm":7,"form":142},"Book a demo",{"_modelApiKey":55,"slug":143,"name":144},"demo","RequestDemoForm",{"showTag":11,"_modelApiKey":12,"text":146,"label":147,"isExternal":7,"url":148,"openForm":11},"Support","Email support","mailto:support@commercelayer.io",{"showTag":11,"_modelApiKey":12,"text":150,"label":151,"isExternal":7,"url":152,"openForm":11},"Community","Discord community","https:\u002F\u002Fdiscord.gg\u002Fcommercelayer",{"hasSubMenu":7,"title":154,"links":155},"Legal",[156,161,165,169,173],{"showTag":11,"_modelApiKey":12,"text":157,"label":158,"isExternal":7,"url":159,"openForm":11,"htmlClassNames":160},"Terms","Terms and conditions","\u002Flegal-embed\u002Fterms-of-service","iubenda-nostyle no-brand iubenda-noiframe iubenda-embed",{"showTag":11,"_modelApiKey":12,"text":162,"label":163,"isExternal":7,"url":164,"openForm":11,"htmlClassNames":160},"Privacy","Privacy policy","\u002Flegal-embed\u002Fprivacy-policy",{"showTag":11,"_modelApiKey":12,"text":166,"label":167,"isExternal":7,"url":168,"openForm":11,"htmlClassNames":160},"Cookies","Cookie policy","\u002Flegal-embed\u002Fcookie-policy",{"showTag":11,"_modelApiKey":12,"text":170,"isExternal":7,"url":171,"openForm":11,"htmlClassNames":172},"Notice at collection","#","iubenda-cs-uspr-link",{"showTag":11,"_modelApiKey":12,"text":174,"isExternal":7,"url":171,"openForm":11,"htmlClassNames":175},"Privacy preferences","iubenda-cs-preferences-link",[177,180,184,188,192],{"title":178,"type":179,"url":152,"isExternal":7},"Discord","discord-logo",{"title":181,"type":182,"url":183,"isExternal":7},"Github","github","https:\u002F\u002Fgithub.com\u002Fcommercelayer",{"title":185,"type":186,"url":187,"isExternal":7},"Bluesky","bluesky-logo","https:\u002F\u002Fbsky.app\u002Fprofile\u002Fcommercelayer.io",{"title":189,"type":190,"url":191,"isExternal":7},"X","x-logo","https:\u002F\u002Fx.com\u002Fcommercelayer",{"title":193,"type":194,"url":195,"isExternal":7},"LinkedIn","linkedin","https:\u002F\u002Fwww.linkedin.com\u002Fcompany\u002Fcommerce-layer",{"pagesWithoutCtaPanel":197,"ctaPanel":198,"notification":208,"showApiResponseTime":11,"newsletterSignup":216},[],{"title":199,"subtitle":200,"ctas":201},"Ready to get started?","Discover how we can help your business.",[202,205],{"_modelApiKey":203,"text":204,"isExternal":7,"url":75,"openForm":11},"link","Get started for free",{"_modelApiKey":203,"text":206,"isExternal":11,"openForm":7,"form":207},"Contact us",{"_modelApiKey":55,"slug":138,"name":139},{"showNotification":7,"link":209,"linkText":210,"text":215},{"_modelApiKey":203,"text":210,"isExternal":11,"link":211,"openForm":11},"Read article",{"_modelApiKey":212,"slug":213,"title":214},"blog_post","the-new-payments-api-built-for-how-people-pay-now","The new Payments API. Built for how people pay now.","\u003Cp>The new Payments API. Built for how people pay now.\u003C\u002Fp>\n",{"ctaText":217},"Subscribe",[219,225,229,236,240,246,249,253,261,262,267,272,274],{"_modelApiKey":55,"slug":220,"pardotFormEmbedCode":221,"formEmbedMinHeight":222,"successTitle":223,"successCopy":224},"agentic-commerce","https:\u002F\u002Fcommercelayer.fillout.com\u002Ft\u002F5w4Khwgxr6us?whitepaper=agentic",520,"Thank you for your request!","We’ll be in touch soon to arrange a date and time for your personalized demo.",{"_modelApiKey":55,"slug":226,"pardotFormEmbedCode":227,"formEmbedMinHeight":228,"successTitle":223,"successCopy":224},"shopify","https:\u002F\u002Fform.fillout.com\u002Ft\u002FgVnLSmKZwRus",850,{"_modelApiKey":55,"slug":130,"pardotFormEmbedCode":230,"formEmbedMinHeight":231,"displayTitle":232,"copy":233,"successTitle":234,"successCopy":235},"https:\u002F\u002Fform.fillout.com\u002Ft\u002FmVDF8aAiofus",500,"We give back.","\u003Cp>Part of Commerce Layer&#39;s company ethos is to empathize and support one another: co-workers, customers, and community. We want to do our part to help nonprofit organizations and small businesses who may feel adversely affected by the current global economic climate, and as a result, need in-kind support to reach their customers.\u003C\u002Fp>\n\n\u003Cp>If this general description matches your organization’s needs, please tell us your story by completing the following form so we can consider helping your cause.\u003C\u002Fp>\n","Thank you!","We will contact you soon to learn more about your story.",{"_modelApiKey":55,"slug":237,"pardotFormEmbedCode":227,"formEmbedMinHeight":228,"displayTitle":238,"copy":239},"book-an-onboarding-session","Book an onboarding session","\u003Cp>Schedule some time and our devs will help you set up a Commerce Layer + Sanity store.\u003C\u002Fp>\n",{"_modelApiKey":55,"slug":241,"pardotFormEmbedCode":242,"formEmbedMinHeight":243,"displayTitle":244,"successTitle":234,"successCopy":245},"download-our-whitepaper","https:\u002F\u002Fform.fillout.com\u002Ft\u002F5YPWmy8oT7us?whitepaper=ComposableCommerce",450,"Download our whitepaper.","Check your inbox. You should receive a download link soon.",{"_modelApiKey":55,"slug":247,"pardotFormEmbedCode":248,"formEmbedMinHeight":243,"displayTitle":244,"successTitle":234,"successCopy":245},"download-the-content-and-commerce-whitepaper","https:\u002F\u002Fform.fillout.com\u002Ft\u002F5YPWmy8oT7us?whitepaper=ContentAndCommerce",{"_modelApiKey":55,"slug":250,"pardotFormEmbedCode":251,"formEmbedMinHeight":243,"displayTitle":244,"copy":252,"successTitle":234,"successCopy":245},"whitepaper","https:\u002F\u002Fform.fillout.com\u002Ft\u002F5YPWmy8oT7us?whitepaper=Jamstack","\u003Cp>Commerce Layer is the perfect platform for building commerce on the Jamstack. Convert any design into pixel perfect HTML pages. Connect a best-of-breed headless CMS. Go serverless and forget the hassle of managing complex infrastructures.\u003C\u002Fp>\n",{"_modelApiKey":55,"slug":254,"pardotFormEmbedCode":255,"formEmbedMinHeight":256,"displayTitle":257,"copy":258,"successTitle":259,"successCopy":260},"contact-links","https:\u002F\u002Fform.fillout.com\u002Ft\u002FeWPyhHGHT7us",750,"Contact us.","\u003Cp>Tell us about your project. Our team will reach out to you for a personalized offer.\u003C\u002Fp>\n","Thanks for your message!","We’ll be in touch soon to discuss your project details.",{"_modelApiKey":55,"slug":138,"pardotFormEmbedCode":255,"formEmbedMinHeight":256,"displayTitle":257,"copy":258,"successTitle":259,"successCopy":260},{"_modelApiKey":55,"slug":263,"pardotFormEmbedCode":227,"formEmbedMinHeight":228,"displayTitle":264,"successTitle":265,"successCopy":266},"demo-embed","Want to see it in action? Request a demo.","Thanks for your request!","We’ll be in touch soon to arrange a date and time for your free live demo.",{"_modelApiKey":55,"slug":53,"pardotFormEmbedCode":268,"formEmbedMinHeight":228,"displayTitle":269,"copy":270,"successTitle":234,"successCopy":271},"https:\u002F\u002Fform.fillout.com\u002Ft\u002F9MTkDWMUSqus","Become our partner.","\u003Cp>Join us and get our guidance in helping your clients succeed. Our partners are our ambassadors. We are committed to your success as much as you are.\u003C\u002Fp>\n","We will contact you soon to discuss the details of our partnership.",{"_modelApiKey":55,"slug":273,"pardotFormEmbedCode":268,"formEmbedMinHeight":228,"displayTitle":269,"copy":270,"successTitle":234,"successCopy":271},"partners-embed",{"_modelApiKey":55,"slug":143,"pardotFormEmbedCode":227,"formEmbedMinHeight":228,"displayTitle":275,"copy":276,"successTitle":265,"successCopy":266},"Get a free live demo.","\u003Cp>Get a personalized demo and learn more about what Commerce Layer can do for your company.\u003C\u002Fp>\n",{"_modelApiKey":212,"link":278,"subtitle":283,"date":283,"author":284,"additionalAuthors":294,"icon":295,"abstract":296,"tag":297,"displayTitle":279,"cardRatio":300,"featured":11,"seoMetaTags":301,"layout":365,"blogPostCarousel":303,"_seoMetaTags":459,"authors":493},{"text":279,"isExternal":11,"url":280,"link":281},"Your promotions, your rules: a deep dive into Commerce Layer’s Rules Engine.","",{"_modelApiKey":212,"slug":282},"rules-engine-flex-promotion-examples","December 19, 2025",{"name":285,"picture":286},"Sara Bonechi",{"url":287,"alt":288,"title":288,"width":289,"height":289,"format":290,"focalPoint":291,"customData":293},"https:\u002F\u002Fwww.datocms-assets.com\u002F35053\u002F1764784884-sara.jpg","Sara Bonechi avatar",1280,"jpg",{"x":292,"y":292},0.5,{},[],"gift","Build powerful, custom promotions with Commerce Layer's Rules Engine and model any complex discount logic with full flexibility. The Rules Engine is now out of beta and available as an add-on.",{"color":298,"name":299},"gray","Tutorials","portrait",[302,306,310,313,317,320,323,327,331,335,338,342,346,350,354,357,361],{"attributes":303,"tag":304,"content":305},null,"title","Build advanced promotions with Commerce Layer’s Rules Engine",{"attributes":307,"tag":309,"content":303},{"property":308,"content":305},"og:title","meta",{"attributes":311,"tag":309,"content":303},{"name":312,"content":305},"twitter:title",{"attributes":314,"tag":309,"content":303},{"name":315,"content":316},"description","Unlock smart promotional logic with Commerce Layer’s Rules Engine. Choose conditions, build bundles, and tailor discounts to your real strategy.",{"attributes":318,"tag":309,"content":303},{"property":319,"content":316},"og:description",{"attributes":321,"tag":309,"content":303},{"name":322,"content":316},"twitter:description",{"attributes":324,"tag":309,"content":303},{"property":325,"content":326},"og:image","https:\u002F\u002Fwww.datocms-assets.com\u002F35053\u002F1764785064-cl_promo-engine_thumb.jpg?auto=format&fit=max&w=1200",{"attributes":328,"tag":309,"content":303},{"property":329,"content":330},"og:image:width","1200",{"attributes":332,"tag":309,"content":303},{"property":333,"content":334},"og:image:height","630",{"attributes":336,"tag":309,"content":303},{"name":337,"content":326},"twitter:image",{"attributes":339,"tag":309,"content":303},{"property":340,"content":341},"og:locale","en",{"attributes":343,"tag":309,"content":303},{"property":344,"content":345},"og:type","article",{"attributes":347,"tag":309,"content":303},{"property":348,"content":349},"og:site_name","Commerce Layer",{"attributes":351,"tag":309,"content":303},{"property":352,"content":353},"article:modified_time","2025-12-19T15:40:24Z",{"attributes":355,"tag":309,"content":303},{"property":356,"content":280},"article:publisher",{"attributes":358,"tag":309,"content":303},{"name":359,"content":360},"twitter:card","summary_large_image",{"attributes":362,"tag":309,"content":303},{"name":363,"content":364},"twitter:site","@commercelayer",[366,372,378,382,385,398,401,411,416,419,425,427,430,436,438,441,447,449,452],{"_modelApiKey":367,"copy":368,"listStyle":369,"darkTheme":11,"buttons":370,"color":371,"indent":7},"wysiwyg","\u003Cp>Every business has its own rules, discount structures, and customer policies that are built in a peculiar way and can’t always be accommodated with a simple rule. More and more brands are asking for the ability to build their own logic when it comes to promotion management. That’s why we built the \u003Cstrong>Rules Engine\u003C\u002Fstrong> — a powerful tool that lets you model even the most complex promotional logic.\u003C\u002Fp>\n\n\u003Chr>\n\n\u003Cp>As your business grows, your discount strategies often become more sophisticated. You may need to calculate promotions that go beyond a simple percentage or fixed amount discount. Perhaps you want to combine multiple attributes such as SKU properties (tags, metadata, etc.), customer groups, order history, apply special rounding, calculate dynamic bundles or any combination of these.\u003C\u002Fp>\n\n\u003Cp>That’s where the Rules Engine comes in — a powerful new product (available on request) that gives you unprecedented flexibility and control over promotions and pricing. It enables you to define \u003Cstrong>dynamic conditions\u003C\u002Fstrong> that go far beyond standard coupon or percentage-based rules.\u003C\u002Fp>\n","directional",[],"red",{"_modelApiKey":373,"title":374,"preTitle":93,"linkText":59,"darkTheme":11,"link":375},"link_block","Rules Engine",{"_modelApiKey":203,"text":376,"label":280,"subtitle":280,"icon":280,"isExternal":7,"url":377,"link":303,"anchor":280,"openForm":11,"form":303,"htmlClassNames":280},"Rules engine","https:\u002F\u002Fdocs.commercelayer.io\u002Frules-engine\u002F",{"_modelApiKey":367,"copy":379,"listStyle":380,"darkTheme":11,"buttons":381,"color":371,"indent":11},"\u003Cp>With the Rules Engine, you can:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>\u003Cstrong>\u003Cem>Build flexible promotions\u003C\u002Fem>\u003C\u002Fstrong>---They can be based on any attribute — including SKUs, line items, customers, or orders — and will be applied directly \u003Cstrong>at the cart level\u003C\u002Fstrong>.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>\u003Cem>Create conditional pricing\u003C\u002Fem>\u003C\u002Fstrong>---For example, automatically apply a percentage discount to specific customer segments without configuring separate markets. These rules \u003Cstrong>generate discounted prices\u003C\u002Fstrong> for eligible users, rather than applying discounts at checkout.\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>Imagine setting up pricing rules that reflect your real-world business logic — that’s exactly what the Rules Engine is designed to do.\u003C\u002Fp>\n","checkbox",[],{"_modelApiKey":367,"copy":383,"listStyle":369,"darkTheme":11,"buttons":384,"color":371,"indent":11},"\u003Ch3>Real-world examples\u003C\u002Fh3>\n\n\u003Cp>Let’s look at a few practical examples of what you can achieve with the Rules Engine.\u003C\u002Fp>\n\n\u003Ch4>Basic funcionalities\u003C\u002Fh4>\n\n\u003Cp>Our Rules Engine works defining conditions on the order and all the resources connected to the orders: line items, SKUs, customers, amounts, shipping methods, payment methods, addresses, prices, inventories, quantitites. And combination of them. There are infinite use cases that can be covered, all with a nice UI. \u003C\u002Fp>\n\n\u003Cp>Let’s assume you need to create a promotion that gives your clients 20% if they buy T-shirts (that should belong to the &quot;new collection&quot; and not to the &quot;outlet collection&quot;) and 30% if they buy &quot;shorts&quot;, but only for customers that are registered. This will roll-out in a promotion with two different conditions and two different actions: let&#39;s see how in the video below:\u003C\u002Fp>\n",[],{"id":386,"_modelApiKey":387,"border":11,"caption":280,"rounded":7,"size":388,"video":389},"bWde_GxTQYiS2cSmznCXnA","video","standard",{"videoId":390,"videoProvider":391,"videoPoster":392},"V5UqhhrKsyg","youtube",{"url":393,"alt":303,"title":303,"width":394,"height":395,"format":290,"focalPoint":396,"customData":397},"https:\u002F\u002Fwww.datocms-assets.com\u002F35053\u002F1765554441-flex-promo-video-thumb.jpg",1920,1080,{"x":292,"y":292},{},{"_modelApiKey":367,"copy":399,"listStyle":369,"darkTheme":11,"buttons":400,"color":371,"indent":11},"\u003Ch4>Promotion based on the reference price\u003C\u002Fh4>\n\n\u003Cp>Imagine a scenario where you’ve sent out a voucher offering a 30% discount on polos. If the SKU is priced at €100, when the customer redeems the promotion pays €70. Later, during the sales period, the product price drops to €80 — but you still want the voucher to make the product cost €70, not apply another 30% discount.\u003C\u002Fp>\n\n\u003Cp>With the Rules Engine the solution is easy — you can create promotions that calculate discounts relative to the original reference price (&quot;compare at&quot;, usually displayed as a strikethrough), not the current sale price. This ensures your promotion logic remains consistent:\u003C\u002Fp>\n",[],{"_modelApiKey":402,"border":7,"caption":280,"image":403,"size":410,"darkTheme":11,"rounded":7,"color":371},"image_block",{"url":404,"alt":405,"title":405,"width":406,"height":407,"format":290,"focalPoint":408,"customData":409},"https:\u002F\u002Fwww.datocms-assets.com\u002F35053\u002F1766143573-promo-ex-1.jpg","Promotion example",1600,1378,{"x":292,"y":292},{},"wide",{"_modelApiKey":412,"code":413,"showLineNumbers":11,"highlightLines":280,"language":414,"size":415},"code_block","{\n  \"rules\": [\n    {\n      \"id\": \"f78399cc-6746-400f-b1ca-915082e49ce1\",\n      \"name\": \"30% discount on Polos\",\n      \"actions\": [\n        {\n          \"type\": \"percentage\",\n          \"value\": 0.3,\n          \"groups\": [\n            \"discountable_items\"\n          ],\n          \"apply_on\": \"compare_at_amount_cents\",\n          \"selector\": \"order.line_items\"\n        }\n      ],\n      \"conditions\": [\n        {\n          \"field\": \"order.line_items.sku.tags.id\",\n          \"group\": \"discountable_items\",\n          \"value\": {\n            \"in_or\": [\n              \"NJkkxfOeJX\"\n            ]\n          },\n          \"matcher\": \"array_match\"\n        }\n      ]\n    }\n  ]\n}","json","Wide",{"_modelApiKey":367,"copy":417,"listStyle":369,"darkTheme":11,"buttons":418,"color":371,"indent":11},"\u003Ch4>Discounted prices for employees\u003C\u002Fh4>\n\n\u003Cp>In some companies, employees have the right to get a certain discount on the actual products. Instead of creating a separated website and market with a dedicated price list in Commerce Layer, you can choose to apply a simple 30% discount rule on the prices for users that have a certain email. This will mean that your employee will see the full prices when entering the website, and will see the discounted prices after they log in. \u003C\u002Fp>\n\n\u003Cp>A simple way of handling a discount that can also be limited in time as shown in the example:\u003C\u002Fp>\n",[],{"_modelApiKey":402,"border":7,"caption":280,"image":420,"size":410,"darkTheme":11,"rounded":7,"color":371},{"url":421,"alt":405,"title":405,"width":406,"height":422,"format":290,"focalPoint":423,"customData":424},"https:\u002F\u002Fwww.datocms-assets.com\u002F35053\u002F1766143177-promo-ex-2.jpg",1083,{"x":292,"y":292},{},{"_modelApiKey":412,"code":426,"showLineNumbers":11,"highlightLines":280,"language":414,"size":415},"{\n  \"rules\": [\n    {\n      \"name\": \"Discounted Price for employees\",\n      \"actions\": [\n        {\n          \"groups\": [],\n          \"type\": \"percentage\",\n          \"value\": 0.3,\n          \"selector\": \"price\"\n        }\n      ],\n      \"conditions\": [\n        {\n          \"field\": \"price.jwt_customer.email\",\n          \"matcher\": \"end_with\",\n          \"value\": \"@test.com\"\n        }\n      ]\n    }\n  ]\n}",{"_modelApiKey":367,"copy":428,"listStyle":369,"darkTheme":11,"buttons":429,"color":371,"indent":11},"\u003Ch4>Bundle promotion: buy a T-shirt, a polo and a top — get 10% off\u003C\u002Fh4>\n\n\u003Cp>Bundles are a classic ecommerce strategy. Commerce Layer already supports bundles \u003Ca href=\"\u002Fdocs\u002Fdata-model\u002Fbundles\">out of the box\u003C\u002Fa>, but sometimes you might prefer to implement them as promotions instead — quicker and easier to handle. \u003C\u002Fp>\n\n\u003Cp>With the Rules Engine, you can easily define a rule that pairs products using shared tags and applies a fixed discount to the total price. If the order contains more possible combinations (2 T-shirts, 1 polo and 1 top for example) you can dedice wheter to discount the cheapest or the most expansive one. \u003C\u002Fp>\n\n\u003Cp>Here’s an example:\u003C\u002Fp>\n",[],{"_modelApiKey":402,"border":7,"caption":280,"image":431,"size":410,"darkTheme":11,"rounded":7,"color":371},{"url":432,"alt":405,"title":405,"width":406,"height":433,"format":290,"focalPoint":434,"customData":435},"https:\u002F\u002Fwww.datocms-assets.com\u002F35053\u002F1766143311-promo-ex-3.jpg",2204,{"x":292,"y":292},{},{"_modelApiKey":412,"code":437,"showLineNumbers":11,"highlightLines":280,"language":414,"size":415},"{\n  \"rules\": [\n    {\n      \"id\": \"678092bf-100a-4e1b-9534-e8c960f79ac3\",\n      \"name\": \"Get 10% if you have a bundle of tshirt, polo and top\",\n      \"actions\": [\n        {\n          \"type\": \"percentage\",\n          \"value\": 0.1,\n          \"bundle\": {\n            \"sort\": {\n              \"attribute\": \"unit_amount_cents\",\n              \"direction\": \"asc\"\n            },\n            \"type\": \"balanced\"\n          },\n          \"groups\": [\n            \"group_a\",\n            \"group_b\",\n            \"group_c\"\n          ],\n          \"selector\": \"order.line_items\"\n        }\n      ],\n      \"conditions\": [\n        {\n          \"field\": \"order.line_items.sku.tags.name\",\n          \"group\": \"group_a\",\n          \"value\": {\n            \"in_or\": [\n              \"tshirt\"\n            ]\n          },\n          \"matcher\": \"array_match\"\n        },\n        {\n          \"field\": \"order.line_items.sku.tags.name\",\n          \"group\": \"group_b\",\n          \"value\": {\n            \"in_or\": [\n              \"polo\"\n            ]\n          },\n          \"matcher\": \"array_match\"\n        },\n        {\n          \"field\": \"order.line_items.sku.tags.name\",\n          \"group\": \"group_c\",\n          \"value\": {\n            \"in_or\": [\n              \"top\"\n            ]\n          },\n          \"matcher\": \"array_match\"\n        }\n      ]\n    }\n  ]\n}",{"_modelApiKey":367,"copy":439,"listStyle":369,"darkTheme":11,"buttons":440,"color":371,"indent":11},"\u003Ch4>Progressive discount: the more you buy, the more you save\u003C\u002Fh4>\n\n\u003Cp>Sometimes you may want to increase or decrease the discount based on how many products the customers are buying. For example:\u003C\u002Fp>\n\n\u003Cul>\n\u003Cli>Buy 2 products among a list — get 300 USD off\u003C\u002Fli>\n\u003Cli>Buy 3 products among a list — get 400 USD off\u003C\u002Fli>\n\u003C\u002Ful>\n\n\u003Cp>With the Rules Engine, setting up a tiered discount like this is simple. You can define thresholds based on quantities or order totals, and apply progressive rewards that encourage higher-value purchases:\u003C\u002Fp>\n",[],{"_modelApiKey":402,"border":7,"caption":280,"image":442,"size":410,"darkTheme":11,"rounded":7,"color":371},{"url":443,"alt":405,"title":405,"width":406,"height":444,"format":290,"focalPoint":445,"customData":446},"https:\u002F\u002Fwww.datocms-assets.com\u002F35053\u002F1765982989-promo-ex-4.jpg",2101,{"x":292,"y":292},{},{"_modelApiKey":412,"code":448,"showLineNumbers":11,"highlightLines":280,"language":414,"size":415},"{\n  \"rules\": [\n    {\n      \"id\": \"trp7685f-7760-452e-b9b4-83434b89e2a8\",\n      \"name\": \"Buy 2 items among Washing Mashine, stove and microvawe, get 300 USD discount, buy 3 get 400 USD\",\n      \"conditions_logic\": \"or\",\n      \"conditions\": [\n        {\n          \"field\": \"order.line_items.sku.metadata.kind\",\n          \"matcher\": \"is_in\",\n          \"value\": [\n            \"stove\",\n            \"microwave\",\n            \"washing_machine\"\n          ],\n          \"group\": \"300_off\",\n          \"aggregations\": [\n            {\n              \"field\": \"order.line_items.sku.metadata.brand\",\n              \"operator\": \"count_uniq\",\n              \"matcher\": \"eq\",\n              \"value\": 1\n            },\n            {\n              \"field\": \"order.line_items.quantity\",\n              \"operator\": \"sum\",\n              \"matcher\": \"eq\",\n              \"value\": 2\n            }\n          ]\n        },\n        {\n          \"field\": \"order.line_items.sku.metadata.kind\",\n          \"matcher\": \"is_in\",\n          \"value\": [\n            \"stove\",\n            \"microwave\",\n            \"washing_machine\"\n          ],\n          \"group\": \"400_off\",\n          \"aggregations\": [\n            {\n              \"field\": \"order.line_items.sku.metadata.brand\",\n              \"operator\": \"count_uniq\",\n              \"matcher\": \"eq\",\n              \"value\": 1\n            },\n            {\n              \"field\": \"order.line_items.quantity\",\n              \"operator\": \"sum\",\n              \"matcher\": \"eq\",\n              \"value\": 3\n            }\n          ]\n        }\n      ],\n      \"actions\": [\n        {\n          \"type\": \"fixed_amount\",\n          \"selector\": \"order\",\n          \"groups\": [\n            \"300_off\"\n          ],\n          \"value\": 30000\n        },\n        {\n          \"type\": \"fixed_amount\",\n          \"selector\": \"order\",\n          \"groups\": [\n            \"400_off\"\n          ],\n          \"value\": 40000\n        }\n      ]\n    }\n  ]\n}",{"_modelApiKey":367,"copy":450,"listStyle":369,"darkTheme":11,"buttons":451,"color":371,"indent":11},"\u003Ch3>Why it matters\u003C\u002Fh3>\n\n\u003Cp>The Rules Engine gives enterprise brands the power to express their \u003Cstrong>real promotional strategies\u003C\u002Fstrong> — no workarounds, no extra markets, no hacks. Whether you’re rewarding loyal customers, managing employee pricing, or running seasonal campaigns, your logic can now live directly in Commerce Layer.\u003C\u002Fp>\n\n\u003Ch3>Try It Out\u003C\u002Fh3>\n\n\u003Cp>If you want to start experimenting with advanced promotion logic, request a free trial period directly from your Dashboard in the Promotions app. We’ll help you get started with the Rules Engine and tailor it to your business needs.\u003C\u002Fp>\n",[],{"_modelApiKey":402,"border":7,"caption":280,"image":453,"size":388,"darkTheme":11,"rounded":7,"color":371},{"url":454,"alt":455,"title":455,"width":289,"height":456,"format":290,"focalPoint":457,"customData":458},"https:\u002F\u002Fwww.datocms-assets.com\u002F35053\u002F1766143081-upgrade-promo-screenshot.jpg","Upgrade promo",484,{"x":292,"y":292},{},[460,461,463,465,467,469,471,473,475,477,479,481,483,485,487,489,491],{"attributes":303,"tag":304,"content":305},{"attributes":462,"tag":309,"content":303},{"property":308,"content":305},{"attributes":464,"tag":309,"content":303},{"name":312,"content":305},{"attributes":466,"tag":309,"content":303},{"name":315,"content":316},{"attributes":468,"tag":309,"content":303},{"property":319,"content":316},{"attributes":470,"tag":309,"content":303},{"name":322,"content":316},{"attributes":472,"tag":309,"content":303},{"property":325,"content":326},{"attributes":474,"tag":309,"content":303},{"property":329,"content":330},{"attributes":476,"tag":309,"content":303},{"property":333,"content":334},{"attributes":478,"tag":309,"content":303},{"name":337,"content":326},{"attributes":480,"tag":309,"content":303},{"property":340,"content":341},{"attributes":482,"tag":309,"content":303},{"property":344,"content":345},{"attributes":484,"tag":309,"content":303},{"property":348,"content":349},{"attributes":486,"tag":309,"content":303},{"property":352,"content":353},{"attributes":488,"tag":309,"content":303},{"property":356,"content":280},{"attributes":490,"tag":309,"content":303},{"name":359,"content":360},{"attributes":492,"tag":309,"content":303},{"name":363,"content":364},[494],{"name":285,"picture":495},{"url":287,"alt":288,"title":288,"width":289,"height":289,"format":290,"focalPoint":496,"customData":497},{"x":292,"y":292},{},1791379909983]