The Update Product endpoint lets an admin partially or fully overwrite an existing marketplace product. All body fields and file fields are optional — only the values you include are applied, and any file you upload replaces the corresponding stored file on the server. The endpoint first checks that the product exists, then verifies admin level 2 authorization before making any changes. If a numericDocumentation 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.
discount value is supplied, the endpoint automatically recalculates and persists discountPrice as price * (1 - discount / 100).
POST /api/product/update/:productId
Authentication
| Header | Value | Required |
|---|---|---|
token-access | <your JWT token> | ✅ Yes |
Path Parameters
The MongoDB ObjectId of the product to update. Returned as
_id when the
product was created or listed.Request Body
This endpoint acceptsmultipart/form-data. All fields are optional; omitted fields retain their existing values.
Text Fields
New display name for the product.
New long-form description.
Product category. Allowed values:
"Uniforme" | "Tipografía".Updated base price. If
discount is also provided, discountPrice is
recalculated from this value.Updated design file format string, e.g.
"AI", "PNG", "PSD".Updated payment type. Allowed values:
"Pago" | "Gratuito".Discount percentage expressed as a numeric string, e.g.
"10" for a 10%
discount. When provided alongside price, the server calculates
discountPrice = price * (1 - discount / 100) and stores both values.File Fields
Each file field accepts at most 1 file. A new file is only written to the product document if the processed result differs from the currently stored value — if the uploaded file produces a path identical to the one already saved, the field is left unchanged.Replacement design file. Replaces the previously stored design file.
Replacement preview image.
Replacement shirt demonstration GIF or image.
Replacement shorts demonstration GIF or image.
Response
200 — Product Updated
"Producto actualizado correctamente"Always
true on success.The full product document after the update is applied.
Discount Calculation
The server calculates and stores In practice this means: For example,
discountPrice only when all three
conditions in the controller are met:discount must be sent as a numeric string (e.g.
"10", "25.5"), and a finite numeric price must also be included
in the same request body. When both are present, the server sets:price=20 and discount="10" yields discountPrice=18.
The discountPrice field is stored as a String in the database.Error Responses
| Status | Condition | status |
|---|---|---|
404 | No product found with the given ID | false |
203 | Authenticated user is not admin level 2 | false |
500 | Unexpected server error | — |
404 — Product Not Found
203 — Not Authorized
Example
Replace
<YOUR_TOKEN> with a valid JWT for an admin level 2 user, and
<PRODUCT_ID> with the target product’s _id.- Text fields only
- With file replacement
cURL
Success Response