---
title: Creare un prodotto
description: Crea un prodotto (SKU sopra i passaporti). La categoria determina il template. Accetta imageUrls[] (max 20). Idempotency-Key supportato.
canonical: "https://www.tracepass.eu/it/docs/create-product"
locale: it
source: "https://www.tracepass.eu/it/docs/create-product"
---

# Creare un prodotto

> Crea un prodotto (SKU sopra i passaporti). La categoria determina il template. Accetta imageUrls[] (max 20). Idempotency-Key supportato.

```http
POST /api/v1/products
```

Crea un prodotto. Il template di categoria viene risolto automaticamente dallo slug `category` — deve corrispondere a una categoria preconfigurata (es. `batteries`, `textiles`, `jewelry`). Le stringhe model sono univoche all'interno dello spazio di lavoro.

Conta come una scrittura v1. Rispetta `Idempotency-Key`. Il campo opzionale `imageUrls` accetta un array di URL HTTPS pubblici (max 20 per prodotto, max 2048 caratteri ciascuno); il CDN del cliente rimane canonico e TracePass non lo ri-pubblica. Usate l'endpoint di caricamento multipart quando non avete pronti gli URL del CDN.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Authorization` | header | string | yes | `Bearer <token>` — una chiave API `tp_` (Developer → API Keys; più semplice, per server-to-server) oppure un access token OAuth 2.0 (Developer → OAuth Apps; per app autorizzate dall'utente, scoped e revocabili). La pagina Authentication contiene il flusso OAuth completo e l'elenco degli scopes. |
| `Idempotency-Key` | header | string | no | UUID v4 per operazione logica. |
| `name` | body | string (1-200) | yes | Nome visualizzato. |
| `model` | body | string (1-100) | yes | Identificatore del modello. Deve essere univoco all'interno del vostro spazio di lavoro. |
| `category` | body | string | yes | Slug della categoria preconfigurata — `batteries`, `textiles`, `jewelry`, `electronics`, `furniture`, `chemicals`, `packaging`, `toys`, `fmcg`, `tyres`, `iron-steel`, `construction`. |
| `description` | body | string (≤ 2000) | no | Descrizione opzionale. |
| `defaultFieldValues` | body | object | no | Valori iniziali applicati a ogni passaporto creato da questo prodotto. La chiave di ogni voce deve esistere nel template di categoria. |
| `imageUrls` | body | string\[\] (max 20) | no | URL HTTPS pubblici di immagini. Sostituisce l'array esistente in PATCH; aggiunge in coda sull'endpoint di caricamento multipart. |
| `sourceLocale` | body | string (ISO 639-1) | no | Locale di `name` e `description`. Per impostazione predefinita è il `defaultSourceLocale` del vostro spazio di lavoro (di solito `en`). |

## Examples

```bash
curl -sS https://app.tracepass.eu/api/v1/products \
  -H "Authorization: Bearer tp_REDACTED_xxxxxxxxxxxx" \
  -H "Idempotency-Key: 7b4f1e2c-9a3d-4e5b-8c1a-2d3e4f5a6b7c" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Li-Ion 48V Battery Pack",
    "model": "BP-48V-100",
    "category": "batteries",
    "defaultFieldValues": {
      "batteryChemistry": "NMC",
      "nominalVoltage": 48
    }
  }'
```

```typescript
import { randomUUID } from "node:crypto";
const res = await fetch("https://app.tracepass.eu/api/v1/products", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TRACEPASS_API_KEY}`,
    "Idempotency-Key": randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Li-Ion 48V Battery Pack",
    model: "BP-48V-100",
    category: "batteries",
    defaultFieldValues: { batteryChemistry: "NMC", nominalVoltage: 48 },
  }),
});
if (!res.ok) throw new Error(`Create failed: ${res.status}`);
const product = await res.json();
```

```python
import os, uuid, requests
res = requests.post(
    "https://app.tracepass.eu/api/v1/products",
    headers={
        "Authorization": f"Bearer {os.environ['TRACEPASS_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
        "Content-Type": "application/json",
    },
    json={
        "name": "Li-Ion 48V Battery Pack",
        "model": "BP-48V-100",
        "category": "batteries",
        "defaultFieldValues": {"batteryChemistry": "NMC", "nominalVoltage": 48},
    },
)
res.raise_for_status()
```

## Responses

### 201 — Creato

```json
{
  "_id": "6650a1b2c3d4e5f6a7b8c9d0",
  "name": "Li-Ion 48V Battery Pack",
  "model": "BP-48V-100",
  "category": "batteries",
  "templateId": "6650a1b2c3d4e5f6a7b8c9d1",
  "defaultFieldValues": { "batteryChemistry": "NMC", "nominalVoltage": 48 },
  "passportCount": 0,
  "status": "active",
  "createdAt": "2026-05-09T10:00:00.000Z"
}
```

### 400 — Nessun template

```json
{ "error": "No template found for category: foo-bar" }
```

### 409 — Model duplicato

```json
{ "error": "A product with this model already exists for your company" }
```

## Related

- [Elencare i prodotti](https://www.tracepass.eu/it/docs/list-products.md)
- [Aggiornare un prodotto](https://www.tracepass.eu/it/docs/update-product.md)
- [Caricare l'immagine del prodotto](https://www.tracepass.eu/it/docs/upload-product-image.md)
