Créer un produit
Crée un produit. Nécessite une clé Write.
POST
/productsAutorisation
AutorisationJeton Bearer (API key) · headerobligatoireClé API de l’organisation.
Corps de la requête
obligatoireapplication/jsonnamestringobligatoirepricenumberobligatoirePrix en centimes
taxCategorystringobligatoireAutorisé:
8.12.63.80supplierstringcategorystringdeclarationsstringbarcodestringNormalisé en minuscules ; vide devient l’id du document
externalIdstringdepositProductnumberConsigne en centimes
depositProductLabelstringdescriptionstringsalePricenumbersalePercentagenumbersalePriceDateFromstring<date-time>salePriceDateTostring<date-time>costPricenumbermarginnumbershowOnScreenbooleanageRestrictionbooleanshowOnScalebooleansaleStopbooleanindexnumberRéponses
200Produit créé
successbooleanobligatoireidstringobligatoire400Requê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
Requête
curl -X POST "https://dashboard.scango.ch/api/v1/products" \
-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
}'const response = await fetch("https://dashboard.scango.ch/api/v1/products", {
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
})
});Réponse
{
"success": true,
"id": "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"
}