🚀 Batoo API

RESTful API for Batoo Marketplace Platform

✓ Server Online

🔐 Authentication

POST
/api/auth/register
Register a new user account

Request Body:

email: string (required)
password: string (required)
userName: string (required)
curl -X POST https://batoobackend-production.up.railway.app/api/auth/register \ -H "Content-Type: application/json" \ -d '{"email":"user@example.com","password":"123456","userName":"John"}'
POST
/api/auth/login
Login with email and password

Request Body:

email: string (required)
password: string (required)
curl -X POST https://batoobackend-production.up.railway.app/api/auth/login \ -H "Content-Type: application/json" \ -d '{"email":"user@example.com","password":"123456"}'

📦 Products

GET
/api/products?page=1&limit=20
Get all products with pagination

Query Parameters:

page: number (default: 1)
limit: number (default: 20)
curl https://batoobackend-production.up.railway.app/api/products?page=1&limit=10
GET
/api/products/:id
Get a specific product by ID
curl https://batoobackend-production.up.railway.app/api/products/123abc
POST Auth Required
/api/products
Create a new product

Headers:

Authorization: Bearer {token}

Request Body:

nomProduit: string
prixProduit: number
imageUrls: array
categorie: string
PUT Auth Required
/api/products/:id
Update a product
DELETE Auth Required
/api/products/:id
Delete a product

🛒 Cart & Orders

POST
/api/cart
Add item to cart

Request Body:

productId: string
userId: string
quantity: number
deliveryAddress: string
GET
/api/cart/:userId?isPaid=false
Get user's cart items or orders

Query Parameters:

isPaid: boolean (false = cart, true = orders)
PUT
/api/cart/:cartItemId
Update cart item quantity or address
DELETE
/api/cart/:cartItemId
Remove item from cart

🚚 Seller Orders

GET
/api/seller/orders/:sellerId
Get all orders for a seller
PUT
/api/seller/orders/:orderId/status
Update order status (pending, processing, shipped, delivered)

Request Body:

status: string
POST
/api/seller/orders/:orderId/confirm-delivery
Confirm delivery with signature and photo

Request Body:

signatureBase64: string
photoBase64: string
notes: string

📤 File Upload

POST Auth Required
/api/upload/images
Upload multiple images to AWS S3

Form Data:

images: file[] (multipart/form-data)
curl -X POST https://batoobackend-production.up.railway.app/api/upload/images \ -H "Authorization: Bearer YOUR_TOKEN" \ -F "images=@image1.jpg" \ -F "images=@image2.jpg"

📍 Google Places

GET
/api/places/autocomplete?input=address
Get address suggestions
GET
/api/places/details/:placeId
Get detailed address information