Inspiration

Businesses often face a deceptively difficult question: What should we restock, when should we restock it, which supplier should we choose, and how should we pay for it without disrupting cash flow?

Inventory, sales trends, supplier lead times, procurement budgets, and payment workflows are often managed separately. This disconnect can lead to stockouts, excess inventory, delayed purchasing decisions, and limited visibility into business spending.

We wanted to bring these operations together through one intelligent platform.

Inspired by the potential of PayPal to simplify and secure digital business payments, we built StockWise Pay — an AI-powered inventory intelligence and procurement platform that connects smarter purchasing decisions with an integrated payment workflow.

What it does

StockWise Pay helps businesses move from reactive inventory management to more informed, data-driven procurement.

Its key capabilities include:

  • Inventory Intelligence: Tracks inventory levels, product movement, stock velocity, and estimated inventory runway.
  • Demand Forecasting: Uses historical sales patterns and SMA/EMA-based analysis to estimate future demand and identify replenishment requirements.
  • Stockout Risk Analysis: Evaluates available stock, demand, and supplier lead times to estimate stockout risk and recommend reorder quantities.
  • AI-Powered Recommendations: Uses Gemini and DeepSeek-powered intelligence to support procurement decisions, explain recommendations, and explore different purchasing scenarios.
  • Supplier Intelligence: Compares supplier pricing, reliability, lead times, minimum order quantities, and volume discounts.
  • Budget-Aware Procurement: Builds purchase plans with line-item budget limits, supplier selection, quantity adjustments, and over-budget protection.
  • Approval Workflows: Connects procurement planning with role-based approval processes for business stakeholders.
  • PayPal Integration: Uses PayPal Orders v2 and Smart Payment Buttons to demonstrate buyer-authorized procurement payments through PayPal Sandbox.
  • Payment Records: Maintains transaction details, payment statuses, PayPal order references, and capture information for improved financial visibility.
  • Role-Based Access: Provides distinct workflows for Approver, Buyer, and CFO personas.

The central idea is simple: connect inventory intelligence, supplier selection, procurement approvals, and payments into one continuous workflow.

How we built it

We developed StockWise Pay as a modular full-stack application with separate frontend, backend, intelligence, and database components.

Frontend

Built with Next.js, React, TypeScript, and Tailwind CSS.

The interface includes dashboards, inventory catalogs, supplier comparisons, procurement planning, AI recommendations, approval workflows, and payment history.

Backend

Built with Node.js, Express, and TypeScript.

The backend manages authentication, role-based authorization, API endpoints, procurement operations, business rules, and PayPal payment processing.

Database

We use PostgreSQL for persistent application data, including inventory, suppliers, procurement plans, approvals, and payment-related records.

Intelligence Layer

We developed dedicated inventory and supplier-intelligence modules.

The intelligence layer combines demand analysis, SMA/EMA forecasting, stockout-risk calculations, reorder recommendations, supplier comparisons, and budget-aware procurement logic. Gemini and DeepSeek support AI-assisted intelligence and decision explanations.

PayPal Integration

A major part of StockWise Pay is its integration with the PayPal Orders v2 API.

We implemented PayPal Smart Payment Buttons to connect the procurement payment workflow with PayPal checkout.

The demonstrated payment lifecycle is:

  1. A procurement plan is created and submitted for approval.
  2. An approved plan is selected for payment.
  3. The backend creates a PayPal order using the approved procurement details.
  4. The buyer authorizes the payment through PayPal checkout.
  5. The backend captures the authorized payment and records the transaction details.

We use PayPal Sandbox for testing and demonstration. No real money is charged.

Deployment

  • Frontend: Vercel
  • Backend: Railway
  • Database: PostgreSQL
  • Payments: PayPal Orders v2 Sandbox API

We focused on keeping sensitive payment credentials on the backend, separating frontend and backend responsibilities, and maintaining a structured application architecture.

Challenges we ran into

Building an integrated procurement platform involved several technical and architectural challenges.

  • Monorepo Build Configuration: Our intelligence and supplier-intelligence modules were located outside the backend directory. Configuring the Railway service root and TypeScript module resolution correctly required changes to the build and compilation setup.
  • Frontend–Backend Connectivity: Connecting the deployed Vercel frontend to the Railway backend initially caused cross-origin request failures. We diagnosed the issue through browser network logs and corrected the production CORS configuration.
  • PayPal Sandbox Integration: Connecting frontend Smart Payment Buttons with backend order creation and payment capture required careful coordination of the buyer authorization and server-side payment lifecycle.
  • Database Reliability: We needed to ensure that production data persisted correctly and that database connectivity problems were handled explicitly rather than silently falling back to temporary storage.
  • Procurement and Payment Coordination: Connecting inventory requirements, supplier selection, budget checks, approval states, and payment execution required consistent validation across multiple modules.
  • AI-Assisted Decision Making: We needed to combine calculated inventory insights with useful explanations while keeping procurement decisions understandable to business users.

These challenges taught us that a successful full-stack deployment requires more than compiling code. The application, database, external APIs, environment configuration, and payment lifecycle must work together reliably.

Accomplishments that we're proud of

  • Built a deployed full-stack inventory and procurement platform instead of a collection of disconnected dashboards.
  • Connected demand forecasting and stockout-risk analysis with procurement recommendations.
  • Integrated AI-assisted intelligence into inventory and purchasing workflows.
  • Implemented supplier comparison and budget-constrained procurement planning.
  • Built approval workflows with distinct business personas for Approver, Buyer, and CFO.
  • Integrated PayPal Orders v2 with Smart Payment Buttons and server-side Sandbox payment capture.
  • Connected the deployed Next.js frontend on Vercel with the backend on Railway.
  • Established PostgreSQL connectivity for persistent application data.
  • Implemented automated testing and CI checks covering important application workflows.
  • Resolved real deployment and integration issues involving monorepo compilation, module resolution, and production CORS configuration.

Our biggest accomplishment is turning an idea into a deployed, integrated application that demonstrates the complete journey from inventory analysis to procurement approval and PayPal Sandbox payment.

What we learned

StockWise Pay gave us practical experience designing and integrating a full-stack business application around a real operational problem.

We learned how to:

  • Build modular applications using Next.js, Node.js, TypeScript, and PostgreSQL.
  • Design APIs and coordinate communication between frontend and backend services.
  • Combine demand forecasting and inventory calculations with AI-assisted recommendations.
  • Evaluate suppliers using pricing, reliability, lead times, and purchasing constraints.
  • Integrate PayPal Orders v2 and understand the payment lifecycle.
  • Handle authentication, role-based authorization, environment variables, CORS, and production configuration.
  • Deploy and troubleshoot applications across Vercel and Railway.
  • Test interconnected workflows rather than evaluating individual modules in isolation.

One important lesson was that payment integration is much more than displaying a checkout button. It requires secure server-side processing, correct transaction-state handling, and reliable payment records.

What's next for StockWise Pay

We see StockWise Pay evolving into a more comprehensive procurement intelligence and financial operations platform.

Our future plans include:

  • Advanced Demand Forecasting: Improve predictions using larger historical sales datasets, seasonal patterns, and changing demand.
  • Smarter Supplier Recommendations: Develop richer supplier scoring based on pricing, reliability, fulfillment history, and lead-time performance.
  • Automated Procurement: Introduce configurable reorder triggers and approval-driven purchasing automation.
  • Expanded PayPal Integration: Add robust webhook verification, refund handling, reconciliation, and transaction-state synchronization.
  • Financial Intelligence: Provide deeper procurement spending analytics, cash-flow projections, and budget planning.
  • Enterprise Integrations: Explore accounting systems, ERP platforms, and additional payment providers.
  • Production Readiness: Strengthen security, monitoring, scalability, and operational reliability.

Our long-term vision is to make StockWise Pay an intelligent procurement and financial operations companion that helps businesses move from reactive purchasing to proactive, data-driven decisions.

Built With

Share this project:

Updates

Submission history