Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/PloutusLab/krafta-web/llms.txt

Use this file to discover all available pages before exploring further.

The catalog admin at /admin/catalog (the Operations Hub) is the master interface for managing every product that can appear in the Krafta storefront. It shows all products regardless of their active status, so drafts and deactivated items remain visible for editing. A status badge on each row displays Active in green or Draft in orange. The page also highlights any products that are missing a configured print area or have no uploaded mockup images under a “Requieren Acción” (requires action) section.
Deleting a product is irreversible — it performs a hard delete and cascades to all related ProductVariant and PrintTemplate records. To hide a product from the storefront without permanent removal, set its active field to false by leaving the mockup image blank or reverting to the placeholder URL instead of hard-deleting.

Create a product

New products are created through the three-step wizard at /admin/catalog/create. Step 1 — Ficha Comercial: Fill in the product name, optional SKU, category, description, base price, and upload commercial photos via POST /api/upload. Color variants can be added with a name and hex code. The name field is required to advance to step 2. Step 2 — Superficie: Upload a flat mockup image and draw the print area using the PrintAreaEditor component. Print area values are stored as percentages (0–100) relative to the mockup image dimensions, not in pixels. Step 3 — Mockups Realistas: Configure the layered mockup scenes that customers will see in the design editor. Once saved, the wizard posts the full payload to POST /api/catalog.

POST /api/catalog — request body

{
  "name": "Hoodie Premium Crop",
  "description": "Sudadera de algodón 320g con capucha y bolsillo canguro.",
  "categoryName": "Ropa",
  "sku": "KRAFT-HOOD-01",
  "basePrice": 28.00,
  "images": [
    "https://cdn.krafta.com/products/hoodie-crop-front.jpg"
  ],
  "svgContent": "{\"baseSvg\":null,\"designViews\":[],\"mockups\":[]}",
  "printTemplate": {
    "mockupImageUrl": "https://cdn.krafta.com/products/hoodie-crop-front.jpg",
    "printAreaX": 28,
    "printAreaY": 22,
    "printAreaWidth": 44,
    "printAreaHeight": 38
  }
}
name
string
required
Display name shown in the storefront and admin catalog list.
description
string
Customer-facing product description.
categoryName
string
Name of the category to assign. If the category does not exist it is created automatically with a URL slug derived from the name.
sku
string
required
Unique SKU for the base variant. Must be unique across the entire catalog — a duplicate SKU returns a 400 error with code P2002.
basePrice
number
required
Base sale price in USD. Must be a positive decimal.
images
array
Array of image URLs for the product photo carousel. The first element becomes the cover image (thumbnailUrl).
printTemplate
object
Print area configuration object. All coordinate fields are percentages (0–100) of the mockup image dimensions.

Product activation logic

A product is automatically set to active: true by the API when both conditions are met:
  1. The images array contains at least one URL.
  2. The mockupImageUrl is not the placeholder path /mockups/tudisenoaqui.png (or /mockups/franela.png).
If either condition is false, the product is saved as active: false (Draft) and will not appear in the public storefront until both requirements are satisfied.

Edit a product

Products can be edited at /admin/catalog/edit/[id]. The edit page calls GET /api/catalog?id=<productId>&editor=1 to load the current state, then submits changes via PUT /api/catalog.

PUT /api/catalog — request body

{
  "id": "prod-abc123",
  "name": "Hoodie Premium Crop",
  "description": "Sudadera actualizada.",
  "categoryName": "Ropa",
  "images": ["https://cdn.krafta.com/products/hoodie-v2.jpg"],
  "variants": [
    {
      "sku": "KRAFT-HOOD-01",
      "basePrice": 30.00,
      "printTemplate": {
        "mockupImageUrl": "https://cdn.krafta.com/products/hoodie-v2.jpg",
        "printAreaX": 28,
        "printAreaY": 22,
        "printAreaWidth": 44,
        "printAreaHeight": 38
      }
    }
  ]
}
The API upserts the PrintTemplate record linked to the first variant. If no PrintTemplate exists yet, it is created with the provided values.

Delete a product

DELETE /api/catalog?id=<productId>
Hard-deletes the product and all cascading records (ProductVariant, PrintTemplate). This action cannot be undone.

Bulk CSV import

The catalog page supports bulk product import via a CSV file. Click Importación Masiva, select a .csv file, and the page processes each row sequentially using POST /api/catalog. Download the official template first to ensure correct column ordering:
ColumnField
skuVariant SKU
titleProduct name
descriptionProduct description
base_priceBase price (USD)
currencyCurrency code
categoryCategory name

Build docs developers (and LLMs) love