Base URL

http://localhost:8000/api/category

All routes below are prefixed with this base URL.

1️⃣ Get All Categories

GET /show

Description

Fetch all categories with their subcategories.

Success Response (200)

{ "success": true, "count": 1,
"data": [ { "_id": "69a5b5e4930e55ca0f4c92d0", "name": "Plastic", "price": "20" "icon": "📦", "description": "Plastic bottles, containers, bags, and other plastic items", "subcategories": [ { "name": "Bottles", "_id": "69a5b5f2930e55ca0f4c92d7" } ], "createdAt": "2026-03-02T16:08:04.877Z", "updatedAt": "2026-03-02T16:08:18.609Z", "__v": 1 } ] }

Error Response (500)

500 → Server Error (Database or internal failure)