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.

The Create Product endpoint allows an authenticated admin to publish a new sporting design to the TuKit marketplace. Requests must be sent as multipart/form-data because the endpoint uses Multer to handle up to four file fields alongside the text body. Only users whose role has name: "admin" and value: "2" are permitted to call this endpoint; all other authenticated users receive a 203 rejection. File fields that are omitted are stored as empty arrays on the product document, so they are all optional at the HTTP level even though meaningful products will generally include at least an image. POST /api/product/agregate

Authentication

Every request must include a valid JWT in the token-access header. The authenticated user must also hold the admin level 2 role (name: "admin", value: "2"). Requests from non-admin users return HTTP 203.
HeaderValueRequired
token-access<your JWT token>✅ Yes

Request Body

This endpoint accepts multipart/form-data. Send text fields and file fields in the same form submission.

Text Fields

title
string
required
Display name of the product shown to buyers on the marketplace.
category
string
required
Product category. Must be exactly one of the enum values accepted by the database schema.Allowed values: "Uniforme" | "Tipografía"
price
number
required
Base price of the product in the store’s local currency. Stored as a Number and defaults to 0 if omitted at the model level.
format
string
required
Design file format(s) included with the product, e.g. "AI", "PNG", "PSD". Free-form string — use a descriptive value buyers can understand.
typeProduct
string
required
Determines whether the product is paid or free.Allowed values: "Pago" | "Gratuito"
description
string
Optional long-form description of the product. Displayed on the product detail page.

File Fields

All file fields are optional. Each field accepts a maximum of 1 file and is stored to storage/product/ on the server via Multer disk storage.
archivoUrl
file
The primary design file (e.g. .ai, .psd, .zip). Max 1 file.
imageUrl
file
Preview image for the product listing. Max 1 file.
shirtGif
file
Animated GIF or image demonstrating the design on a shirt. Max 1 file.
shortsGif
file
Animated GIF or image demonstrating the design on shorts. Max 1 file.

Response

200 — Product Created

msj
string
Human-readable confirmation message, e.g. "Uniforme creada correctamente". The category name is interpolated into the message.
status
boolean
Always true on success.
data
object
The newly created product document.

Error Responses

StatusConditionstatus
203Authenticated user is not admin level 2false
203One or more required text fields are missingfalse
500Unexpected server error
203 — Not Authorized
{
  "msj": "No estás autorizado para agregar productos",
  "status": false
}
203 — Missing Fields
{
  "msj": "Completa todos los campos",
  "status": false
}

Example

Replace <YOUR_TOKEN> with a valid JWT that belongs to an admin level 2 user. Adjust file paths to point to real files on your machine.
cURL
curl -X POST https://your-api-domain.com/api/product/agregate \
  -H "token-access: <YOUR_TOKEN>" \
  -F "title=Club Deportivo Tigres 2025" \
  -F "category=Uniforme" \
  -F "price=12.99" \
  -F "format=AI" \
  -F "typeProduct=Pago" \
  -F "description=Kit completo de uniforme para temporada 2025." \
  -F "archivoUrl=@/path/to/design.ai" \
  -F "imageUrl=@/path/to/preview.png" \
  -F "shirtGif=@/path/to/shirt.gif" \
  -F "shortsGif=@/path/to/shorts.gif"
Success Response
{
  "msj": "Uniforme creada correctamente",
  "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"
  }
}

Build docs developers (and LLMs) love