Overview
The Products API allows you to retrieve, create, update, and delete products in the FitAiid store. Products include fitness equipment, supplements, apparel, and digital fitness plans.Product Object
The Product object contains all information about items available for purchase.Unique identifier for the product (MongoDB ObjectId)
Product name (2-200 characters)
Detailed product description (10-2000 characters)
Product price in cents (Colombian Pesos). Must be between 0 and 999,999,999
Original price before discount (must be greater than or equal to current price)
Discount percentage (0-100). Auto-calculated if originalPrice is set
Product category
Product subcategory
Product brand name (1-50 characters)
Array of image URLs (1-10 images). Accepts trusted domains (Unsplash, Cloudinary, etc.) or URLs with image extensions
Primary product image URL
Available stock quantity (0-99,999)
Whether product is in stock. Auto-synced with quantity
Product rating information
Product status:
active, inactive, discontinued, or coming-soonWhether product is featured
Total number of sales
Number of product views
Get All Products
Query Parameters
Filter by category (e.g.,
laptops, smartphones)Filter by brand name (case-insensitive)
Minimum price filter in cents
Maximum price filter in cents
Filter by stock availability (
true or false)Search query for name, description, or brand
Sort order
Page number for pagination
Number of products per page
Response
Get Product by ID
Path Parameters
MongoDB ObjectId of the product
Response
Create Product
This endpoint requires authentication with an admin account. Include the JWT token in the Authorization header.
Headers
Bearer token:
Bearer YOUR_JWT_TOKENBody Parameters
Product name (2-200 characters, must be unique)
Product description (10-2000 characters)
Product price in cents (10,000 - 50,000,000)
Product category from allowed values
Product brand (1-50 characters)
Primary product image URL
Array of image URLs (1-10 images)
Initial stock quantity (0-99,999)
Original price before discount
Product subcategory
Array of tags (max 20)
Stock level threshold for low stock alerts
Response
Update Product
Path Parameters
MongoDB ObjectId of the product to update
Headers
Bearer token:
Bearer YOUR_JWT_TOKENBody Parameters
All fields are optional. Only include fields you want to update.Product name (must be unique)
Product description
Product price in cents
Update stock quantity
Product status:
active, inactive, discontinued, or coming-soonResponse
Delete Product
Path Parameters
MongoDB ObjectId of the product to delete
Headers
Bearer token:
Bearer YOUR_JWT_TOKENResponse
Error Responses
400 Bad Request
Invalid parameters or validation errors
401 Unauthorized
Missing or invalid authentication token
403 Forbidden
User does not have admin privileges
404 Not Found
Product not found