Partial update product
patch
/api/v1/products/{id}
Security
Parameters
| Name | In | Type | Details | |
|---|---|---|---|---|
id |
path |
integer
|
required | Resource ID |
Request body required
application/json
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"
}
}
}
Responses
200
Product updated
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)"
}
}
}
404
Resource not found
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
}
}
}
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
}
}
}