Ring Platform Logo

    Loading Documentation Hub...

    Scanning documentation library

    Documentation

    Welcome — mission & audiences

    Welcome to Ring Platform - Gateway Between Humanity and the Quantum World

    Library hub

    Welcome to Ring Platform - Gateway Between Humanity and the Quantum World

    Getting Started

    Index
    Prerequisites
    Installation
    Database migrations
    First Success Validation
    Troubleshooting
    Next Steps

    Architecture

    Index
    Backend modes and databases
    Data Model
    Authentication Architecture
    Email AI-CRM Architecture
    PaymentConductor architecture
    Refcodes architecture
    News Kingdom architecture
    Proxy and internationalization
    Real Time
    Security

    Features

    Platform Features
    Authentication
    Email AI-CRM System
    Entities
    Opportunities
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Web3 Wallet
    Multi-Vendor Store
    Ring ERP
    Inventory & Stock

    API

    Index
    Authentication
    Email AI-CRM API
    Entities
    Opportunities
    Messaging API
    Notifications API
    Wallet
    Store API

    CLI

    Ring CLI (enterprise only)

    Customization

    Index
    Branding
    Features
    Localization
    Themes
    Components

    Deployment

    Index
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery

    Development

    Index
    Local Setup
    Code Structure
    Community tooling
    Ring MCP Server
    Generative Images (ImageConductor)
    Autonomous Newsroom (Grok)
    OSS vs enterprise

    Roadmap

    Platform Roadmap (Technical)

    Examples

    Index
    Quick Start
    Authentication
    Email AI-CRM Tutorial
    Api Integration
    Web3 Integration
    White Label
    Real World

    Integrations

    Ethereum wallets (Wagmi v3)

    Quick entry (CTOs · auditors · agents)

    Library hub
    Welcome — mission & audiences
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP
    Deploy (Docker · k8s)
    Security & compliance reads
    Ring Platform Logo

    Loading Documentation Hub...

    Scanning documentation library

    Documentation

    Welcome — mission & audiences

    Welcome to Ring Platform - Gateway Between Humanity and the Quantum World

    Library hub

    Welcome to Ring Platform - Gateway Between Humanity and the Quantum World

    Getting Started

    Index
    Prerequisites
    Installation
    Database migrations
    First Success Validation
    Troubleshooting
    Next Steps

    Architecture

    Index
    Backend modes and databases
    Data Model
    Authentication Architecture
    Email AI-CRM Architecture
    PaymentConductor architecture
    Refcodes architecture
    News Kingdom architecture

    Features

    Platform Features
    Authentication
    Email AI-CRM System
    Entities
    Opportunities
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Web3 Wallet

    API

    Index
    Authentication
    Email AI-CRM API
    Entities
    Opportunities
    Messaging API
    Notifications API
    Wallet
    Store API

    CLI

    Ring CLI (enterprise only)

    Customization

    Index
    Branding
    Features
    Localization
    Themes
    Components

    Deployment

    Index
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery

    Development

    Index
    Local Setup
    Code Structure
    Community tooling
    Ring MCP Server
    Generative Images (ImageConductor)
    Autonomous Newsroom (Grok)
    OSS vs enterprise

    Roadmap

    Platform Roadmap (Technical)

    Examples

    Index
    Quick Start
    Authentication
    Email AI-CRM Tutorial
    Api Integration
    Web3 Integration
    White Label
    Real World

    Integrations

    Ethereum wallets (Wagmi v3)

    Quick entry (CTOs · auditors · agents)

    Library hub
    Welcome — mission & audiences
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP
    Deploy (Docker · k8s)
    Security & compliance reads
    Ring Platform Logo

    Loading Documentation Hub...

    Scanning documentation library

    Documentation

    Welcome — mission & audiences

    Welcome to Ring Platform - Gateway Between Humanity and the Quantum World

    Library hub

    Welcome to Ring Platform - Gateway Between Humanity and the Quantum World

    Getting Started

    Index
    Prerequisites
    Installation
    Database migrations
    First Success Validation
    Troubleshooting
    Next Steps

    Architecture

    Index
    Backend modes and databases
    Data Model
    Authentication Architecture
    Email AI-CRM Architecture
    PaymentConductor architecture
    Refcodes architecture
    News Kingdom architecture

    Features

    Platform Features
    Authentication
    Email AI-CRM System
    Entities
    Opportunities
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Web3 Wallet

    API

    Index
    Authentication
    Email AI-CRM API
    Entities
    Opportunities
    Messaging API
    Notifications API
    Wallet
    Store API

    CLI

    Ring CLI (enterprise only)

    Customization

    Index
    Branding
    Features
    Localization
    Themes
    Components

    Deployment

    Index
    Self-hosted deployment
    Vercel
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery

    Development

    Index
    Local Setup
    Code Structure
    Community tooling
    Ring MCP Server
    Generative Images (ImageConductor)
    Autonomous Newsroom (Grok)
    OSS vs enterprise

    Roadmap

    Platform Roadmap (Technical)

    Examples

    Index
    Quick Start
    Authentication
    Email AI-CRM Tutorial
    Api Integration
    Web3 Integration
    White Label
    Real World

    Integrations

    Ethereum wallets (Wagmi v3)

    Quick entry (CTOs · auditors · agents)

    Library hub
    Welcome — mission & audiences
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP
    Deploy (Docker · k8s)
    Security & compliance reads

    Commissions & Settlements

    settlement.ts calculates platform commission, optional referral commission (when referralCode is present on the order), and custom splits from merchant configuration.

    Unified ledger flow

    Paid store orders (WayForPay webhook or credit rail) call VendorSettlementService.processSettlements, which delegates to recordSettlementsForPaidOrder in settlement-pipeline.ts. That invokes createSettlement per vendor slice and writes the canonical settlements table.

    CollectionRole
    settlementsCommission/payout ledger — admin Commissions tab, vendor Earnings, processDueSettlements
    vendor_settlementsLegacy processing log (no longer written on new paid orders)
    payout_batchesBatch runs from admin Process due payouts
    erp_sales_assistsReferral-attributed sale rows when referralCode is on the order

    Stock movements from deductStockForOrder include referralCode and assisted when attribution is present.

    Settlement record

    Each payout creates a row in the settlements collection with vendorId, orderId, commission, netPayout, status, and scheduledFor.

    Admin commissions tab

    /admin/store/commissions lists settlements and exposes Process due payouts (processDueSettlements) for settlements where scheduledFor <= now and status = pending.

    Referral commission hierarchy

    resolveReferralCommissionPercent in features/store/lib/referral-commission.ts is shared by ERP settlement and refcodes token rewards:

    PrioritySourceField
    1Product overrideproduct.referralCommission or product.commissionStructure.referralCommission
    2Merchant configmerchantConfig.commissionStructure.referralCommission
    3Platform constantDEFAULT_COMMISSION_STRUCTURE.referralCommission (5%)
    4Clone env fallbackREFERRAL_REWARD_PERCENT

    Mixed-rate carts use a subtotal-weighted effective percent. Vendors may set per-product overrides in the product editor; merchant-level rates are admin-managed (read-only on /vendor/settings). Admin Commissions tab lists effective rates per product with source tier.

    Optional env: REFERRAL_COMMISSION_MAX_PERCENT (default 50) clamps all resolved values.

    Payout currencies and modes

    RING, DAAR, and DAARION payouts route through merchant walletId.

    SETTLEMENT_PAYOUT_MODEBehavior
    simulated (default)Completes with metadata.simulated: true and sim_ transaction id — admin Commissions and vendor Earnings show a Simulated badge
    onchainERC20 transfer via treasury wallet (SETTLEMENT_PAYOUT_PRIVATE_KEY, SETTLEMENT_PAYOUT_TOKEN_ADDRESS, POLYGON_RPC_URL)

    Use simulated until WayForPay/RING payout rails are production-verified.

    Database

    Migration 007_settlements_schema.sql creates settlements, payout_batches, merchant_configs, vendor_settlements, stock_movements, erp_sales_assists.

    bash
    
    # Dev (005 refcodes + 007 ERP)
    ./scripts/apply-erp-migrations-dev.sh
    
    # Prod (k8s jump host)
    K8S_NAMESPACE=ring-platform-org POSTGRES_DB=ring_platform POSTGRES_USER=ring_user \
      ./scripts/apply-erp-migrations-prod.sh

    Apply 005_refcodes_schema.sql first on clones that lack refcodes tables.

    Related

    • Referral codes — shared commission hierarchy and token rewards
    • Vendor management
    • Inventory

    Commissions & Settlements

    settlement.ts calculates platform commission, optional referral commission (when referralCode is present on the order), and custom splits from merchant configuration.

    Unified ledger flow

    Paid store orders (WayForPay webhook or credit rail) call VendorSettlementService.processSettlements, which delegates to recordSettlementsForPaidOrder in settlement-pipeline.ts. That invokes createSettlement per vendor slice and writes the canonical settlements table.

    CollectionRole
    settlementsCommission/payout ledger — admin Commissions tab, vendor Earnings, processDueSettlements
    vendor_settlementsLegacy processing log (no longer written on new paid orders)
    payout_batchesBatch runs from admin Process due payouts
    erp_sales_assistsReferral-attributed sale rows when referralCode is on the order

    Stock movements from deductStockForOrder include referralCode and assisted when attribution is present.

    Settlement record

    Each payout creates a row in the settlements collection with vendorId, orderId, commission, netPayout, status, and scheduledFor.

    Admin commissions tab

    /admin/store/commissions lists settlements and exposes Process due payouts (processDueSettlements) for settlements where scheduledFor <= now and status = pending.

    Referral commission hierarchy

    resolveReferralCommissionPercent in features/store/lib/referral-commission.ts is shared by ERP settlement and refcodes token rewards:

    PrioritySourceField
    1Product overrideproduct.referralCommission or product.commissionStructure.referralCommission
    2Merchant configmerchantConfig.commissionStructure.referralCommission
    3Platform constantDEFAULT_COMMISSION_STRUCTURE.referralCommission (5%)
    4Clone env fallbackREFERRAL_REWARD_PERCENT

    Mixed-rate carts use a subtotal-weighted effective percent. Vendors may set per-product overrides in the product editor; merchant-level rates are admin-managed (read-only on /vendor/settings). Admin Commissions tab lists effective rates per product with source tier.

    Optional env: REFERRAL_COMMISSION_MAX_PERCENT (default 50) clamps all resolved values.

    Payout currencies and modes

    RING, DAAR, and DAARION payouts route through merchant walletId.

    SETTLEMENT_PAYOUT_MODEBehavior
    simulated (default)Completes with metadata.simulated: true and sim_ transaction id — admin Commissions and vendor Earnings show a Simulated badge
    onchainERC20 transfer via treasury wallet (SETTLEMENT_PAYOUT_PRIVATE_KEY, SETTLEMENT_PAYOUT_TOKEN_ADDRESS, POLYGON_RPC_URL)

    Use simulated until WayForPay/RING payout rails are production-verified.

    Database

    Migration 007_settlements_schema.sql creates settlements, payout_batches, merchant_configs, vendor_settlements, stock_movements, erp_sales_assists.

    bash
    
    # Dev (005 refcodes + 007 ERP)
    ./scripts/apply-erp-migrations-dev.sh
    
    # Prod (k8s jump host)
    K8S_NAMESPACE=ring-platform-org POSTGRES_DB=ring_platform POSTGRES_USER=ring_user \
      ./scripts/apply-erp-migrations-prod.sh

    Apply 005_refcodes_schema.sql first on clones that lack refcodes tables.

    Related

    • Referral codes — shared commission hierarchy and token rewards
    • Vendor management
    • Inventory

    Commissions & Settlements

    settlement.ts calculates platform commission, optional referral commission (when referralCode is present on the order), and custom splits from merchant configuration.

    Unified ledger flow

    Paid store orders (WayForPay webhook or credit rail) call VendorSettlementService.processSettlements, which delegates to recordSettlementsForPaidOrder in settlement-pipeline.ts. That invokes createSettlement per vendor slice and writes the canonical settlements table.

    CollectionRole
    settlementsCommission/payout ledger — admin Commissions tab, vendor Earnings, processDueSettlements
    vendor_settlementsLegacy processing log (no longer written on new paid orders)
    payout_batchesBatch runs from admin Process due payouts
    erp_sales_assistsReferral-attributed sale rows when referralCode is on the order

    Stock movements from deductStockForOrder include referralCode and assisted when attribution is present.

    Settlement record

    Each payout creates a row in the settlements collection with vendorId, orderId, commission, netPayout, status, and scheduledFor.

    Admin commissions tab

    /admin/store/commissions lists settlements and exposes Process due payouts (processDueSettlements) for settlements where scheduledFor <= now and status = pending.

    Referral commission hierarchy

    resolveReferralCommissionPercent in features/store/lib/referral-commission.ts is shared by ERP settlement and refcodes token rewards:

    PrioritySourceField
    1Product overrideproduct.referralCommission or product.commissionStructure.referralCommission
    2Merchant configmerchantConfig.commissionStructure.referralCommission
    3Platform constantDEFAULT_COMMISSION_STRUCTURE.referralCommission (5%)
    4Clone env fallbackREFERRAL_REWARD_PERCENT

    Mixed-rate carts use a subtotal-weighted effective percent. Vendors may set per-product overrides in the product editor; merchant-level rates are admin-managed (read-only on /vendor/settings). Admin Commissions tab lists effective rates per product with source tier.

    Optional env: REFERRAL_COMMISSION_MAX_PERCENT (default 50) clamps all resolved values.

    Payout currencies and modes

    RING, DAAR, and DAARION payouts route through merchant walletId.

    SETTLEMENT_PAYOUT_MODEBehavior
    simulated (default)Completes with metadata.simulated: true and sim_ transaction id — admin Commissions and vendor Earnings show a Simulated badge
    onchainERC20 transfer via treasury wallet (SETTLEMENT_PAYOUT_PRIVATE_KEY, SETTLEMENT_PAYOUT_TOKEN_ADDRESS, POLYGON_RPC_URL)

    Use simulated until WayForPay/RING payout rails are production-verified.

    Database

    Migration 007_settlements_schema.sql creates settlements, payout_batches, merchant_configs, vendor_settlements, stock_movements, erp_sales_assists.

    bash
    
    # Dev (005 refcodes + 007 ERP)
    ./scripts/apply-erp-migrations-dev.sh
    
    # Prod (k8s jump host)
    K8S_NAMESPACE=ring-platform-org POSTGRES_DB=ring_platform POSTGRES_USER=ring_user \
      ./scripts/apply-erp-migrations-prod.sh

    Apply 005_refcodes_schema.sql first on clones that lack refcodes tables.

    Related

    • Referral codes — shared commission hierarchy and token rewards
    • Vendor management
    • Inventory
    Vendor Management
    Commissions & Settlements
    Referral Codes (Refcodes)
    Payment Integration
    PaymentConductor
    WayForPay Payment Integration
    News Module - Digital Newspaper Experience
    Member Blogs
    Scientific Editor
    Locale System
    Security & Compliance
    NFT Marketplace
    Token Staking System
    Performance Optimization Patterns
    Mobile Experience
    Admin API
    Whitelabel Navigation
    Best Practices
    Workflow
    Code Style
    Performance
    Testing
    Deployment
    Debugging
    Contributing
    Api Examples
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)
    Proxy and internationalization
    Real Time
    Security
    Multi-Vendor Store
    Ring ERP
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    Referral Codes (Refcodes)
    Payment Integration
    PaymentConductor
    WayForPay Payment Integration
    News Module - Digital Newspaper Experience
    Member Blogs
    Scientific Editor
    Locale System
    Security & Compliance
    NFT Marketplace
    Token Staking System
    Performance Optimization Patterns
    Mobile Experience
    Admin API
    Whitelabel Navigation
    Best Practices
    Workflow
    Code Style
    Performance
    Testing
    Deployment
    Debugging
    Contributing
    Api Examples
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)
    Proxy and internationalization
    Real Time
    Security
    Multi-Vendor Store
    Ring ERP
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    Referral Codes (Refcodes)
    Payment Integration
    PaymentConductor
    WayForPay Payment Integration
    News Module - Digital Newspaper Experience
    Member Blogs
    Scientific Editor
    Locale System
    Security & Compliance
    NFT Marketplace
    Token Staking System
    Performance Optimization Patterns
    Mobile Experience
    Admin API
    Whitelabel Navigation
    Best Practices
    Workflow
    Code Style
    Performance
    Testing
    Deployment
    Debugging
    Contributing
    Api Examples
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)
    Back
    Back
    Back