OpportunitiesEntities
Docs
    Ring Platform

    Decentralized Self-building Future

    Sign In
    Entities
    Opportunities
    Store
    Docs
    Platform Concepts
    RING EconomySonoratek LLCGlobal ImpactAI Meets Web3
    Get Started
    Quick StartCalculatorRoadmap
    Privacy|Contact
    v1.104.17|Sonoratek LLC

    Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    SubscriptionConductor
    PaymentConductor
    Ring Oracle
    Payments Overview
    Public Pools & DAO Jars
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    Peer Games
    News Module
    Member Blogs
    Public Profile Pages
    Profile Account Widgets
    Ring File Cabinet
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Vertical Presets (SSOT)
    Ringization playbook
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Project configuration
    Public environment variables
    Order Lab secrets
    WalletConnect Project ID (Reown Cloud)
    Supported services
    NODUS wiki (project knowledge)
    Configuration playbook
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel Deployment
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Backend Services
    Firebase Integration
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)

    Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    SubscriptionConductor
    PaymentConductor
    Ring Oracle
    Payments Overview
    Public Pools & DAO Jars
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    Peer Games
    News Module
    Member Blogs
    Public Profile Pages
    Profile Account Widgets
    Ring File Cabinet
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Vertical Presets (SSOT)
    Ringization playbook
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Project configuration
    Public environment variables
    Order Lab secrets
    WalletConnect Project ID (Reown Cloud)
    Supported services
    NODUS wiki (project knowledge)
    Configuration playbook
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel Deployment
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Backend Services
    Firebase Integration
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)

    Documentation

    Concepts, value, and typical clone scenarios — less code.

    Welcome to Ring
    Quick Reference
    Getting Started
    Prerequisites
    Installation
    First Success Validation
    Next Steps
    Features
    Multi-Vendor Store
    Inventory & Stock
    Vendor Management
    Commissions & Settlements
    SubscriptionConductor
    PaymentConductor
    Ring Oracle
    Payments Overview
    Public Pools & DAO Jars
    WayForPay Payment Integration
    Wallet & Credit System
    WalletConductor
    Affiliate & Referral Enablement
    Referral Codes (Refcodes)
    NFT Exhibition Marketplace
    Solana NFT Gates
    Token Staking System
    Owner Project Lab
    Entities
    Opportunities
    Real-Time Messaging
    Ring Tasks
    WebRTC Calls & STUNner TURN
    Peer Games
    News Module
    Member Blogs
    Public Profile Pages
    Profile Account Widgets
    Ring File Cabinet
    Username Reservation System
    Scientific Editor
    Notifications
    Push Notifications with FCM (Ring-Powered)
    Email AI-CRM
    Ring Mailer & RingdomX Mail
    Tunnel Protocol
    VideoConductor
    MediaConductor
    Generative Gallery
    Authentication
    Security & Compliance
    Admin console
    Admin Wiki
    Manage via Telegram
    Locale System
    Mobile Experience
    Performance Optimization Patterns
    Examples
    Quick Start
    Basic Setup
    White Label
    Custom Branding
    Web3 Integration
    Real World
    Advanced Features
    Customization
    Quick Start — Your First Ring Clone
    Customization Guide
    Vertical Presets (SSOT)
    Ringization playbook
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    Project configuration
    Public environment variables
    Order Lab secrets
    WalletConnect Project ID (Reown Cloud)
    Supported services
    NODUS wiki (project knowledge)
    Configuration playbook
    Web3
    Token launch jurisdictions
    Wallet
    Wallet Security Tips
    Integrations
    Ethereum wallets (Wagmi v3)
    RingFileBase (object storage API)
    Ring CDN (RingFileBase edge)
    Deployment
    Self-hosted deployment
    Vercel Deployment
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    Backend Services
    Firebase Integration
    Development
    Ring MCP Server

    Quick entry (CTOs · auditors · agents)

    Welcome — mission & audiences
    Quick Reference
    Getting started
    Architecture & Auth.js
    Backend modes & databases (DB_BACKEND_MODE)
    Self-hosted
    Ring MCP Tools
    Ring MCP Server
    Token economics
    Token launch jurisdictions
    Deploy (Docker · k8s)
    Security & compliance reads
    ringdom.org — LegioX homebase
    Source — MIT license (GitHub)
    Ring Logo

    Loading documentation...

    Preparing Ring content

    Ring Logo

    Loading documentation...

    Preparing Ring content

    Ring Logo

    Loading documentation...

    Preparing Ring content

    Store API

    Use Founder / Developer tabs in the docs sidebar to filter this page. Legacy copy invented vendor apply endpoints, PUT product/order status routes, and Solidity RING payment contracts — those are not under app/api/store/. Cart truth: guests use localStorage ring_cart; authenticated buyers also mirror via GET/POST /api/store/cart (+ optional soft-hold).

    Ring’s multi-vendor store exposes: catalog + reviews + product agent chat, guest cart + session cart mirror, orders / checkout, and payments via PaymentConductor purpose store_order (ledger SSOT in payment_transactions).

    ConcernWhere it lives
    Guest cartClient ring_cart (features/store/context.tsx)
    Auth cart mirrorGET/POST /api/store/cart — binds session.user.id only; ignores body userId
    Soft-holdPOST /api/store/cart/hold — inventory soft-hold while cart has lines (may 409)
    Catalog / create productGET/POST /api/store/products
    Place orderPOST /api/store/orders or POST /api/store/checkout (same orders pipeline)
    PayPOST /api/store/payments/wayforpay or …/credit → PaymentConductor
    Vendor onboarding/vendor/start + server actions — not REST under /api/store/vendors

    Why this API matters for your clone

    Buyers browse the catalog, build a cart in the browser, confirm address, create an order, then pay by card (WayForPay) or internal credit when you enable it. Vendors list products after approval; commissions and settlements run after payment — not at “add to cart.”

    Store feature

    Multi-vendor catalog, checkout UX, vendor desk, ERP inventory.

    PaymentConductor

    store_order purpose, rails, webhook dispatch, ledger SSOT.

    Payment integration

    WayForPay env, credit gates, clone processor overrides.

    Wallet API

    End-to-end payment path

    Store checkout (verified)

    Route inventory (verified under app/api/store/)

    Cart (session mirror)

    MethodPathAuthNotes
    GET/api/store/cartSessionReturns { items: [{ id, qty }], updatedAt } for session.user.id
    POST/api/store/cartSessionBody { items: [{ productId|id, qty }] }; ignores client userId/uid; may 409 on insufficient stock

    Related documentation

    Store feature

    Product pages, vendor desk, ERP surfaces.

    PaymentConductor

    Purposes, rails, webhook dispatcher.

    Admin API — store orders

    Admin order status transitions.

    Wallet API

    Credit balance for credit_balance rail.

    Refcodes

    Store API

    Use Founder / Developer tabs in the docs sidebar to filter this page. Legacy copy invented vendor apply endpoints, PUT product/order status routes, and Solidity RING payment contracts — those are not under app/api/store/. Cart truth: guests use localStorage ring_cart; authenticated buyers also mirror via GET/POST /api/store/cart (+ optional soft-hold).

    Ring’s multi-vendor store exposes: catalog + reviews + product agent chat, guest cart + session cart mirror, orders / checkout, and payments via PaymentConductor purpose store_order (ledger SSOT in payment_transactions).

    ConcernWhere it lives
    Guest cartClient ring_cart (features/store/context.tsx)
    Auth cart mirrorGET/POST /api/store/cart — binds session.user.id only; ignores body userId
    Soft-holdPOST /api/store/cart/hold — inventory soft-hold while cart has lines (may 409)
    Catalog / create productGET/POST /api/store/products
    Place orderPOST /api/store/orders or POST /api/store/checkout (same orders pipeline)
    PayPOST /api/store/payments/wayforpay or …/credit → PaymentConductor
    Vendor onboarding/vendor/start + server actions — not REST under /api/store/vendors

    Why this API matters for your clone

    Buyers browse the catalog, build a cart in the browser, confirm address, create an order, then pay by card (WayForPay) or internal credit when you enable it. Vendors list products after approval; commissions and settlements run after payment — not at “add to cart.”

    Store feature

    Multi-vendor catalog, checkout UX, vendor desk, ERP inventory.

    PaymentConductor

    store_order purpose, rails, webhook dispatch, ledger SSOT.

    Payment integration

    WayForPay env, credit gates, clone processor overrides.

    Wallet API

    End-to-end payment path

    Store checkout (verified)

    Route inventory (verified under app/api/store/)

    Cart (session mirror)

    MethodPathAuthNotes
    GET/api/store/cartSessionReturns { items: [{ id, qty }], updatedAt } for session.user.id
    POST/api/store/cartSessionBody { items: [{ productId|id, qty }] }; ignores client userId/uid; may 409 on insufficient stock

    Related documentation

    Store feature

    Product pages, vendor desk, ERP surfaces.

    PaymentConductor

    Purposes, rails, webhook dispatcher.

    Admin API — store orders

    Admin order status transitions.

    Wallet API

    Credit balance for credit_balance rail.

    Refcodes

    Store API

    Use Founder / Developer tabs in the docs sidebar to filter this page. Legacy copy invented vendor apply endpoints, PUT product/order status routes, and Solidity RING payment contracts — those are not under app/api/store/. Cart truth: guests use localStorage ring_cart; authenticated buyers also mirror via GET/POST /api/store/cart (+ optional soft-hold).

    Ring’s multi-vendor store exposes: catalog + reviews + product agent chat, guest cart + session cart mirror, orders / checkout, and payments via PaymentConductor purpose store_order (ledger SSOT in payment_transactions).

    ConcernWhere it lives
    Guest cartClient ring_cart (features/store/context.tsx)
    Auth cart mirrorGET/POST /api/store/cart — binds session.user.id only; ignores body userId
    Soft-holdPOST /api/store/cart/hold — inventory soft-hold while cart has lines (may 409)
    Catalog / create productGET/POST /api/store/products
    Place orderPOST /api/store/orders or POST /api/store/checkout (same orders pipeline)
    PayPOST /api/store/payments/wayforpay or …/credit → PaymentConductor
    Vendor onboarding/vendor/start + server actions — not REST under /api/store/vendors

    Why this API matters for your clone

    Buyers browse the catalog, build a cart in the browser, confirm address, create an order, then pay by card (WayForPay) or internal credit when you enable it. Vendors list products after approval; commissions and settlements run after payment — not at “add to cart.”

    Store feature

    Multi-vendor catalog, checkout UX, vendor desk, ERP inventory.

    PaymentConductor

    store_order purpose, rails, webhook dispatch, ledger SSOT.

    Payment integration

    WayForPay env, credit gates, clone processor overrides.

    Wallet API

    End-to-end payment path

    Store checkout (verified)

    Route inventory (verified under app/api/store/)

    Cart (session mirror)

    MethodPathAuthNotes
    GET/api/store/cartSessionReturns { items: [{ id, qty }], updatedAt } for session.user.id
    POST/api/store/cartSessionBody { items: [{ productId|id, qty }] }; ignores client userId/uid; may 409 on insufficient stock

    Related documentation

    Store feature

    Product pages, vendor desk, ERP surfaces.

    PaymentConductor

    Purposes, rails, webhook dispatcher.

    Admin API — store orders

    Admin order status transitions.

    Wallet API

    Credit balance for credit_balance rail.

    Refcodes

    Internal credit balance used by store credit checkout.

    Typical buyer flow

    1. Browse — public GET /api/store/products (filters: search, categories, price, stock, sort).
    2. Cart — guest: ring_cart in the browser. Signed-in: hydrate/sync via GET/POST /api/store/cart (server wins on hydrate).
    3. Address — store address actions / checkout UI.
    4. Create order — authenticated POST /api/store/orders (or /checkout); stock hold may return 409 if inventory fails.
    5. Pay — WayForPay redirect or credit rail; webhook / conductor marks paid and runs vendor settlement.

    Operator notes

    • Vendor approval — product create returns 403 until the vendor is approved; onboarding is /vendor/start, not /api/store/vendors/apply.
    • Commissions / settlements — after successful payment (VendorSettlementService); configure trust tiers and store payment env, not fake on-chain RING contracts on this page.
    • Credit vs card — credit for UAH carts needs PAYMENT_CREDIT_BALANCE_ACCEPTED_ORDER_CURRENCIES=UAH (or your accepted list); otherwise buyers use card.

    Prefer the store UI and vendor/admin actions for day-to-day ops. Call these routes when automating checkout or integrating a custom storefront against the same order + PaymentConductor pipeline.

    POST/api/store/cart/holdSessionSoft-hold inventory for current cart lines

    Catalog & product extras

    MethodPathAuthNotes
    GET/api/store/productsPublicFilters: search, categories, priceMin, priceMax, inStock, sortBy, currency, limit, afterId
    POST/api/store/productsSession; vendor approved or platform adminCreates product; updateTag('store:products')
    GET, POST/api/store/products/[id]/reviewsGET public; POST sessionZod rating/content; verified-purchase when order history matches
    GET, POST/api/store/products/[id]/agent-chatSessionProduct agent conversation; POST may SSE-stream
    GET/api/store/price-rangePublicMin/max for catalog filters (excludes price slider)

    Orders & checkout

    MethodPathAuthNotes
    GET/api/store/ordersSessionUser’s orders; limit, afterId
    POST/api/store/ordersSessionZod orderCreateSchema; referral cookie; reserveInventoryForOrder → 409 + cancel on stock fail
    GET/api/store/orders/[id]Session (owner)Order by id
    POST/api/store/checkoutSessionCanonical checkout → same StoreOrdersService / orders pipeline as POST orders (not legacy store_orders)

    Payments

    MethodPathAuthNotes
    POST/api/store/payments/wayforpaySession (order owner)PaymentConductor.createCheckout({ purpose: 'store_order', rail: 'merchant_redirect' })
    POST/api/store/payments/creditSession (order owner)Rail credit_balance; may reject UAH unless PAYMENT_CREDIT_BALANCE_ACCEPTED_ORDER_CURRENCIES allows it
    GET/api/store/payments/[orderId]/statusSession (owner or admin)Poll status / WayForPay when initiated
    POST/api/store/payments/wayforpay/webhookGatewayDeprecated alias — prefer /api/payments/wayforpay/webhook

    Not live as store REST: /api/store/vendors, /api/store/vendors/apply, PUT product or order-status under /api/store/*. Vendor MCP lives under app/api/mcp/v1/store/vendors/*. Order status advances via admin/store services and actions.

    Auth

    • Session required for: cart mirror (/api/store/cart, /hold), product create, orders list/create, checkout, payments, agent-chat, review create, payment status.
    • Public: product list, reviews GET, price-range.
    • Same-origin Auth.js cookies (auth() in route handlers). Guests keep ring_cart until sign-in hydrates the server mirror.

    Card vs credit checkout

    1. 1

      Create the order (POST /api/store/orders or /checkout) and keep orderId.

    2. 2

      Call WayForPay initiation — body { orderId, returnUrl?, locale? } (UK | EN | RU).

    3. 3

      Redirect the buyer to paymentUrl. Canonical webhook: POST /api/payments/wayforpay/webhook (store alias only for legacy merchants).

    Env (store payments)

    VariableRole
    PAYMENT_STORE_PROCESSOROptional override for store_order processor (else default)
    PAYMENT_STORE_ALLOW_CREDITCredit rail for store (default allow unless false)
    PAYMENT_STORE_ALLOW_TOKENOpt-in token rail (=== 'true' in payment.config)
    PAYMENT_CREDIT_BALANCE_ACCEPTED_ORDER_CURRENCIESe.g. UAH to allow credit on UAH carts
    WAYFORPAY_MERCHANT_ACCOUNT / WAYFORPAY_SECRET_KEY / WAYFORPAY_DOMAINWayForPay SSOT (no MERCHANT_ID)
    WAYFORPAY_STORE_*Optional store-specific overrides of the above

    Module map

    PathRole
    lib/payments/conductor/payment-conductor.tscreateCheckout entry
    lib/payments/processors/wayforpay.processor.tsstore_order merchant redirect
    lib/payments/conductor/handlers/store-order.tsWebhook / paid handler
    features/store/services/orders-service.tsOrder CRUD / payment status
    features/store/services/inventory-sync.tsreserveInventoryForOrder
    features/store/services/vendor-settlement.tsPost-pay settlements
    features/store/context.tsxGuest cart ring_cart + hydrate against /api/store/cart when signed in
    features/store/services/server-cart.tsSession cart mirror used by /api/store/cart
    app/api/store/cart/route.ts, …/hold/route.tsAuth cart GET/POST + soft-hold
    app/_actions/vendor-actions.ts, store-products.ts, store-address-actions.ts, store-erp.tsVendor/admin/address/ERP actions

    Referral cookie on POST orders.

    Internal credit balance used by store credit checkout.

    Typical buyer flow

    1. Browse — public GET /api/store/products (filters: search, categories, price, stock, sort).
    2. Cart — guest: ring_cart in the browser. Signed-in: hydrate/sync via GET/POST /api/store/cart (server wins on hydrate).
    3. Address — store address actions / checkout UI.
    4. Create order — authenticated POST /api/store/orders (or /checkout); stock hold may return 409 if inventory fails.
    5. Pay — WayForPay redirect or credit rail; webhook / conductor marks paid and runs vendor settlement.

    Operator notes

    • Vendor approval — product create returns 403 until the vendor is approved; onboarding is /vendor/start, not /api/store/vendors/apply.
    • Commissions / settlements — after successful payment (VendorSettlementService); configure trust tiers and store payment env, not fake on-chain RING contracts on this page.
    • Credit vs card — credit for UAH carts needs PAYMENT_CREDIT_BALANCE_ACCEPTED_ORDER_CURRENCIES=UAH (or your accepted list); otherwise buyers use card.

    Prefer the store UI and vendor/admin actions for day-to-day ops. Call these routes when automating checkout or integrating a custom storefront against the same order + PaymentConductor pipeline.

    POST/api/store/cart/holdSessionSoft-hold inventory for current cart lines

    Catalog & product extras

    MethodPathAuthNotes
    GET/api/store/productsPublicFilters: search, categories, priceMin, priceMax, inStock, sortBy, currency, limit, afterId
    POST/api/store/productsSession; vendor approved or platform adminCreates product; updateTag('store:products')
    GET, POST/api/store/products/[id]/reviewsGET public; POST sessionZod rating/content; verified-purchase when order history matches
    GET, POST/api/store/products/[id]/agent-chatSessionProduct agent conversation; POST may SSE-stream
    GET/api/store/price-rangePublicMin/max for catalog filters (excludes price slider)

    Orders & checkout

    MethodPathAuthNotes
    GET/api/store/ordersSessionUser’s orders; limit, afterId
    POST/api/store/ordersSessionZod orderCreateSchema; referral cookie; reserveInventoryForOrder → 409 + cancel on stock fail
    GET/api/store/orders/[id]Session (owner)Order by id
    POST/api/store/checkoutSessionCanonical checkout → same StoreOrdersService / orders pipeline as POST orders (not legacy store_orders)

    Payments

    MethodPathAuthNotes
    POST/api/store/payments/wayforpaySession (order owner)PaymentConductor.createCheckout({ purpose: 'store_order', rail: 'merchant_redirect' })
    POST/api/store/payments/creditSession (order owner)Rail credit_balance; may reject UAH unless PAYMENT_CREDIT_BALANCE_ACCEPTED_ORDER_CURRENCIES allows it
    GET/api/store/payments/[orderId]/statusSession (owner or admin)Poll status / WayForPay when initiated
    POST/api/store/payments/wayforpay/webhookGatewayDeprecated alias — prefer /api/payments/wayforpay/webhook

    Not live as store REST: /api/store/vendors, /api/store/vendors/apply, PUT product or order-status under /api/store/*. Vendor MCP lives under app/api/mcp/v1/store/vendors/*. Order status advances via admin/store services and actions.

    Auth

    • Session required for: cart mirror (/api/store/cart, /hold), product create, orders list/create, checkout, payments, agent-chat, review create, payment status.
    • Public: product list, reviews GET, price-range.
    • Same-origin Auth.js cookies (auth() in route handlers). Guests keep ring_cart until sign-in hydrates the server mirror.

    Card vs credit checkout

    1. 1

      Create the order (POST /api/store/orders or /checkout) and keep orderId.

    2. 2

      Call WayForPay initiation — body { orderId, returnUrl?, locale? } (UK | EN | RU).

    3. 3

      Redirect the buyer to paymentUrl. Canonical webhook: POST /api/payments/wayforpay/webhook (store alias only for legacy merchants).

    Env (store payments)

    VariableRole
    PAYMENT_STORE_PROCESSOROptional override for store_order processor (else default)
    PAYMENT_STORE_ALLOW_CREDITCredit rail for store (default allow unless false)
    PAYMENT_STORE_ALLOW_TOKENOpt-in token rail (=== 'true' in payment.config)
    PAYMENT_CREDIT_BALANCE_ACCEPTED_ORDER_CURRENCIESe.g. UAH to allow credit on UAH carts
    WAYFORPAY_MERCHANT_ACCOUNT / WAYFORPAY_SECRET_KEY / WAYFORPAY_DOMAINWayForPay SSOT (no MERCHANT_ID)
    WAYFORPAY_STORE_*Optional store-specific overrides of the above

    Module map

    PathRole
    lib/payments/conductor/payment-conductor.tscreateCheckout entry
    lib/payments/processors/wayforpay.processor.tsstore_order merchant redirect
    lib/payments/conductor/handlers/store-order.tsWebhook / paid handler
    features/store/services/orders-service.tsOrder CRUD / payment status
    features/store/services/inventory-sync.tsreserveInventoryForOrder
    features/store/services/vendor-settlement.tsPost-pay settlements
    features/store/context.tsxGuest cart ring_cart + hydrate against /api/store/cart when signed in
    features/store/services/server-cart.tsSession cart mirror used by /api/store/cart
    app/api/store/cart/route.ts, …/hold/route.tsAuth cart GET/POST + soft-hold
    app/_actions/vendor-actions.ts, store-products.ts, store-address-actions.ts, store-erp.tsVendor/admin/address/ERP actions

    Referral cookie on POST orders.

    Internal credit balance used by store credit checkout.

    Typical buyer flow

    1. Browse — public GET /api/store/products (filters: search, categories, price, stock, sort).
    2. Cart — guest: ring_cart in the browser. Signed-in: hydrate/sync via GET/POST /api/store/cart (server wins on hydrate).
    3. Address — store address actions / checkout UI.
    4. Create order — authenticated POST /api/store/orders (or /checkout); stock hold may return 409 if inventory fails.
    5. Pay — WayForPay redirect or credit rail; webhook / conductor marks paid and runs vendor settlement.

    Operator notes

    • Vendor approval — product create returns 403 until the vendor is approved; onboarding is /vendor/start, not /api/store/vendors/apply.
    • Commissions / settlements — after successful payment (VendorSettlementService); configure trust tiers and store payment env, not fake on-chain RING contracts on this page.
    • Credit vs card — credit for UAH carts needs PAYMENT_CREDIT_BALANCE_ACCEPTED_ORDER_CURRENCIES=UAH (or your accepted list); otherwise buyers use card.

    Prefer the store UI and vendor/admin actions for day-to-day ops. Call these routes when automating checkout or integrating a custom storefront against the same order + PaymentConductor pipeline.

    POST/api/store/cart/holdSessionSoft-hold inventory for current cart lines

    Catalog & product extras

    MethodPathAuthNotes
    GET/api/store/productsPublicFilters: search, categories, priceMin, priceMax, inStock, sortBy, currency, limit, afterId
    POST/api/store/productsSession; vendor approved or platform adminCreates product; updateTag('store:products')
    GET, POST/api/store/products/[id]/reviewsGET public; POST sessionZod rating/content; verified-purchase when order history matches
    GET, POST/api/store/products/[id]/agent-chatSessionProduct agent conversation; POST may SSE-stream
    GET/api/store/price-rangePublicMin/max for catalog filters (excludes price slider)

    Orders & checkout

    MethodPathAuthNotes
    GET/api/store/ordersSessionUser’s orders; limit, afterId
    POST/api/store/ordersSessionZod orderCreateSchema; referral cookie; reserveInventoryForOrder → 409 + cancel on stock fail
    GET/api/store/orders/[id]Session (owner)Order by id
    POST/api/store/checkoutSessionCanonical checkout → same StoreOrdersService / orders pipeline as POST orders (not legacy store_orders)

    Payments

    MethodPathAuthNotes
    POST/api/store/payments/wayforpaySession (order owner)PaymentConductor.createCheckout({ purpose: 'store_order', rail: 'merchant_redirect' })
    POST/api/store/payments/creditSession (order owner)Rail credit_balance; may reject UAH unless PAYMENT_CREDIT_BALANCE_ACCEPTED_ORDER_CURRENCIES allows it
    GET/api/store/payments/[orderId]/statusSession (owner or admin)Poll status / WayForPay when initiated
    POST/api/store/payments/wayforpay/webhookGatewayDeprecated alias — prefer /api/payments/wayforpay/webhook

    Not live as store REST: /api/store/vendors, /api/store/vendors/apply, PUT product or order-status under /api/store/*. Vendor MCP lives under app/api/mcp/v1/store/vendors/*. Order status advances via admin/store services and actions.

    Auth

    • Session required for: cart mirror (/api/store/cart, /hold), product create, orders list/create, checkout, payments, agent-chat, review create, payment status.
    • Public: product list, reviews GET, price-range.
    • Same-origin Auth.js cookies (auth() in route handlers). Guests keep ring_cart until sign-in hydrates the server mirror.

    Card vs credit checkout

    1. 1

      Create the order (POST /api/store/orders or /checkout) and keep orderId.

    2. 2

      Call WayForPay initiation — body { orderId, returnUrl?, locale? } (UK | EN | RU).

    3. 3

      Redirect the buyer to paymentUrl. Canonical webhook: POST /api/payments/wayforpay/webhook (store alias only for legacy merchants).

    Env (store payments)

    VariableRole
    PAYMENT_STORE_PROCESSOROptional override for store_order processor (else default)
    PAYMENT_STORE_ALLOW_CREDITCredit rail for store (default allow unless false)
    PAYMENT_STORE_ALLOW_TOKENOpt-in token rail (=== 'true' in payment.config)
    PAYMENT_CREDIT_BALANCE_ACCEPTED_ORDER_CURRENCIESe.g. UAH to allow credit on UAH carts
    WAYFORPAY_MERCHANT_ACCOUNT / WAYFORPAY_SECRET_KEY / WAYFORPAY_DOMAINWayForPay SSOT (no MERCHANT_ID)
    WAYFORPAY_STORE_*Optional store-specific overrides of the above

    Module map

    PathRole
    lib/payments/conductor/payment-conductor.tscreateCheckout entry
    lib/payments/processors/wayforpay.processor.tsstore_order merchant redirect
    lib/payments/conductor/handlers/store-order.tsWebhook / paid handler
    features/store/services/orders-service.tsOrder CRUD / payment status
    features/store/services/inventory-sync.tsreserveInventoryForOrder
    features/store/services/vendor-settlement.tsPost-pay settlements
    features/store/context.tsxGuest cart ring_cart + hydrate against /api/store/cart when signed in
    features/store/services/server-cart.tsSession cart mirror used by /api/store/cart
    app/api/store/cart/route.ts, …/hold/route.tsAuth cart GET/POST + soft-hold
    app/_actions/vendor-actions.ts, store-products.ts, store-address-actions.ts, store-erp.tsVendor/admin/address/ERP actions

    Referral cookie on POST orders.

    1. Docs
    2. /API
    3. /Store API

    Updated Aug 12, 20266 min listen

    1. Docs
    2. /API
    3. /Store API

    Updated Aug 12, 20266 min listen

    1. Docs
    2. /API
    3. /Store API

    Updated Aug 12, 20266 min listen