Obtenir un produit par ID
Récupère un produit par id.
GET
/products/{productId}Autorisation
AutorisationJeton Bearer (API key) · headerobligatoireClé API de l’organisation.
Paramètres de chemin
productIdstringobligatoireRéponses
200Détails du produit
dataProductobligatoireProduit. Les champs monétaires sont des entiers en centimes.
Afficher les propriétésMasquer les propriétés
idstringId du document produit
externalIdstringIdentifiant externe optionnel
namestringpriceintegerPrix en centimes.
supplierstringId du fournisseur
taxCategorystringCode de catégorie TVA suisse
Autorisé:
8.12.63.80categorystringId de la catégorie
declarationsstringbarcodestringbarcodeAliasesobject[]Optional additional EANs. Absent when unused. Empty array is not persisted. Available when the barcode aliases feature is enabled for the organization.
Afficher les propriétésMasquer les propriétés
Array of
objectcodestringobligatoireAdditional EAN, lowercased like barcode
quantitynumberBase units represented by this code. Defaults to 1.
priceintegerOptional pack price in cents
labelstringexternalIdstringOptional external article ID
depositProductintegerConsigne en centimes.
depositProductLabelstringdescriptionstringsalePriceintegerPrix de vente promotionnel en centimes.
salePercentagenumbersalePriceDateFromstring<date-time>salePriceDateTostring<date-time>costPriceintegerPrix de revient en centimes.
marginnumbershowOnScreenbooleanageRestrictionbooleanshowOnScalebooleansaleStopbooleandeactivatedbooleanopenInputbooleanimageUrlstringURL de l’image. Définir via create/update produit ou POST /products/{productId}/image. Une chaîne vide à la mise à jour efface le champ et supprime le stockage de l’organisation.
indexintegerallowStorestring[]Ids de magasins autorisés (lecture seule).
hideStorestring[]Ids de magasins masqués (lecture seule).
deletedbooleanSupprimé logiquement lorsque true.
createdatestring<date-time>lastupdatestring<date-time>instancestringId de l’organisation lorsqu’il est présent
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 GET "https://dashboard.scango.ch/api/v1/products/string" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://dashboard.scango.ch/api/v1/products/string", {
method: "GET",
headers: {
"Autorisation": "Bearer YOUR_TOKEN"
}
});Réponse
{
"data": {
"id": "string",
"externalId": "string",
"name": "string",
"price": 0,
"supplier": "string",
"taxCategory": "8.1",
"category": "string",
"declarations": "string",
"barcode": "string",
"barcodeAliases": [
{
"code": "string",
"quantity": 0,
"price": 0,
"label": "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,
"openInput": true,
"imageUrl": "string",
"index": 0,
"allowStore": [
"string"
],
"hideStore": [
"string"
],
"deleted": true,
"createdate": "2019-08-24T14:15:22Z",
"lastupdate": "2019-08-24T14:15:22Z",
"instance": "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"
}