Référence MCP
update_product
Modifier un produit
Rôle#
Patch partiel d'un produit, comme PATCH /api/v1/products/{id} ; sans prices, les tarifs courants sont repris tels quels.
Accès#
Scope principal : products:write. Le scope ne remplace pas les gardes de visibilité, d'organisation, de module ni les scopes complémentaires des gestes composés.
Catalogue complet · Approbations
Paramètres#
Le schéma ci-dessous est produit par la fonction qui enregistre les outils, y compris idempotency_key lorsqu'elle s'applique. Consultez les objets imbriqués dans le schéma complet.
| Champ | Type | Obligatoire | Description |
|---|---|---|---|
name | string | Non | |
businessUnitId | string | Non | |
code | union | Non | |
capacity | union | Non | |
saleMode | string | Non | T-1412 : par cycle (défaut) ou ponctuel, vendu à une date de prestation Valeurs : per_cycle, one_off |
active | boolean | Non | |
prices | array | Non | |
id | string | Oui | Identifiant du produit |
idempotency_key | string | Non | Clé d'idempotence (recommandée) : rejouer la MÊME mutation avec la même clé renvoie la réponse originale sans ré-exécuter - TTL 24 h |
Schéma JSON complet des paramètres
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"businessUnitId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"code": {
"anyOf": [
{
"type": "null"
},
{
"type": "string",
"maxLength": 60
}
]
},
"capacity": {
"anyOf": [
{
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"saleMode": {
"description": "T-1412 : par cycle (défaut) ou ponctuel, vendu à une date de prestation",
"type": "string",
"enum": [
"per_cycle",
"one_off"
]
},
"active": {
"type": "boolean"
},
"prices": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "Présent = mise à jour du tarif, absent = création",
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"label": {
"type": "string",
"minLength": 1
},
"unitPrice": {
"type": "number",
"minimum": 0
},
"vatRatePercent": {
"description": "En POURCENT (20, 5.5) - null : taux du déploiement",
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 100
},
{
"type": "null"
}
]
},
"description": {
"anyOf": [
{
"type": "null"
},
{
"type": "string",
"maxLength": 500
}
]
},
"active": {
"type": "boolean"
},
"quantityTiers": {
"description": "#761 : paliers par quantité [{ minQuantity ≥ 2, unitPrice | discountPercent }] ; absent : grille gardée, null ou [] : aucun palier",
"anyOf": [
{
"maxItems": 20,
"type": "array",
"items": {
"type": "object",
"properties": {
"minQuantity": {
"type": "integer",
"minimum": 2,
"maximum": 1000000
},
"unitPrice": {
"type": "number",
"exclusiveMinimum": 0,
"maximum": 9999999999
},
"discountPercent": {
"type": "number",
"exclusiveMinimum": 0,
"maximum": 100
}
},
"required": [
"minQuantity"
],
"additionalProperties": false
}
},
{
"type": "null"
}
]
}
},
"required": [
"label",
"unitPrice"
],
"additionalProperties": false
}
},
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Identifiant du produit"
},
"idempotency_key": {
"description": "Clé d'idempotence (recommandée) : rejouer la MÊME mutation avec la même clé renvoie la réponse originale sans ré-exécuter - TTL 24 h",
"type": "string",
"minLength": 1,
"maxLength": 200
}
},
"required": [
"id"
],
"additionalProperties": false
}