Skip to main content

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.

TuKit exposes two category-scoped search endpoints that accept a free-text query parameter and match it against product titles using a case-insensitive MongoDB regex. One endpoint searches only products in the "Uniforme" category and the other searches only "Tipografia". Both endpoints support optional pagination via path parameters and accept an optional typeProduct body field to further narrow results to paid or free products. Results are sorted by newest first (_id: -1) and include a pagination object so clients can implement page controls. POST /api/product/search-uniform/:query/:pag?/:perpage? POST /api/product/search-typography/:query/:pag?/:perpage?

Authentication

Both endpoints require a valid JWT in the token-access header. Standard user authentication is sufficient — admin privileges are not required.
HeaderValueRequired
token-access<your JWT token>✅ Yes

Path Parameters

query
string
required
The search term to match against product titles. The lookup uses a case-insensitive regex ($regex with $options: "i"), so partial matches are supported. For example, "tigres" will match "Club Tigres 2025".
pag
number
Page number to retrieve, starting at 1. Handled by the Paginate middleware before the controller runs. Optional — defaults to page 1 when omitted.
perpage
number
Number of results per page. Handled by the Paginate middleware. Optional — the middleware supplies a default when omitted.

Request Body

typeProduct
string
Filter results by payment type. When provided, only products matching this value are returned.Allowed values: "Pago" | "Gratuito"

Category Scope

The two endpoints are identical in behaviour except for the category filter applied server-side:
EndpointCategory filter applied
/search-uniform/…category: "Uniforme"
/search-typography/…category: "Tipografia"
Note the spelling difference: the database stores uniform products as "Uniforme" and typography products as "Tipografia" (no accent) inside this search controller, so queries against the wrong endpoint will return zero results regardless of the search term.

Response

200 — Search Results

msj
string
A loading message: "Cargando uniformes..." for the uniform endpoint, or "Cargando tipografías..." for the typography endpoint.
status
boolean
true on success.
data
array
Array of product documents matching the search criteria, sorted by newest first. May be an empty array if no products match.
pagination
object
Pagination metadata for the current result set.

Error Responses

StatusCondition
500Unexpected server error

Examples

Search for uniforms whose title contains “tigres”, returning only paid products on page 1 with 10 results per page.
cURL
curl -X POST \
  "https://your-api-domain.com/api/product/search-uniform/tigres/1/10" \
  -H "token-access: <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{ "typeProduct": "Pago" }'
Success Response
{
  "msj": "Cargando uniformes...",
  "status": true,
  "data": [
    {
      "_id": "665a1f2e8c4b2a001e3d9f01",
      "title": "Club Deportivo Tigres 2025",
      "description": "Kit completo de uniforme para temporada 2025.",
      "category": "Uniforme",
      "price": 12.99,
      "format": "AI",
      "typeProduct": "Pago",
      "archivoUrl": ["storage/product/23design.ai"],
      "imageUrl": ["storage/product/7preview.png"],
      "shirtGif": ["storage/product/12shirt.gif"],
      "shortsGif": ["storage/product/45shorts.gif"],
      "discount": "Sin descuento",
      "discountPrice": "",
      "minCant": 1,
      "date": "2025-06-01T14:30:00.000Z",
      "user": {
        "_id": "664f0a1c3b2e1a001d2c8e00",
        "userName": "adminuser",
        "email": "admin@tukit.com",
        "roles": [{ "name": "admin", "value": "2" }],
        "activate": [{ "name": "active", "value": "true" }]
      },
      "createdAt": "2025-06-01T14:30:00.000Z",
      "updatedAt": "2025-06-01T14:30:00.000Z"
    }
  ],
  "pagination": {
    "pag": "1",
    "perpage": 10,
    "pags": 1
  }
}

Build docs developers (and LLMs) love