Akinon Release Notes (05/12/2025) are now live! Click here to learn what's new.
LogoLogo
API Reference
  • Home
  • Quick Start
  • Tutorials
  • Technical Guides
  • Release Notes
  • Glossary
  • Welcome to Akinon Technical Guides
  • ACC
    • ACC CLI
    • Create Application via CLI
    • Deploy Environment Variables
    • App Store for Developers
  • Omnitron
    • Product Types
    • Product Categorization
    • Splitting a Merged Order Item
  • Commerce
    • Shipping Rules Calculator
    • Data Source Shipping Options
    • Attribute Based Shipping Options
    • Filtering Products
    • Conversation & Messages
    • Sitemap Configuration
    • Weight-Based Product Sales
    • Group Attribute Sets
    • Contract Management
    • Find in Store for Whippy Ware
    • Plugins
    • Remote Price
    • E-mail Templates
    • Loyalty Accounts
    • Search Structure
    • User Segmentation & Rules
    • Promotions
  • OMS
    • Getting Started with OMS
    • Basic Setup
    • Scenarios
    • Capacity Feature
    • Package Management
      • Packages
      • Transfer
      • States
    • Commands
      • Packages
        • Package Command Parameters
        • DeAllocate Package Reservations Command
        • Channel Based Complete Packaging without Shipment Command
        • Complete Packaging with Shipment Command
        • Complete Packaging without Shipment Command
        • Package Refuse with Denial Reason Command
        • Product Not Found & Wrong Product Command
        • Product Not Found & Wrong Product Command Advanced
        • Package Packed for Refund Command
        • Block The Package For Action Command
        • Unblock the Package For Action Command
        • Update The Package’s Invoice
        • Manual Planning Command
      • Transfer
        • Transfer Order Advanced Command
        • Product for Transfer Not Found & Wrong Product Command
        • Transfer Delivered Command
        • Transfer Dispatch Command
        • Transfer Ready for Dispatch Command
        • Transfer Out Of Stock
      • Shipment
        • Shipment Order Command
        • Package Advanced Shipment Command
        • Ship The Package Command
        • Ship The Package without Shipment Integration Command
        • Update The Package’s Shipment Status Command
        • Update Shipment Info of Package Command
    • Inventory Locations & Engine
      • Properties & Domain Relation
      • Customization
      • Inventory Engine
    • Fulfillment
      • Shipments
      • Invoice Integration
    • Webhooks
      • Webhook Examples
        • Order Webhook
        • Package Webhook
        • Shipment Webhook
        • Stock Location Webhook
        • Transfer Webhook
    • Integrating OMS with Seller Center
  • Instore
    • Getting Started
    • Cash Register Integration
    • OTP (One Time Password) Process
    • Services
      • Password Reset Services
  • Marketplace Dashboard
    • N11 Marketplace Setup Configurations
    • Trendyol Marketplace Setup Configurations
    • Walmart Marketplace Setup Configurations
    • Amazon Marketplace Setup Configurations
    • Hepsiburada Marketplace Setup Configurations
  • Project Zero
    • Django
      • Basic Setup
      • Project Structure
        • Templates & Components
        • Private Dependencies
        • Omnife Project Submodule
        • Webpack
        • ESLint Rules
        • Bundles
        • Multilanguage & Translation
        • Environmental File
        • Custom Error Pages
        • Icon Font
      • Page Types
        • Static Pages & Flatpages
        • Account Page
          • Template Rendering in Account Pages
          • Forms & Validation
        • Basket Page
          • Redux Basket State
          • Basket Page - View
        • Checkout
          • Redux Checkout State
          • View & Template Rendering
          • Masking & Validation
      • Theming & Styling
      • Widgets
      • SEO Management
      • Extending Project Zero
    • Next.js
      • Basic Setup
      • Deployment
      • Static Assets
      • Plugins
      • Widgets
      • Icons
      • Localization
      • SEO Management
      • Advanced Usage
      • Data Fetching
        • Client
          • Account
          • Address
          • Basket
          • Checkout
          • Misc
          • Product
          • User
          • Wishlist
        • Server
          • Category
          • Flat Page
          • List
          • Menu
          • Product
          • SEO
          • Special Page
          • Widget
  • App Maker
    • Setup Your Environment
    • Plugin Quickstart
    • Create Project
    • Setup Existing Project
    • Deploy Project
    • Users and Roles
    • Add Public Key
    • App Maker CLI
    • Create App on Stores
      • Creating App on Apple App Store
      • Creating App on Google Play Store
    • Mobile App Framework
      • Configuration
      • Framework
      • Project Structure
        • Structure
        • Data Containers
        • Pages
      • Dependency Integration
        • Plugins
        • Akinon Plugin Adapter
  • Akifast
    • HPP
      • Getting Started
      • Authorization
      • Payment Session Creation
        • Key Points Before Creating a Payment Session
        • Creating Payment Session
        • Redirecting to the Payment Page
        • Errors Encountered During Payment Session Creation
      • Merchant Services
        • Shipping Query URL
        • Agreement Query URL
        • Other URLs
  • B2B
    • Getting Started
    • B2B Setup
  • Adds-on
    • Invoicer
      • Introduction
      • Invoice & Pay On Delivery Service
  • Channel App Template
    • Introduction
    • Installation and Usage
    • Development Steps
      • Folder Structure
      • Starting Step
      • Encoding the Sales Channel
        • Introduction
        • Setup
        • Products
        • Product Price
        • Product Stock
        • Product Image
        • Orders
        • Product Data
      • Adding a New Command to Akinon
      • Listening for External Requests
    • Architecture
      • Introduction
      • Integration
      • Services (Flows)
        • Introduction
        • Product Service
        • Price Service
        • Stock Service
        • Image Service
        • Order Service
  • Multi Regional Settings
    • Multi Regional Settings
Powered by GitBook

© 2025 Akinon. All rights reserved.

On this page
  • Questions & Answers
  • Rules
  • 1. Liquer Rule
  • 2. True Rule
  • 3. False Rule
  • 4. Guest Rule
  • 5. Order Count Rule
  • 6. Order Amount Rule
  • 7. Group Rule
  • 8. Not Rule
  • 9. Email Extension Rule
  • 10. Currency Rule
  • 11. Segment Order Limit Rule
  • 12. Segment Order Amount Limit Rule
  • 13. Segment Order Item Product Attribute Limit Rule
  • Multiple Rule Definitions
  • 1. And Rule
  • 2. Or Rule

Was this helpful?

  1. Commerce

User Segmentation & Rules

A segment can be defined as a dynamic user group. User segmentation determines the user's segment at runtime and provides features such as displaying prices and stock based on that segment. When defining a segment, you need to input the segment's rule. This rule is applied to the user to determine their segment. If the rule returns True, it means the user fits into that segment. If the value is False, it means the user does not fit the segment's rule.

When determining a user's segment, the tested segment's rule is applied. If the user fits the rule of that segment, their segment is determined. A user can fit the rules of multiple segments, which is why there is a "priority" field in segments. This field indicates which segment takes priority when determining the user's segment. The lower the priority number, the higher the priority. For example, a segment with a priority of 5 takes precedence over a segment with a priority of 9. To manage the active or inactive status of a segment, there is an "is_active" field. If a segment is deactivated, it will not be tested when determining a user's segment. If a segment should be active during specific dates, you should specify the desired date range when creating the segment.

If a segment has a defined price list, only products with prices listed in that segment will be visible to the user. If you want customers in this segment to see the shop's price list, you should leave the price list field empty. Similarly, if a segment has a defined stock list, only products with stock listed in that segment will be visible to the user. If you want customers in this segment to see the shop's stock list, you should leave the stock list field empty.

Questions & Answers

1. How can I determine which segment I belong to?

You can check which segment you belong to by making a request to "/baskets/basket/?format=json," and you will see your segment in the response. The IDs of the price and stock lists here correspond to the IDs of these lists in the shop.

Example Segment Structure:

{
    "segment": 1, // ID of the related segment
    "price_list": 1, // ID of the segment's price list
    "stock_list": 1 // ID of the segment's stock list
}

2. In what order do segments work, and how can I understand it?

To determine the order in which segments work, go to the back-office of the relevant brand, select "Active" in the Status filter on the segment listing screen, and then click on the "Customer Group Priority" column header to sort by priority value from lowest to highest. This sorting defines the order in which segments are applied to users.

3. I'm not seeing the prices I should see. Why is the segment not working?

First, make sure you are part of that segment. You might have joined a segment with a higher priority, so you may not see the expected prices and stocks.

4. I made changes to a segment, but I can still belong to the same segment. Why?

Changes made to segments (creating a new segment, activating/deactivating, changing price/stock lists, changing rules, etc.) may take 5-10 minutes to reflect in the shop due to the caching structure used.

5. I'm trying to add a product with available stock to the cart, but I can't. Why?

The absence of price or stock records for a product linked to a segment can cause this issue.

6. Before assuming a technical problem, what should I check for a problem related to a segment?

First, you should be aware of the segment you are a part of and the price and stock lists associated with that segment. Then, ensure that the product you are looking at and any linked gift products have the correct price and stock records in the relevant lists. If everything is correct and you still face issues, you can contact the Bridge team.

Rules

1. Liquer Rule

This rule allows access to and comparison of values on the user or request.

Parameters: query, value

Example:

{ 
    "rule": "liquer", 
    "params": { 
    "query": "user__email__endswith", 
    "value": "@gmail.com" 
    } 
} 

2. True Rule

This is a rule that always returns "True" for every user. It can be used, for example, to gather users who are not included in any segment.

Parameters: No parameters required.

Example:

{ 
    "rule": "true", 
    "params": {} 
}

3. False Rule

This is a rule that always returns "False" for every user.

Parameters: No parameters required.

Example:

{ 
    "rule": "false", 
    "params": {} 
}

4. Guest Rule

This is a rule that returns "True" for users who are not logged in (anonymous) or have a user_type value of "guest."

Parameters: No parameters required.

Example:

{ 
    "rule": "guest", 
    "params": {} 
} 

5. Order Count Rule

This rule operates based on the number of orders created by the user within X days. In the example below, if a user has created between 10 and 20 orders (including 10 and 20) in the last 90 days, they will be included in this segment.

Parameters: lower_limit (lower bound), upper_limit (upper bound - optional), duration (number of days for backward calculation - optional)

Example:

{ 
    "rule": "order_count", 
    "params": { 
        "lower_limit": 10, 
        "upper_limit": 20, 
        "duration": 90 // gün
    } 
} 

6. Order Amount Rule

This rule operates based on the total amount of orders created by the user within X days. In the example below, if a user's total order amount is between 5000 and 10000 (including 5000 and 10000) in the last 90 days, they will be included in this segment.

Parameters: lower_limit (lower bound), upper_limit (upper bound - optional), duration (number of days for backward calculation - optional)

Example:

{ 
    "rule": "order_amount", 
    "params": { 
        "lower_limit": 5000, 
        "upper_limit": 10000, 
        "duration": 90 
    } 
}

7. Group Rule

This is a rule that returns "True" for users in a specific user group. Each user can belong to multiple groups, and group settings can be managed from Sales Channel Settings > Customer Groups > Customer Groups page.

Parameters: name (group name)

Example:

{ 
    "rule": "group", 
    "params": { 
        "name": "VIP Customers" 
    } 
} 

8. Not Rule

The "not" rule returns "True" when the sub-rule returns "False."

For example, in the following rule definition, a user is included in the segment if the client type they used for the application is not the default. (Client types are default (web), ios, android, and instore. In this example, users from ios, android, and instore will be included in the segment.)

Parameters: child (sub-rule)

Example:

{ 
    "rule": "not", 
    "params": { 
        "child": { 
        "rule": "liquer", 
        "params": { 
            "query": "request__session__client_type", 
            "value": "default" 
            } 
        } 
    } 
}

9. Email Extension Rule

This rule operates based on the extension of the user's email address. For example, if the user's email address ends with "@gmail.com" or "@akinon.com," they will be included in the segment.

Example:

{ 
    "rule": "email_extension", 
    "params": { 
        "extensions": ["@gmail.com", "@akinon.com"] 
    } 
} 

10. Currency Rule

This rule operates based on the currency selected by the user.

For example, in the following rule definition, the user will be included in the segment when they choose Turkish Lira or Euro as their currency.

Example:

{ 
    "rule": "currency", 
    "params": { 
        "currencies": ["try", "eur"] 
    } 
} 

11. Segment Order Limit Rule

This rule does not work for non-registered users. A user who was included in a segment until X days ago and has placed orders less than a certain limit within the last 90 days will be included in this segment.

For example, in the following rule definition, if a user who was previously included in a segment has placed more than 5 orders in the last 90 days, they can no longer be included in this segment. This defines the order limit a user can have within a segment.

Example:

{ 
    "rule": "segment_order_limit", 
    "params": { 
        "order_limit": 5,
        "days": 90,
    } 
} 

12. Segment Order Amount Limit Rule

This rule does not work for non-registered users. A user who was included in a segment until X days ago and whose total order amount within the last 90 days is less than a certain limit will be included in this segment.

For example, in the following rule definition, if a user who was previously included in a segment has a total order amount of more than 5000 in the last 90 days, they can no longer be included in this segment. This defines the order amount limit a user can have within a segment.

Example:

{ 
    "rule": "segment_order_limit", 
    "params": { 
        "order_amount": 5000,
        "days": 90,
    } 
} 

13. Segment Order Item Product Attribute Limit Rule

This rule does not work for non-registered users. A user who was included in a segment until X days ago and has ordered up to a certain limit of a product with the defined "attributevalue" within the last 90 days will be included in this segment; otherwise, they will not be included.

For example, in the following rule definition, if a user who was previously included in a segment has a total of 5 orders of a product with a color attribute of blue in the last 90 days, the user cannot be included in this segment. This defines the product attribute limit a user can have within a segment.

Example:

{ 
    "rule": "segment_order_item_product_attribute_limit", 
    "params": { 
        "attribute": “renk”,
        "attribute_value": “mavi”,
        "days": 90,
        "product_attribute_limit": 5,
    } 
} 

Multiple Rule Definitions

In this section, multiple rules can be defined simultaneously.

1. And Rule

The "and" rule returns "True" when all sub-rules return "True."

Parameters: children (list of sub-rules)

For example, in the following rule definition, if a user has more than 10 orders and at the same time, the total amount of orders they placed is more than 1000, they will be included in this segment.

Example:

{ 
    "rule": "and", 
    "params": { 
        "children": [ 
            { 
                "rule": "order_count", 
                "params": { 
                "lower_limit": 10 
                } 
            }, 
            { 
                "rule": "order_amount", 
                "params": { 
                    "lower_limit": 1000 
                }                
            } 
        ] 
    } 
}

2. Or Rule

The "or" rule returns "True" when at least one of the sub-rules returns "True."

Parameters: children (list of sub-rules)

For example, in the following rule definition, if a user has more than 10 orders or the total amount of orders they placed is more than 1000, they will be included in this segment.

Example:

{ 
    "rule": "or", 
    "params": { 
        "children": [ 
            { 
                "rule": "order_count", 
                "params": { 
                    "lower_limit": 10 
                } 
            }, 
            { 
                "rule": "order_amount", 
                "params": { 
                    "lower_limit": 1000 
                } 
            } 
        ]        
    } 
} 
PreviousSearch StructureNextPromotions

Last updated 16 days ago

Was this helpful?