Products
LIVECatalog items with price, stock, category, and imageUrl.
Endpoints
- GETPOSTList or create
- GETPATCHDELETERead, update, or delete one/api/products/:id
- GETFilter by category
- GETSearch name and description
Query params
| Param | Description | Example |
|---|---|---|
| search | Name or description | search=lamp |
| category | Filter by category | category=electronics |
| sort | createdAt · name · price · stock | sort=price |
| page | Page number · default 1 | page=2 |
| limit | Page size · default 12 · max 50 | limit=12 |
| order | asc · desc | order=asc |
| lang | Pass fa for Persian text · omit for English (default) | lang=fa |
| delay | Artificial wait in ms · max 5000 | delay=800 |
| status | Force error HTTP status · 400–599 | status=500 |
Persian text: add lang=fa. See Docs · Language.
Request
1const { data } = await axios.get('/api/products', { params: { category: 'electronics' } });Response
1{2 "data": [3 {4 "id": "a7b8c9d0-e1f2-3456-a123-567890123456",5 "name": "Nordic Desk Lamp",6 "description": "Matte aluminum lamp with warm dimmable LED.",7 "price": 49.99,8 "stock": 120,9 "category": "home",10 "imageUrl": "https://picsum.photos/seed/lamp/600/400",11 "createdAt": "2026-09-14T10:00:00.000Z",12 "updatedAt": "2026-09-14T10:00:00.000Z"13 }14 ],15 "pagination": {16 "page": 1,17 "limit": 12,18 "total": 24,19 "totalPages": 220 }21}