Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/Ecommerce/llms.txt

Use this file to discover all available pages before exploring further.

The catalog read endpoints give you flexible ways to surface products: paginated full listings, keyword search, single-product lookups, and per-seller collections. All four endpoints use POST and return consistent response shapes with a pagination object when multiple records are involved. No authentication is required for public browsing except the seller-specific endpoint.
Use the pag and perpage URL parameters on any paginated endpoint to navigate large catalogs efficiently. The response’s pagination.pags field tells you the total number of pages so you can build accurate page controls on the client.

1. List All Products

Retrieve every product in the catalog, sorted newest-first by _id, with pagination.
PropertyValue
MethodPOST
Path/api/product/get-all-product/:pag?/:perpage?
AuthNone required

Path Parameters

pag
number
Page number to retrieve. Defaults to 1 when omitted.
perpage
number
Number of products per page. Defaults to 10 when omitted.

Response — 200 OK

msj
string
Human-readable status message. Value: "Cargando todos los productos".
status
boolean
true on success.
data
array
Array of product objects for the requested page, sorted by _id descending.
pagination
object
Pagination metadata for the current result set.

Examples

curl -X POST https://api.example.com/api/product/get-all-product

2. Search Products by Title

Search the catalog using a keyword query matched case-insensitively against product titles using a regular expression.
PropertyValue
MethodPOST
Path/api/product/search-product/:query/:pag?/:perpage?
AuthNone required

Path Parameters

query
string
required
Search keyword or phrase. Matched against the title field using a case-insensitive regex (e.g. oxford matches "Classic Oxford Shirt").
pag
number
Page number to retrieve. Defaults to 1.
perpage
number
Number of results per page. Defaults to 10.

Response — 200 OK

msj
string
Human-readable status message. Value: "Cargando producto".
status
boolean
true on success.
data
array
Array of product objects whose title matches the query string.
pagination
object
Pagination metadata.
The search is powered by a MongoDB regex on the title field, so it supports partial matches. Searching linen will match "Slim Fit Linen Shirt" and "Linen Weekend Shirt".

Examples

curl -X POST https://api.example.com/api/product/search-product/oxford

3. Get Single Product by ID

Fetch the full details of one product by its MongoDB ObjectId. This endpoint requires no authentication and is suitable for public product detail pages.
PropertyValue
MethodPOST
Path/api/product/get/:productId/productId
AuthNone required

Path Parameters

productId
string
required
The MongoDB ObjectId of the product to retrieve.

Response — 200 OK

msj
string
Human-readable status message. Value: "Cargando producto".
status
boolean
true on success.
Product
object
Reference to the Mongoose Product model, included in the response alongside data.
data
object
The complete product document retrieved by findById.

Examples

curl -X POST https://api.example.com/api/product/get/664a1f2e8b3c2a001f4e8d01/productId

4. Get Products by Seller

Retrieve all products created by a specific user, sorted by most recently created first. Requires a valid auth token.
PropertyValue
MethodPOST
Path/api/product/my-products/:userId/:pag?/:perpage?
Authtoken-access: <jwt-token> required

Path Parameters

userId
string
required
The _id of the user whose products you want to retrieve. The API filters products where user._id === userId.
pag
number
Page number. Defaults to 1.
perpage
number
Items per page. Defaults to 10.

Response — 200 OK

msj
string
Human-readable status message. Value: "Cargando mis productos".
status
boolean
true on success.
data
array
Products belonging to the specified user, sorted by createdAt descending.
pagination
object
Pagination metadata.

Examples

curl -X POST https://api.example.com/api/product/my-products/663f0a1b2c4d5e006a7b8c09 \
  -H "token-access: <jwt-token>"

Build docs developers (and LLMs) love