Mettre à jour un produit
Met à jour un produit (corps POST partiel). Nécessite une clé Write.
POST
/products/{productId}Autorisation
AutorisationJeton Bearer (API key) · headerobligatoireClé API de l’organisation.
Paramètres de chemin
productIdstringobligatoireCorps de la requête
obligatoireapplication/jsonnamestringpricenumberPrix en centimes
taxCategorystringAutorisé:
8.12.63.80supplierstringcategorystringdeclarationsstringbarcodestringNormalisé en minuscules ; vide devient l’id du document
externalIdstringdepositProductnumberConsigne en centimes
depositProductLabelstringdescriptionstringsalePricenumbersalePercentagenumbersalePriceDateFromstring<date-time>salePriceDateTostring<date-time>costPricenumbermarginnumbershowOnScreenbooleanageRestrictionbooleanshowOnScalebooleansaleStopbooleanindexnumberdeletedbooleanMettre à true pour une suppression logique.
Réponses
200Mis à jour
successbooleanobligatoire400Requête incorrecte
statusCodeintegerobligatoireCode de statut HTTP
messagestringobligatoireMessage d’erreur lisible
timestampstring<date-time>obligatoirepathstringobligatoireChemin de la requête
403Non autorisé
statusCodeintegerobligatoireCode de statut HTTP
messagestringobligatoireMessage d’erreur lisible
timestampstring<date-time>obligatoirepathstringobligatoireChemin de la requête
404Not found
statusCodeintegerobligatoireCode de statut HTTP
messagestringobligatoireMessage d’erreur lisible
timestampstring<date-time>obligatoirepathstringobligatoireChemin de la requête
Requête
curl -X POST "https://dashboard.scango.ch/api/v1/products/string" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"price": 0,
"taxCategory": "8.1",
"supplier": "string",
"category": "string",
"declarations": "string",
"barcode": "string",
"externalId": "string",
"depositProduct": 0,
"depositProductLabel": "string",
"description": "string",
"salePrice": 0,
"salePercentage": 0,
"salePriceDateFrom": "2024-01-01T00:00:00Z",
"salePriceDateTo": "2024-01-01T00:00:00Z",
"costPrice": 0,
"margin": 0,
"showOnScreen": true,
"ageRestriction": true,
"showOnScale": true,
"saleStop": true,
"index": 0,
"deleted": true
}'const response = await fetch("https://dashboard.scango.ch/api/v1/products/string", {
method: "POST",
headers: {
"Autorisation": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "string",
"price": 0,
"taxCategory": "8.1",
"supplier": "string",
"category": "string",
"declarations": "string",
"barcode": "string",
"externalId": "string",
"depositProduct": 0,
"depositProductLabel": "string",
"description": "string",
"salePrice": 0,
"salePercentage": 0,
"salePriceDateFrom": "2024-01-01T00:00:00Z",
"salePriceDateTo": "2024-01-01T00:00:00Z",
"costPrice": 0,
"margin": 0,
"showOnScreen": true,
"ageRestriction": true,
"showOnScale": true,
"saleStop": true,
"index": 0,
"deleted": true
})
});Réponse
{
"success": true
}{
"statusCode": 0,
"message": "string",
"timestamp": "2024-01-01T00:00:00Z",
"path": "string"
}{
"statusCode": 0,
"message": "string",
"timestamp": "2024-01-01T00:00:00Z",
"path": "string"
}{
"statusCode": 0,
"message": "string",
"timestamp": "2024-01-01T00:00:00Z",
"path": "string"
}