Aggiorna prodotto
Aggiorna un prodotto (il body POST è parziale). Richiede una chiave Write.
POST
/products/{productId}Autorizzazione
AutorizzazioneToken Bearer (API key) · headerobbligatorioChiave API dell'organizzazione.
Parametri path
productIdstringobbligatorioCorpo della richiesta
obbligatorioapplication/jsonnamestringpricenumberPrezzo in centesimi
taxCategorystringConsentiti:
8.12.63.80supplierstringcategorystringdeclarationsstringbarcodestringNormalizzato in minuscolo; se vuoto diventa l'id del documento
barcodeAliasesobject[]Optional additional EANs. Empty array removes the field. Available when the barcode aliases feature is enabled for the organization.
Mostra proprietàNascondi proprietà
Array of
objectcodestringobbligatorioquantitynumberpriceintegerOptional pack price in cents
labelstringexternalIdstringOptional external article ID
externalIdstringdepositProductnumberCauzione in centesimi
depositProductLabelstringdescriptionstringsalePricenumber | nullPrezzo promo in centesimi. Null o stringa vuota rimuove il campo.
salePercentagenumber | nullSconto promo in percentuale. Null o stringa vuota rimuove il campo.
salePriceDateFromstring<date-time> | nullInizio della promo. Null o stringa vuota rimuove il campo.
salePriceDateTostring<date-time> | nullFine della promo. Null o stringa vuota rimuove il campo.
costPricenumbermarginnumbershowOnScreenbooleanageRestrictionbooleanshowOnScalebooleansaleStopbooleandeactivatedbooleanimageUrlstringImage URL. Empty string clears the field and deletes the stored asset when it belongs to this organization (same as DELETE /products/{productId}/image).
indexnumberdeletedbooleanImposta true per il soft-delete.
Risposte
200Aggiornato
successbooleanobbligatorio400Richiesta non valida
statusCodeintegerobbligatorioCodice di stato HTTP
messagestringobbligatorioMessaggio di errore leggibile
timestampstring<date-time>obbligatoriopathstringobbligatorioPercorso della richiesta
403Non autorizzato
statusCodeintegerobbligatorioCodice di stato HTTP
messagestringobbligatorioMessaggio di errore leggibile
timestampstring<date-time>obbligatoriopathstringobbligatorioPercorso della richiesta
404Not found
statusCodeintegerobbligatorioCodice di stato HTTP
messagestringobbligatorioMessaggio di errore leggibile
timestampstring<date-time>obbligatoriopathstringobbligatorioPercorso della richiesta
Richiesta
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",
"barcodeAliases": [
{
"code": "string",
"quantity": 0,
"price": 0,
"label": "string",
"externalId": "string"
}
],
"externalId": "string",
"depositProduct": 0,
"depositProductLabel": "string",
"description": "string",
"salePrice": 0,
"salePercentage": 0,
"salePriceDateFrom": "2019-08-24T14:15:22Z",
"salePriceDateTo": "2019-08-24T14:15:22Z",
"costPrice": 0,
"margin": 0,
"showOnScreen": true,
"ageRestriction": true,
"showOnScale": true,
"saleStop": true,
"deactivated": true,
"imageUrl": "string",
"index": 0,
"deleted": true
}'const response = await fetch("https://dashboard.scango.ch/api/v1/products/string", {
method: "POST",
headers: {
"Autorizzazione": "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",
"barcodeAliases": [
{
"code": "string",
"quantity": 0,
"price": 0,
"label": "string",
"externalId": "string"
}
],
"externalId": "string",
"depositProduct": 0,
"depositProductLabel": "string",
"description": "string",
"salePrice": 0,
"salePercentage": 0,
"salePriceDateFrom": "2019-08-24T14:15:22Z",
"salePriceDateTo": "2019-08-24T14:15:22Z",
"costPrice": 0,
"margin": 0,
"showOnScreen": true,
"ageRestriction": true,
"showOnScale": true,
"saleStop": true,
"deactivated": true,
"imageUrl": "string",
"index": 0,
"deleted": true
})
});Risposta
{
"success": true
}{
"statusCode": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22Z",
"path": "string"
}{
"statusCode": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22Z",
"path": "string"
}{
"statusCode": 0,
"message": "string",
"timestamp": "2019-08-24T14:15:22Z",
"path": "string"
}