GET /products/catalogs/:userId
Retrieve a user’s product catalog with optional category filtering.Requires authentication. Returns products specific to a user’s inventory.
Path Parameters
ID of the user whose catalog to retrieve
Query Parameters
Filter products by category ID
Response
Array of products in the user’s catalog
Total count of products in catalog
User ID for this catalog
Use Cases
Display User’s Entire Catalog
Filter Catalog by Category
Display Products with Variants
Dynamic Category Filter Component
Catalog Response Structure
Product Object Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique product identifier |
name | string | Product name |
price | number | Base product price |
stock | number | Available inventory |
category | object | Category information |
variants | array | Product variations (size, color, etc.) |
image | string | Product image URL |
description | string | Product description |
createdAt | string | Creation timestamp |
updatedAt | string | Last update timestamp |
Variant Object Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique variant identifier |
size | string | Variant size |
color | string | Variant color |
price | number | Variant-specific price |
stock | number | Variant-specific stock |
Integration with Redux
Error Codes
| Status | Description |
|---|---|
200 | Success - Catalog retrieved |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Missing/invalid token |
404 | Not Found - User or category not found |
500 | Server Error - Internal error occurred |
Performance Tips
Cache catalog data
Cache catalog data
Cache catalog responses on the frontend to reduce API calls. Invalidate cache when products are updated.
Use category filtering
Use category filtering
When displaying large catalogs, use category filtering to reduce response size and improve load times.
Paginate results
Paginate results
For very large catalogs, consider implementing pagination to load products in batches.