Bringing Farmers & Customers Together

Our API bridges the gap between local farmers and customers, creating a seamless marketplace for fresh, farm-to-table products.

πŸ‘¨β€πŸŒΎ

Farmers

List products, manage inventory, set flexible pricing (per kg, unit, wholesale), and receive orders directly from customers.

↔
πŸ›’

Customers

Browse fresh produce, place orders, make secure payments, and leave reviews to support local farming.

🌾 Farm Products You Can Sell

From fresh vegetables to seasonal fruits, dairy products to grainsβ€”list and sell any farm product through our API.

Fresh vegetables and greens
Fresh Vegetables & Greens
Seasonal fruits
Seasonal Fruits & Berries
Dairy products
Dairy Products & Eggs
Grains and cereals
Grains, Cereals & Seeds
Herbs and spices
Herbs & Aromatics
Root vegetables
Root Vegetables & Tubers

πŸ‘¨β€πŸŒΎ Farmer Features

Complete product management with multiple pricing options, order tracking, customer reviews, and sales analytics.

πŸ›’ Customer Experience

Advanced search & filtering, favorites, order history, secure checkout, and easy communication with farmers.

πŸ” Enterprise Security

JWT authentication, role-based access control, rate limiting, data validation, and comprehensive security headers.

πŸ’³ Flexible Payment Options

Built-in (AdwaPay): Use POST /paymentCollection/mobile for integrated card or mobile money payments. External Providers: Integrate your own payment gateway (Stripe, Flutterwave, M-Pesa) and confirm via POST /payment/confirm-external. Full transaction lifecycle management with webhooks and notifications.

πŸ’³ Payment Collection System

Choose between our built-in payment provider or integrate your preferred payment gatewayβ€”both options fully supported with comprehensive documentation.

Built-in Provider (AdwaPay)

Streamlined payment collection supporting card and mobile money. Includes redirect flows, status polling, and automatic webhook notifications.

POST /api/v2/transactions/:orderId/paymentCollection/mobile

External Payment Gateway

Use your existing payment infrastructure (Stripe, Flutterwave, M-Pesa, etc.). Process payments externally, then confirm with our API for order updates and notifications.

POST /api/v2/transactions/payment/confirm-external

Configuration: PAYMENT_DEFAULT_PROVIDER=adwa or use ?provider=adwa query parameter. Complete webhook integration available at /transactions/webhook/adwapay. See full documentation for details.

πŸ› οΈ Built With Modern Technology

Node.js
Express.js
TypeScript
PostgreSQL
Sequelize ORM
JWT Auth
Nodemailer
Cloudinary

πŸ”— API Endpoints Overview

πŸ”‘ Authentication

POST /api/v2/auth/signup - User registration (OTP disabled; keeping auth simple)
POST /api/v2/auth/login - User login with JWT token generation
POST /api/v2/auth/refreshToken - Refresh JWT access tokens

🌾 Products Management

GET /api/v2/products - List all products with pagination & filters
POST /api/v2/products - Create new product (Farmers only)
GET /api/v2/products/:id - Get detailed product information
PUT /api/v2/products/:id - Update product details (Owner only)
DELETE /api/v2/products/:id - Delete product (Owner only)

πŸ“¦ Orders & Transactions

POST /api/v2/orders - Create new order with cart items
GET /api/v2/orders - Get user order history
POST /api/v2/payments - Process payment for order

πŸ‘€ User Management

GET /api/v2/users/profile - Get current user profile
PUT /api/v2/users/profile - Update user profile information
POST /api/v2/users/upload-avatar - Upload profile picture

πŸ”’ Secure Authentication

JWT-based auth with refresh tokens, role-based access control, and session management. (OTP verification disabled β€” keeping auth simple.)

πŸ“Š Highly Scalable

Built with modern architecture patterns, optimized database queries, and designed to handle growth.

πŸ”Œ API-First Design

Pure REST API backendβ€”integrate with any frontend: mobile apps, web applications, or third-party platforms.

πŸ”” Real-time Updates

Push notifications, webhooks, email alerts, and instant order status updates for seamless user experience.

πŸš€ Ready to Get Started?

Integrate the Farm Marketplace API into your application in minutes with our comprehensive documentation.

Base URL & Documentation

/api/v2

πŸ“– Complete OpenAPI Documentation β†’

Includes: Authentication guides, endpoint references, request/response schemas, error codes, and code examples.