Produkt erstellen
Erstellt ein Produkt. Pflicht: `name` (eindeutig). Optional Kategorie (`categories_id` oder `category_id`), unit_id, Preise, Bestand und tax_percentage.
post
/api/v1/products
Sicherheit
Parameter
| Name | In | Typ | Details | |
|---|---|---|---|---|
Idempotency-Key |
header |
string
|
Optional | Unique key for safe create retries (Make/Zapier/n8n). Replays the stored successful response for the same key + request body within 7 days. |
Request-Body Pflicht
application/json
Beispiel
{
"name": "Solar Panel 430W",
"article_number": "SP-430",
"description": "430W monocrystalline panel",
"selling_price": 199.99,
"avg_bought_price": 120,
"tax_percentage": 19,
"stock": 50
}
Schema
{
"type": "object",
"required": [
"name"
],
"description": "Product create/update payload. `name` is unique. `categories_id` (alias `category_id`) and `unit_id` are optional. If `gross_profit` is omitted, it is derived from selling_price − avg_bought_price. On create, omitted tax_percentage uses the tenant default. Cover image and gallery files are not accepted here — use `/products/{id}/image` and `/products/{id}/files`.\n",
"properties": {
"name": {
"type": "string"
},
"categories_id": {
"type": "integer"
},
"description": {
"type": "string"
},
"storage_location": {
"type": "string"
},
"ean": {
"type": "string"
},
"manufacturer_number": {
"type": "string"
},
"article_number": {
"type": "string"
},
"assembly_instructions": {
"type": "string"
},
"avg_bought_price": {
"type": "number"
},
"selling_price": {
"type": "number"
},
"gross_profit": {
"type": "number"
},
"stock": {
"type": "integer"
},
"tax_percentage": {
"type": "number"
},
"unit_id": {
"type": "integer"
}
}
}
Antworten
201
Produkt erstellt
application/json
{
"allOf": [
{
"title": "API envelope",
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string",
"nullable": true
},
"errors": {
"nullable": true
},
"meta": {
"type": "object",
"nullable": true,
"additionalProperties": true
}
}
},
{
"type": "object",
"properties": {
"data": {
"title": "Product",
"type": "object",
"description": "Product in list/show/create/update responses.",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"categories_id": {
"type": "integer",
"nullable": true
},
"description": {
"type": "string",
"nullable": true
},
"storage_location": {
"type": "string",
"nullable": true
},
"ean": {
"type": "string",
"nullable": true
},
"manufacturer_number": {
"type": "string",
"nullable": true
},
"article_number": {
"type": "string",
"nullable": true
},
"assembly_instructions": {
"type": "string",
"nullable": true
},
"avg_bought_price": {
"type": "number",
"nullable": true
},
"selling_price": {
"type": "number",
"nullable": true
},
"gross_profit": {
"type": "number",
"nullable": true
},
"stock": {
"type": "integer",
"nullable": true
},
"tax_percentage": {
"type": "number",
"nullable": true
},
"unit_id": {
"type": "integer",
"nullable": true
},
"created_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"updated_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"category": {
"oneOf": [
{
"title": "Category",
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
}
}
},
{
"type": "null"
}
]
},
"unit": {
"oneOf": [
{
"title": "Unit",
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"abbreviation": {
"type": "string",
"nullable": true
},
"german_unit_name": {
"type": "string",
"nullable": true
}
}
},
{
"type": "null"
}
]
},
"image": {
"oneOf": [
{
"title": "Product file",
"type": "object",
"required": [
"id",
"name",
"url"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"url": {
"type": "string"
},
"type": {
"type": "string",
"nullable": true
},
"size": {
"type": "integer",
"nullable": true
}
}
},
{
"type": "null"
}
]
},
"files": {
"type": "array",
"items": {
"title": "Product file",
"type": "object",
"required": [
"id",
"name",
"url"
],
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"url": {
"type": "string"
},
"type": {
"type": "string",
"nullable": true
},
"size": {
"type": "integer",
"nullable": true
}
}
}
}
}
}
}
}
]
}
401
Missing or invalid API key
application/json
{
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string",
"example": "Missing API key (X-Api-Key)"
}
}
}
422
Validation failed
application/json
{
"title": "API envelope",
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"message": {
"type": "string",
"nullable": true
},
"errors": {
"nullable": true
},
"meta": {
"type": "object",
"nullable": true,
"additionalProperties": true
}
}
}