Exemples par type de promotion
Ce guide présente des exemples concrets d'utilisation du schéma de promotion pour différents cas d'usage.
Réduction en pourcentage
Exemple : "-30% sur la catégorie beauté"
Champs clés
| Champ | Exemple |
|---|---|
categoriePromotion | "PRODUIT_CATEGORIE" |
typePromotion | "POURCENTAGE" |
valeurPromotion | 30 |
uniteValeur | "PERCENT" |
description | "Offre -30% sur la catégorie beauté" |
idProduit | null (promo sur la catégorie entière) |
autoAppliquee | true |
dateDebut | 2025-11-01 |
dateFin | 2025-11-10 |
applicationCreatrice | "PROMOTION" |
applicationsConcernees | ["E-COMMERCE"] |
Exemple de requête API
{
"categoriePromotion": "PRODUIT_CATEGORIE",
"typePromotion": "POURCENTAGE",
"idClient": [],
"idProduit": [],
"idMagasin": [],
"valeurPromotion": 30,
"uniteValeur": "PERCENT",
"autoAppliquee": true,
"seuilMontant": null,
"quantiteAchat": null,
"description": "Offre -30% sur la catégorie beauté",
"categorieProduit": null,
"dateDebut": "2025-11-01T00:00:00.000Z",
"dateFin": "2025-11-10T23:59:59.999Z",
"applicationCreatrice": "PROMOTION",
"applicationConcernee": "E-COMMERCE"
}
Réduction à montant fixe
Exemple : "-10€ sur le panier dès 50€"
Champs clés
| Champ | Exemple |
|---|---|
categoriePromotion | "PANIER" |
typePromotion | "MONTANT_FIXE" |
valeurPromotion | 10 |
uniteValeur | "EURO" |
seuilMontant | 5000 (en centimes = 50€) |
description | "10€ de réduction dès 50€ d'achat" |
autoAppliquee | true |
applicationCreatrice | "PROMOTION" |
applicationsConcernees | ["E-COMMERCE"] |
Exemple de requête API
{
"categoriePromotion": "PANIER",
"typePromotion": "MONTANT_FIXE",
"idClient": [],
"idProduit": [],
"idMagasin": [],
"valeurPromotion": 10,
"uniteValeur": "EURO",
"autoAppliquee": true,
"seuilMontant": 5000,
"quantiteAchat": null,
"description": "10€ de réduction dès 50€ d'achat",
"categorieProduit": null,
"dateDebut": "2025-12-01T00:00:00.000Z",
"dateFin": "2025-12-10T23:59:59.999Z",
"applicationCreatrice": "PROMOTION",
"applicationConcernee": "E-COMMERCE"
}
Note :
seuilMontantest en centimes (5000 = 50€)
Buy X Get Y (produit offert ou remisé)
Exemple : "2 achetés = 1 offert"
Champs clés
| Champ | Exemple |
|---|---|
categoriePromotion | "PRODUIT" |
typePromotion | "PRODUIT_OFFERT" |
quantiteAchat | 2 |
valeurPromotion | 100 |
uniteValeur | "PERCENT" |
idProduit | ['SKU123', 'SKU456'] |
description | "2 achetés = 1 offert sur les shampoings" |
autoAppliquee | true |
Exemple de requête API
{
"categoriePromotion": "PRODUIT",
"typePromotion": "PRODUIT_OFFERT",
"idClient": [],
"idProduit": ["SKU123", "SKU456"],
"idMagasin": [],
"valeurPromotion": 100,
"uniteValeur": "PERCENT",
"autoAppliquee": true,
"seuilMontant": null,
"quantiteAchat": 2,
"description": "2 achetés = 1 offert sur les shampoings",
"categorieProduit": null,
"dateDebut": "2025-10-15T00:00:00.000Z",
"dateFin": "2025-10-30T23:59:59.999Z",
"applicationCreatrice": "PROMOTION",
"applicationConcernee": "MAGASIN"
}
Note :
valeurPromotion: 100signifie 100% offert (produit gratuit)
Seuil panier
Exemple : "-15% dès 100€ d'achat"
Champs clés
| Champ | Exemple |
|---|---|
categoriePromotion | "PANIER" |
typePromotion | "SEUIL_PANIER" |
valeurPromotion | 15 |
uniteValeur | "PERCENT" |
seuilMontant | 10000 (en centimes = 100€) |
description | "15% dès 100€ d'achat" |
autoAppliquee | true |
Exemple de requête API
{
"categoriePromotion": "PANIER",
"typePromotion": "SEUIL_PANIER",
"idClient": [],
"idProduit": [],
"idMagasin": [],
"valeurPromotion": 15,
"uniteValeur": "PERCENT",
"autoAppliquee": true,
"seuilMontant": 10000,
"quantiteAchat": null,
"description": "15% dès 100€ d'achat",
"categorieProduit": null,
"dateDebut": "2025-11-05T00:00:00.000Z",
"dateFin": "2025-11-30T23:59:59.999Z",
"applicationCreatrice": "PROMOTION",
"applicationConcernee": "E-COMMERCE"
}
Note :
seuilMontantest en centimes (10000 = 100€)
Promo fidélité / membre
Exemple : "10% pour les membres Gold"
Champs clés
| Champ | Exemple |
|---|---|
categoriePromotion | "FIDELITE" |
typePromotion | "POURCENTAGE" |
valeurPromotion | 10 |
uniteValeur | "PERCENT" |
idClient | ['C123', 'C456'] |
description | "10% pour les membres Gold" |
autoAppliquee | true |
Exemple de requête API
{
"categoriePromotion": "FIDELITE",
"typePromotion": "POURCENTAGE",
"idClient": ["C123", "C456"],
"idProduit": [],
"idMagasin": [],
"valeurPromotion": 10,
"uniteValeur": "PERCENT",
"autoAppliquee": true,
"seuilMontant": null,
"quantiteAchat": null,
"description": "10% pour les membres Gold",
"categorieProduit": null,
"dateDebut": "2025-11-01T00:00:00.000Z",
"dateFin": "2025-12-01T23:59:59.999Z",
"applicationCreatrice": "PROMOTION",
"applicationConcernee": "FIDELITE"
}
Promo événementielle / saisonnière
Exemple : "Black Friday : -50% sur tout le site"
✅ Champs clés
| Champ | Exemple |
|---|---|
categoriePromotion | "EVENT" |
typePromotion | "POURCENTAGE" |
valeurPromotion | 50 |
uniteValeur | "PERCENT" |
description | "Black Friday : -50% sur tout le site" |
autoAppliquee | true |
Exemple de requête API
{
"categoriePromotion": "EVENT",
"typePromotion": "POURCENTAGE",
"idClient": [],
"idProduit": [],
"idMagasin": [],
"valeurPromotion": 50,
"uniteValeur": "PERCENT",
"autoAppliquee": true,
"seuilMontant": null,
"quantiteAchat": null,
"description": "Black Friday : -50% sur tout le site",
"categorieProduit": null,
"dateDebut": "2025-11-29T00:00:00.000Z",
"dateFin": "2025-11-30T23:59:59.999Z",
"applicationCreatrice": "PROMOTION",
"applicationConcernee": "E-COMMERCE"
}
Promo ciblée par catégorie de produit
Exemple : "-30% sur tous les produits de la catégorie image_son"
Champs clés
| Champ | Exemple |
|---|---|
categoriePromotion | "PRODUIT_CATEGORIE" |
typePromotion | "POURCENTAGE" |
valeurPromotion | 30 |
uniteValeur | "PERCENT" |
categorieProduit | "image_son" |
description | "30% de réduction sur tous les produits image et son" |
autoAppliquee | true |
Exemple de requête API
{
"categoriePromotion": "PRODUIT_CATEGORIE",
"typePromotion": "POURCENTAGE",
"idClient": [],
"idProduit": [],
"idMagasin": [],
"valeurPromotion": 30,
"uniteValeur": "PERCENT",
"autoAppliquee": true,
"seuilMontant": null,
"quantiteAchat": null,
"description": "30% de réduction sur tous les produits image et son",
"categorieProduit": "image_son",
"dateDebut": "2025-11-15T00:00:00.000Z",
"dateFin": "2025-11-30T23:59:59.999Z",
"applicationCreatrice": "PROMOTION",
"applicationConcernee": "E-COMMERCE"
}
⚠️ Important : La catégorie
image_sondoit exister dans le référentiel produit, sinon l'API retournera une erreur avec la liste des catégories disponibles.
📋 Récapitulatif des enums
Catégories de promotion
EVENT: Campagnes, événements commerciauxDESTOCKAGE: Fins de série, liquidationsFIDELITE: Promos liées aux membres / clients fidèlesPANIER: Promos déclenchées par le panierPRODUIT: Promos sur un ou plusieurs produits précisPRODUIT_CATEGORIE: Promos sur une catégorie entière
Types de promotion
POURCENTAGE: Réduction en pourcentage (-X%)MONTANT_FIXE: Réduction à montant fixe (-X€)PRODUIT_OFFERT: Buy X Get YSEUIL_PANIER: Réduction dès un certain montant (-X% ou -X€ dès Y€)
Unités de valeur
PERCENT: Pourcentage (%)EURO: Euro (€)
Applications créatrices
PROMOTION: Application de gestion des promotionsFIDELITE: Application de fidélitéMAGASIN: Application magasinE-COMMERCE: Application e-commerce
Applications concernées
FIDELITE: Application de fidélitéMAGASIN: Application magasinE-COMMERCE: Application e-commerce
Note :
applicationsConcerneesest un tableau qui peut contenir plusieurs applications.
Champs spécifiques
seuilMontant: Montant en centimes (ex: 5000 = 50€)quantiteAchat: Nombre de produits à acheter pour déclencher la promocategorieProduit: Catégorie de produit ciblée (ex: "electromenager", "gaming")- ⚠️ Validation : La catégorie doit exister dans le référentiel produit
- Les catégories disponibles sont récupérées depuis
/api/private/produits - En cas de catégorie invalide, l'API retourne une erreur avec la liste des catégories valides
autoAppliquee:true= appliquée automatiquement,false= nécessite une activation manuelle
Validations automatiques
Le système effectue plusieurs validations lors de la création/modification d'une promotion :
- Validation des IDs clients : Vérifie que chaque ID client existe via
/api/private/clients/{id} - Validation des IDs produits : Vérifie que chaque ID produit existe via
/api/private/produits/{id} - Validation des IDs magasins : Vérifie que chaque ID magasin existe via
/api/private/magasins/{id} - Validation de la catégorie produit : Vérifie que la catégorie existe dans le référentiel
- Backend : Appel API au référentiel pour récupérer toutes les catégories
- Frontend : Autocomplétion avec liste déroulante des catégories disponibles
Note : Les validations sont effectuées côté backend ET frontend pour une meilleure expérience utilisateur.