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
    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
    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
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    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
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    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
    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
    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
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    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
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    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
    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
    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
    Branding
    Themes
    Features
    Localization
    Token Economics Setup
    Payment Gateway Integration
    Reference Ring deployments
    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
    Docker
    Environment Configuration
    Monitoring & Analytics
    Performance Optimization
    Backup & Recovery
    Architecture
    Data Model
    Security
    Real Time
    Discovery Mutation Sync
    PaymentConductor architecture
    WalletConductor architecture
    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)
    1. Docs
    2. /API
    3. /Store API

    Updated Jul 9, 20265 min listen

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

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

    Updated Jul 9, 20265 min listen

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

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

    Updated Jul 9, 20265 min listen

    Ring Platform Logo

    Завантаження документації...

    Підготовка контенту платформи Ring

    Store API

    Use Founder / Developer tabs in the docs sidebar to filter this page. Legacy copy invented cart REST, vendor apply endpoints, PUT product/order status routes, and Solidity RING payment contracts — none live under app/api/store/. Below matches the verified route tree as of v1.6.4.

    Ring’s multi-vendor store exposes a small HTTP surface: catalog + reviews + product agent chat, orders / checkout, and payments routed through PaymentConductor with purpose store_order (ledger SSOT in payment_transactions). The shopping cart is not a server API — the browser keeps it in localStorage key ring_cart (features/store/context.tsx).

    ConcernWhere it lives
    CartClient ring_cart — no /api/store/cart
    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/)

    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')

    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 internal_credit rail.

    Refcodes

    Store API

    Use Founder / Developer tabs in the docs sidebar to filter this page. Legacy copy invented cart REST, vendor apply endpoints, PUT product/order status routes, and Solidity RING payment contracts — none live under app/api/store/. Below matches the verified route tree as of v1.6.4.

    Ring’s multi-vendor store exposes a small HTTP surface: catalog + reviews + product agent chat, orders / checkout, and payments routed through PaymentConductor with purpose store_order (ledger SSOT in payment_transactions). The shopping cart is not a server API — the browser keeps it in localStorage key ring_cart (features/store/context.tsx).

    ConcernWhere it lives
    CartClient ring_cart — no /api/store/cart
    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/)

    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')

    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 internal_credit rail.

    Refcodes

    Store API

    Use Founder / Developer tabs in the docs sidebar to filter this page. Legacy copy invented cart REST, vendor apply endpoints, PUT product/order status routes, and Solidity RING payment contracts — none live under app/api/store/. Below matches the verified route tree as of v1.6.4.

    Ring’s multi-vendor store exposes a small HTTP surface: catalog + reviews + product agent chat, orders / checkout, and payments routed through PaymentConductor with purpose store_order (ledger SSOT in payment_transactions). The shopping cart is not a server API — the browser keeps it in localStorage key ring_cart (features/store/context.tsx).

    ConcernWhere it lives
    CartClient ring_cart — no /api/store/cart
    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/)

    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')

    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 internal_credit 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 — client only (ring_cart); survives refresh in that browser.
    3. Address — store address actions / checkout UI (not a cart REST resource).
    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_ACCEPT_ORDER_CURRENCY=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.

    GET, POST
    /api/store/products/[id]/reviews
    GET public; POST session
    Zod 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 internal_credit; may reject UAH unless PAYMENT_CREDIT_ACCEPT_ORDER_CURRENCY 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/cart, /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: 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).

    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_ACCEPT_ORDER_CURRENCYe.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.tsxClient cart ring_cart
    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 — client only (ring_cart); survives refresh in that browser.
    3. Address — store address actions / checkout UI (not a cart REST resource).
    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_ACCEPT_ORDER_CURRENCY=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.

    GET, POST
    /api/store/products/[id]/reviews
    GET public; POST session
    Zod 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 internal_credit; may reject UAH unless PAYMENT_CREDIT_ACCEPT_ORDER_CURRENCY 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/cart, /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: 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).

    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_ACCEPT_ORDER_CURRENCYe.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.tsxClient cart ring_cart
    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 — client only (ring_cart); survives refresh in that browser.
    3. Address — store address actions / checkout UI (not a cart REST resource).
    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_ACCEPT_ORDER_CURRENCY=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.

    GET, POST
    /api/store/products/[id]/reviews
    GET public; POST session
    Zod 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 internal_credit; may reject UAH unless PAYMENT_CREDIT_ACCEPT_ORDER_CURRENCY 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/cart, /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: 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).

    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_ACCEPT_ORDER_CURRENCYe.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.tsxClient cart ring_cart
    app/_actions/vendor-actions.ts, store-products.ts, store-address-actions.ts, store-erp.tsVendor/admin/address/ERP actions

    Referral cookie on POST orders.