The order history API exposes two complementary views of the same cart data. Buyers can retrieve a paginated list of every cart they have created — each document shows exactly what was ordered, at what price, and when. Sellers can retrieve a paginated list of all carts that contain at least one product they listed, giving them a complete picture of their sales activity without requiring a separate orders collection. Both endpoints require a valid JWT token and share the same pagination interface.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.
Buyer: list purchase history
POST /api/carts/list-my-buy/:pag?/:perpage?
Returns all cart documents where cart.user._id matches the authenticated user’s _id. Results are sorted by most recently created first (_id descending) and are split into pages.
Headers
A valid JWT token. Format:
<jwt-token>Path parameters (optional)
The page number to retrieve. Defaults to
1 if omitted.The number of cart documents per page. Defaults to
10 if omitted.Response
"Cargando mis compras" on success.true on success.Array of cart documents belonging to the authenticated buyer.
Pagination metadata for the result set.
Error response
A203 is returned with { msj: "Error al cargar mis compras", status: false } if the database query fails.
Example
Seller: list sales orders
POST /api/carts/list-my-sale/:pag?/:perpage?
Returns all cart documents that contain at least one product whose user._id (the seller) matches the authenticated user’s _id. Results are sorted by most recently created first and are paginated using the same interface as the buyer endpoint.
Headers
A valid JWT token. Format:
<jwt-token>Path parameters (optional)
The page number to retrieve. Defaults to
1 if omitted.The number of cart documents per page. Defaults to
10 if omitted.Response
The response shape is identical to the buyer history endpoint."Cargando mis ventas" on success.true on success.Array of cart documents that contain at least one product listed by the authenticated seller. Each cart document has the same shape described in the buyer history response above, including full buyer info and all product lines.
Pagination metadata.
Error response
A203 is returned with { msj: "Error al cagar mis ventas", status: false } if the database query fails.