TuKit provides two distinct listing endpoints depending on which side of the transaction you are viewing. The buyer endpoint (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/tukit/llms.txt
Use this file to discover all available pages before exploring further.
list-my-buy) returns all carts where the authenticated user placed the order, querying on user._id. The seller endpoint (list-my-shopping) returns all carts that contain at least one product owned by the authenticated user, querying on products.user._id. Both endpoints share the same pagination middleware (Paginate), which computes skippag and limit from the optional path parameters pag and perpage, and sort results newest-first ({ _id: -1 }).
Buyer’s orders
Method and path
user._id matches the authenticated buyer.
Seller’s sales
Method and path
products[].user._id matches the authenticated seller.
Authentication
Both endpoints require a valid JWT in thetoken-access header.
| Header | Required | Description |
|---|---|---|
token-access | ✅ Yes | JWT issued at login |
Path parameters
Both endpoints accept the same optional path parameters.Page number to retrieve. Defaults to
1 (first page). The Paginate middleware sets skippag = (pag - 1) * perpage when pag > 1, otherwise skippag = 0.Number of results per page. Defaults to
10 when omitted.Pagination is handled entirely by the
Paginate middleware before the route handler runs. The computed skippag and limit values are written onto req.body and used directly in the Mongoose .skip() and .limit() calls.Query differences
| Endpoint | MongoDB filter | Who uses it |
|---|---|---|
list-my-buy | { "user._id": userId } | The buyer who placed the orders |
list-my-shopping | { "products.user._id": userId } | The seller whose products appear in the carts |
Responses
Both endpoints return the same response shape on success.200 — Orders loaded
"Cargando mis compras"forlist-my-buy"Cargando mis ventas"forlist-my-shopping
truePaginated array of
ShoppingCart documents, sorted newest-first.Pagination metadata.
Error responses
| Status | msj | Cause |
|---|---|---|
403 | "Sin token" | token-access header is missing |
401 | "Token inexistente" | JWT is invalid or expired |
203 | "Error al cargar mis compras" | Mongoose query failed in list-my-buy |
203 | "Error al cargar mis ventas" | Mongoose query failed in list-my-shopping |
500 | (error object) | Unexpected server error |