Aller au contenu

Exemples exécutables

Chaque exemple de cette page est un fichier JSON du dépôt, dans docs-site/src/content/docs/fr/integration/examples/. Ce ne sont pas de simples illustrations : ils sont rejoués par les tests du moteur (go test ./internal/doctests) et validés contre les schémas api/schemas/*.json par l’intégration continue (pnpm -C docs-site check-examples).

{
"title": "…",
"description": "…",
"ticket": { "…": "ticket conforme à ticket.schema.json" },
"offers": [ { "…": "offre publiée conforme à offer.schema.json" } ],
"expect": { "…": "EvaluationResult partiel" }
}
  • ticket : envoyé tel quel au moteur (simulation) ;
  • offers : les offres publiées pour l’exemple (et seulement elles) ;
  • expect : un sous-ensemble du résultat. Un objet attendu est comparé clé par clé ; un tableau attendu doit trouver, dans l’ordre, un élément correspondant pour chacun de ses éléments (pour applied, rejected, lines, la correspondance se fait sur offerCode ou lineNo) ; un tableau vide attendu impose un tableau vide.
  • Contexte supposé par les exemples : workspace en euros, fuseau Europe/Paris, magasin S042 déclaré, compteurs POINTS et VISITS définis, carte 2600000012345 connue ou créée automatiquement.

Pour envoyer un exemple à votre moteur local :

Fenêtre de terminal
jq .ticket docs-site/src/content/docs/fr/integration/examples/ticket-simple.json \
| curl -s http://localhost:47500/v1/transactions/simulate \
-H "X-Api-Key: $RMZ_KEY" -H 'Content-Type: application/json' -d @- | jq .

Ticket simple : -10 % dès 50 € et 1 point par euro

Deux offres cumulées sur deux niveaux. Niveau 0 : -10 % sur le ticket dès 50 €, répartis au prorata des lignes. Niveau 1 : 1 point par tranche de 1 € sur le montant après remises (4 941 cts -> 49 points).

Fichier : src/content/docs/fr/integration/examples/ticket-simple.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000123",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (2)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000001",
"code": "WELCOME10",
"name": "-10 % dès 50 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 5000
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 1000,
"scope": "ticket",
"rounding": "half_up"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
},
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000002",
"code": "PTS-BASE",
"name": "1 point par euro",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "identifie",
"type": "customer_identified",
"params": {}
}
]
},
"actions": [
{
"id": "a1",
"type": "points_per_amount",
"params": {
"counterTypeCode": "POINTS",
"points": 1,
"perCents": 100,
"base": "after_discounts",
"rounding": "down"
}
}
],
"stacking": {
"level": 1,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"status": "ok",
"ticketKey": "S042:03:2026-11-09:000123",
"totals": {
"grossCents": 5490,
"discountCents": 549,
"netCents": 4941
},
"lines": [
{
"lineNo": 1,
"discountCents": 99
},
{
"lineNo": 2,
"discountCents": 450
}
],
"applied": [
{
"offerCode": "WELCOME10",
"valueCents": 549
},
{
"offerCode": "PTS-BASE",
"valueCents": 0
}
],
"pointsMovements": [
{
"counterTypeCode": "POINTS",
"kind": "earn",
"amount": 49
}
]
}

3 achetés, le moins cher offert

Action cheapest_free (groupSize 3, freeCount 1) sur le rayon frais. La baguette porte le drapeau no_promo et n'est pas éligible.

Fichier : src/content/docs/fr/integration/examples/action-cheapest-free.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000204",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 870,
"itemCount": 4
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3033490004743",
"ref": "YAO-NAT",
"name": "Yaourt nature x4",
"rayon": "FRAIS",
"univers": "ALIM",
"qty": 1,
"unitPriceCents": 250,
"lineTotalCents": 250
},
{
"lineNo": 2,
"ean": "3033490004750",
"ref": "YAO-FRU",
"name": "Yaourt fruits x4",
"rayon": "FRAIS",
"univers": "ALIM",
"qty": 1,
"unitPriceCents": 180,
"lineTotalCents": 180
},
{
"lineNo": 3,
"ean": "3033490004767",
"ref": "YAO-GRE",
"name": "Yaourt grec x4",
"rayon": "FRAIS",
"univers": "ALIM",
"qty": 1,
"unitPriceCents": 320,
"lineTotalCents": 320
},
{
"lineNo": 4,
"ean": "3250390001234",
"ref": "BAG",
"name": "Baguette",
"rayon": "BOULANGERIE",
"univers": "ALIM",
"qty": 1,
"unitPriceCents": 120,
"lineTotalCents": 120,
"flags": [
"no_promo"
]
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000013",
"code": "FRAIS3X2",
"name": "Frais : 3 achetés, le moins cher offert",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "frais",
"type": "article_rayon",
"params": {
"codes": [
"FRAIS"
],
"match": {
"minQty": 3
}
}
}
]
},
"actions": [
{
"id": "a1",
"type": "cheapest_free",
"params": {
"target": {
"criterionId": "frais"
},
"groupSize": 3,
"freeCount": 1
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 870,
"discountCents": 180,
"netCents": 690
},
"lines": [
{
"lineNo": 2,
"discountCents": 180
}
],
"applied": [
{
"offerCode": "FRAIS3X2",
"valueCents": 180
}
]
}

Compteur de visites

Action counter_update : +1 visite pour tout ticket identifié de 10 € ou plus.

Fichier : src/content/docs/fr/integration/examples/action-counter-update.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000209",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000019",
"code": "VISITE",
"name": "Compteur de visites",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 1000
}
},
{
"kind": "criterion",
"id": "identifie",
"type": "customer_identified",
"params": {}
}
]
},
"actions": [
{
"id": "a1",
"type": "counter_update",
"params": {
"counterTypeCode": "VISITS",
"op": "increment",
"amount": 1
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"applied": [
{
"offerCode": "VISITE",
"actions": [
{
"type": "counter_update",
"counterTypeCode": "VISITS",
"amount": 1
}
]
}
]
}

Émission de coupon : 5 € pour la prochaine visite

Action coupon_issue (validité glissante 30 jours, code seul). En simulation le coupon est « projected ».

Fichier : src/content/docs/fr/integration/examples/action-coupon-issue.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000210",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000020",
"code": "BON5",
"name": "Dès 50 €, un bon de 5 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 5000
}
}
]
},
"actions": [
{
"id": "a1",
"type": "coupon_issue",
"params": {
"templateId": "0193a1b2-0000-7000-8000-00000000c001",
"quantity": 1,
"validity": {
"mode": "rolling",
"startDelayDays": 1,
"days": 30
},
"render": "none",
"faceValue": {
"kind": "amount_cents",
"value": 500
}
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
},
"coupon": {
"render": "none",
"templateId": null
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"applied": [
{
"offerCode": "BON5",
"valueCents": 0
}
],
"couponsIssued": [
{
"templateId": "0193a1b2-0000-7000-8000-00000000c001",
"state": "projected"
}
]
}

Événement personnalisé : gros panier

Action custom_event : émet un événement client exploitable par les offres « event » et les webhooks.

Fichier : src/content/docs/fr/integration/examples/action-custom-event.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000214",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000024",
"code": "EVT-PANIER",
"name": "Événement gros panier",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 5000
}
},
{
"kind": "criterion",
"id": "identifie",
"type": "customer_identified",
"params": {}
}
]
},
"actions": [
{
"id": "a1",
"type": "custom_event",
"params": {
"eventType": "gros_panier",
"payload": {
"seuilCents": 5000
}
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"applied": [
{
"offerCode": "EVT-PANIER",
"actions": [
{
"type": "custom_event"
}
]
}
]
}

Statut de fidélité : passage en « gold »

Action customer_status (montée de statut seulement), appliquée au commit.

Fichier : src/content/docs/fr/integration/examples/action-customer-status.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000213",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000023",
"code": "GOLD50",
"name": "Passage gold dès 50 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 5000
}
},
{
"kind": "criterion",
"id": "identifie",
"type": "customer_identified",
"params": {}
}
]
},
"actions": [
{
"id": "a1",
"type": "customer_status",
"params": {
"status": "gold",
"onlyUpgrade": true
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"applied": [
{
"offerCode": "GOLD50",
"actions": [
{
"type": "customer_status",
"status": "deferred"
}
]
}
]
}

Étiquette client : acheteur papeterie

Action customer_tag : l'étiquette est posée au commit (statut deferred en simulation).

Fichier : src/content/docs/fr/integration/examples/action-customer-tag.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000212",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000022",
"code": "TAG-PAPET",
"name": "Étiquette acheteur papeterie",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "papet",
"type": "article_rayon",
"params": {
"codes": [
"PAPETERIE"
]
}
},
{
"kind": "criterion",
"id": "identifie",
"type": "customer_identified",
"params": {}
}
]
},
"actions": [
{
"id": "a1",
"type": "customer_tag",
"params": {
"tag": "acheteur-papeterie",
"op": "add"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"applied": [
{
"offerCode": "TAG-PAPET",
"actions": [
{
"type": "customer_tag",
"status": "deferred"
}
]
}
]
}

Remise en euros : -5 € dès 30 €

Action discount_amount au niveau du ticket (scope ticket).

Fichier : src/content/docs/fr/integration/examples/action-discount-amount.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000201",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000010",
"code": "MOINS5",
"name": "-5 € dès 30 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 3000
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_amount",
"params": {
"amountCents": 500,
"scope": "ticket"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 500,
"netCents": 4990
},
"applied": [
{
"offerCode": "MOINS5",
"valueCents": 500
}
]
}

Prix barré : le stylo plume à 39 €

Action discount_fixed_price : la remise est la différence entre le prix unitaire et le prix cible.

Fichier : src/content/docs/fr/integration/examples/action-discount-fixed-price.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000203",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000012",
"code": "STYLO39",
"name": "Stylo plume à 39 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "stylo",
"type": "article_ref",
"params": {
"refs": [
"STB001"
]
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_fixed_price",
"params": {
"priceCents": 3900,
"target": {
"criterionId": "stylo"
}
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 600,
"netCents": 4890
},
"lines": [
{
"lineNo": 2,
"discountCents": 600
}
],
"applied": [
{
"offerCode": "STYLO39",
"valueCents": 600
}
]
}

Remise en % sur un univers : -20 % sur l'alimentaire

Critère article_univers dont les lignes éligibles sont ciblées par l'action (target.criterionId).

Fichier : src/content/docs/fr/integration/examples/action-discount-percent-lines.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000202",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000011",
"code": "ALIM20",
"name": "-20 % sur l'alimentaire",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "alim",
"type": "article_univers",
"params": {
"codes": [
"ALIM"
]
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 2000,
"scope": "lines",
"target": {
"criterionId": "alim"
}
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 198,
"netCents": 5292
},
"lines": [
{
"lineNo": 1,
"discountCents": 198
}
],
"applied": [
{
"offerCode": "ALIM20",
"valueCents": 198
}
]
}

Produit offert : un soda pour 2 pâtes à tartiner

Action free_product en mode add_line : la caisse ajoute la ligne à 0 € (drapeau remizo_free_product).

Fichier : src/content/docs/fr/integration/examples/action-free-product.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000205",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000014",
"code": "SODA-OFFERT",
"name": "Un soda offert pour 2 pâtes à tartiner",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "nut",
"type": "article_ref",
"params": {
"refs": [
"NUT750"
],
"match": {
"minQty": 2
}
}
}
]
},
"actions": [
{
"id": "a1",
"type": "free_product",
"params": {
"product": {
"ean": "5449000000996",
"ref": "SODA33",
"name": "Soda 33 cl"
},
"qty": 1,
"mode": "add_line"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 0,
"netCents": 5490
},
"addedLines": [
{
"ean": "5449000000996",
"qty": 1,
"unitPriceCents": 0
}
],
"applied": [
{
"offerCode": "SODA-OFFERT"
}
]
}

Prix du lot : 2 pâtes à tartiner pour 8 €

Critère article_lot (sélecteur en ligne) et action lot_price : remise = total des unités du lot - prix du lot.

Fichier : src/content/docs/fr/integration/examples/action-lot-price.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000206",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000015",
"code": "LOT2NUT",
"name": "2 pâtes à tartiner pour 8 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "lot",
"type": "article_lot",
"params": {
"components": [
{
"selector": {
"kind": "criterion",
"id": "nut",
"type": "article_ref",
"params": {
"refs": [
"NUT750"
]
}
},
"qty": 2
}
],
"minLots": 1
}
}
]
},
"actions": [
{
"id": "a1",
"type": "lot_price",
"params": {
"lotCriterionId": "lot",
"lotPriceCents": 800
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 190,
"netCents": 5300
},
"lines": [
{
"lineNo": 1,
"discountCents": 190
}
],
"applied": [
{
"offerCode": "LOT2NUT",
"valueCents": 190
}
]
}

Message ticket

Action message : texte imprimé sur le ticket (placeholders résolus par le moteur).

Fichier : src/content/docs/fr/integration/examples/action-message.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000211",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000021",
"code": "MERCI",
"name": "Message de remerciement",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "identifie",
"type": "customer_identified",
"params": {}
}
]
},
"actions": [
{
"id": "a1",
"type": "message",
"params": {
"placement": "ticket",
"text": {
"fr": "Merci de votre fidélité !",
"en": "Thank you for your loyalty!"
}
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"applied": [
{
"offerCode": "MERCI"
}
],
"messages": [
{
"text": "Merci de votre fidélité !",
"placement": "ticket"
}
]
}

Points fixes : le lundi, 50 points offerts

Action points_fixed, critères jour de la semaine et client identifié (le 09/11/2026 est un lundi).

Fichier : src/content/docs/fr/integration/examples/action-points-fixed.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000207",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000016",
"code": "LUNDI50",
"name": "Le lundi, 50 points offerts",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "lundi",
"type": "weekdays",
"params": {
"days": [
"mon"
]
}
},
{
"kind": "criterion",
"id": "identifie",
"type": "customer_identified",
"params": {}
}
]
},
"actions": [
{
"id": "a1",
"type": "points_fixed",
"params": {
"counterTypeCode": "POINTS",
"amount": 50
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"applied": [
{
"offerCode": "LUNDI50",
"valueCents": 0
}
],
"pointsMovements": [
{
"counterTypeCode": "POINTS",
"kind": "earn",
"amount": 50
}
]
}

Points doublés le lundi

Niveau 0 : 1 point par euro sur le brut (5 490 cts -> 54 points, arrondi inférieur). Niveau 1 : points_multiplier x2 sur les points acquis aux niveaux inférieurs (+54).

Fichier : src/content/docs/fr/integration/examples/action-points-multiplier.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000208",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (2)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000017",
"code": "PTS-BRUT",
"name": "1 point par euro",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "identifie",
"type": "customer_identified",
"params": {}
}
]
},
"actions": [
{
"id": "a1",
"type": "points_per_amount",
"params": {
"counterTypeCode": "POINTS",
"points": 1,
"perCents": 100,
"base": "gross",
"rounding": "down"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
},
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000018",
"code": "X2-LUNDI",
"name": "Points x2 le lundi",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "lundi",
"type": "weekdays",
"params": {
"days": [
"mon"
]
}
}
]
},
"actions": [
{
"id": "a1",
"type": "points_multiplier",
"params": {
"counterTypeCode": "POINTS",
"multiplierBp": 20000,
"appliesTo": "all_earned"
}
}
],
"stacking": {
"level": 1,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"applied": [
{
"offerCode": "PTS-BRUT",
"actions": [
{
"type": "points_per_amount",
"amount": 54
}
]
},
{
"offerCode": "X2-LUNDI",
"actions": [
{
"type": "points_multiplier",
"amount": 54
}
]
}
]
}

Cumul « best_line » : la meilleure remise par ligne

Deux offres en mode best_line sur la même ligne : -20 % (198) bat le prix unitaire à 4 € (190) ; la perdante n'a plus de ligne et est rejetée (lost_best_line).

Fichier : src/content/docs/fr/integration/examples/cumul-best-line.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000303",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (2)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000034",
"code": "ALIM20",
"name": "-20 % sur l'alimentaire",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "alim",
"type": "article_univers",
"params": {
"codes": [
"ALIM"
]
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 2000,
"scope": "lines",
"target": {
"criterionId": "alim"
}
}
}
],
"stacking": {
"level": 0,
"mode": "best_line",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
},
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000035",
"code": "NUT4",
"name": "Pâte à tartiner à 4 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "nut",
"type": "article_ref",
"params": {
"refs": [
"NUT750"
]
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_fixed_price",
"params": {
"priceCents": 400,
"target": {
"criterionId": "nut"
}
}
}
],
"stacking": {
"level": 0,
"mode": "best_line",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 198,
"netCents": 5292
},
"lines": [
{
"lineNo": 1,
"discountCents": 198
}
],
"applied": [
{
"offerCode": "ALIM20",
"valueCents": 198
}
],
"rejected": [
{
"offerCode": "NUT4",
"reason": "lost_best_line",
"byOfferId": "0193a1b2-0000-7000-8000-000000000034"
}
]
}

Cumul « best_offer » : la meilleure offre gagne

Deux offres de niveau 0 en mode best_offer : -10 % (549) bat -5 € (500), la perdante est rejetée avec la raison lost_best_offer.

Fichier : src/content/docs/fr/integration/examples/cumul-best-offer.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000302",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (2)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000032",
"code": "MOINS5",
"name": "-5 € dès 30 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 3000
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_amount",
"params": {
"amountCents": 500,
"scope": "ticket"
}
}
],
"stacking": {
"level": 0,
"mode": "best_offer",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
},
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000033",
"code": "WELCOME10",
"name": "-10 % dès 50 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 5000
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 1000,
"scope": "ticket"
}
}
],
"stacking": {
"level": 0,
"mode": "best_offer",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 549,
"netCents": 4941
},
"applied": [
{
"offerCode": "WELCOME10",
"valueCents": 549
}
],
"rejected": [
{
"offerCode": "MOINS5",
"reason": "lost_best_offer",
"byOfferId": "0193a1b2-0000-7000-8000-000000000033"
}
]
}

Cumul « cumulative » : deux offres au même niveau

Les deux offres de niveau 0 en mode cumulative s'appliquent, calculées sur le même ticket de départ (500 + 99 = 599).

Fichier : src/content/docs/fr/integration/examples/cumul-cumulative.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000301",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (2)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000030",
"code": "MOINS5",
"name": "-5 € dès 30 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 3000
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_amount",
"params": {
"amountCents": 500,
"scope": "ticket"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 200
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
},
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000031",
"code": "ALIM10",
"name": "-10 % sur l'alimentaire",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "alim",
"type": "article_univers",
"params": {
"codes": [
"ALIM"
]
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 1000,
"scope": "lines",
"target": {
"criterionId": "alim"
}
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 599,
"netCents": 4891
},
"applied": [
{
"offerCode": "MOINS5",
"valueCents": 500
},
{
"offerCode": "ALIM10",
"valueCents": 99
}
],
"rejected": []
}

Exclusions entre offres

MOINS5 exclut ALIM10 (relation symétrique) : l'offre de priorité la plus basse est rejetée (excluded_by).

Fichier : src/content/docs/fr/integration/examples/cumul-exclusions.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000306",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (2)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000040",
"code": "MOINS5",
"name": "-5 € dès 30 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 3000
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_amount",
"params": {
"amountCents": 500,
"scope": "ticket"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 200,
"exclusions": [
"0193a1b2-0000-7000-8000-000000000041"
]
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
},
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000041",
"code": "ALIM10",
"name": "-10 % sur l'alimentaire",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "alim",
"type": "article_univers",
"params": {
"codes": [
"ALIM"
]
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 1000,
"scope": "lines",
"target": {
"criterionId": "alim"
}
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 500,
"netCents": 4990
},
"applied": [
{
"offerCode": "MOINS5",
"valueCents": 500
}
],
"rejected": [
{
"offerCode": "ALIM10",
"reason": "excluded_by",
"byOfferId": "0193a1b2-0000-7000-8000-000000000040"
}
]
}

Offre exclusive : bloque les niveaux supérieurs

L'offre de niveau 0 est exclusive : une fois appliquée, l'offre de niveau 1 est rejetée (exclusive_applied).

Fichier : src/content/docs/fr/integration/examples/cumul-exclusive.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000305",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (2)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000038",
"code": "PAPET15",
"name": "-15 % papeterie (exclusive)",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "papet",
"type": "article_rayon",
"params": {
"codes": [
"PAPETERIE"
]
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 1500,
"scope": "lines",
"target": {
"criterionId": "papet"
}
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100,
"exclusive": true
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
},
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000039",
"code": "MOINS5",
"name": "-5 € dès 30 €",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "gross",
"minCents": 3000
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_amount",
"params": {
"amountCents": 500,
"scope": "ticket"
}
}
],
"stacking": {
"level": 1,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 675,
"netCents": 4815
},
"lines": [
{
"lineNo": 2,
"discountCents": 675
}
],
"applied": [
{
"offerCode": "PAPET15",
"valueCents": 675
}
],
"rejected": [
{
"offerCode": "MOINS5",
"reason": "exclusive_applied",
"byOfferId": "0193a1b2-0000-7000-8000-000000000038"
}
]
}

Niveaux d'exécution : le niveau 1 travaille après remises

Niveau 0 : -10 % (549). Niveau 1 : -10 % calculé sur 4 941 cts, soit 494 (arrondi half_up). Total 1 043.

Fichier : src/content/docs/fr/integration/examples/cumul-niveaux.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000304",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (2)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000036",
"code": "N0-10",
"name": "Niveau 0 : -10 %",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": []
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 1000,
"scope": "ticket"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
},
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000037",
"code": "N1-10",
"name": "Niveau 1 : -10 % supplémentaires",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": []
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 1000,
"scope": "ticket",
"rounding": "half_up"
}
}
],
"stacking": {
"level": 1,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 1043,
"netCents": 4447
},
"applied": [
{
"offerCode": "N0-10",
"level": 0,
"valueCents": 549
},
{
"offerCode": "N1-10",
"level": 1,
"valueCents": 494
}
]
}

Panier e-commerce : -15 % dès 80 € sur le site

Ticket de canal web (posId = identifiant du site, ticketNumber = numéro de commande).

Fichier : src/content/docs/fr/integration/examples/ecommerce-panier.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "CMD-2026-004512",
"storeCode": "WEB",
"posId": "SHOP",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T21:05:00+01:00",
"channel": "web",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 8990,
"itemCount": 2
},
"externalRef": "cart_8f2c1"
},
"customer": {
"identifiers": [
{
"type": "web_account",
"value": "WA-778812"
}
],
"autoCreateCard": false
},
"lines": [
{
"lineNo": 1,
"ref": "SAC-CUIR",
"name": "Sac cuir",
"univers": "MODE",
"qty": 1,
"unitPriceCents": 7990,
"lineTotalCents": 7990
},
{
"lineNo": 2,
"ref": "LIVRAISON",
"name": "Livraison",
"qty": 1,
"unitPriceCents": 1000,
"lineTotalCents": 1000,
"flags": [
"fee"
]
}
],
"payments": [
{
"method": "card",
"amountCents": 8990,
"brand": "cb"
}
]
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000043",
"code": "WEB15",
"name": "-15 % dès 80 € sur le site",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "web",
"type": "channel",
"params": {
"channels": [
"web"
]
}
},
{
"kind": "criterion",
"id": "montant",
"type": "ticket_amount",
"params": {
"base": "eligible",
"minCents": 7000
}
},
{
"kind": "criterion",
"id": "mode",
"type": "article_univers",
"params": {
"codes": [
"MODE"
]
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 1500,
"scope": "lines",
"target": {
"criterionId": "mode"
},
"rounding": "half_up"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 8990,
"discountCents": 1199,
"netCents": 7791
},
"lines": [
{
"lineNo": 1,
"discountCents": 1199
}
],
"applied": [
{
"offerCode": "WEB15",
"valueCents": 1199
}
]
}

Offre refusée : critère non rempli

L'offre est réservée au canal web ; le ticket vient de la caisse. Elle est rejetée avec la raison criteria_not_met et le critère en cause.

Fichier : src/content/docs/fr/integration/examples/refus-critere.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000307",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": []
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000042",
"code": "WEB10",
"name": "-10 % sur le site",
"status": "published",
"version": 1,
"trigger": {
"type": "transaction"
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": [
{
"kind": "criterion",
"id": "web",
"type": "channel",
"params": {
"channels": [
"web",
"app"
]
}
}
]
},
"actions": [
{
"id": "a1",
"type": "discount_percent",
"params": {
"percentBp": 1000,
"scope": "ticket"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 0,
"netCents": 5490
},
"applied": [],
"rejected": [
{
"offerCode": "WEB10",
"reason": "criteria_not_met",
"criterionId": "web",
"criterionType": "channel"
}
]
}

Code promo présenté en caisse

Déclencheur coupon avec un code statique : l'offre ne s'évalue que si le code est présenté.

Fichier : src/content/docs/fr/integration/examples/trigger-coupon-code.json

Ticket
{
"schemaVersion": "1",
"header": {
"ticketNumber": "000215",
"storeCode": "S042",
"posId": "03",
"businessDate": "2026-11-09",
"timestamp": "2026-11-09T10:42:13+01:00",
"channel": "pos",
"currency": "EUR",
"locale": "fr",
"totals": {
"grossCents": 5490,
"itemCount": 3
}
},
"customer": {
"identifiers": [
{
"type": "card",
"value": "2600000012345"
}
],
"autoCreateCard": true
},
"lines": [
{
"lineNo": 1,
"ean": "3017620422003",
"ref": "NUT750",
"name": "Pâte à tartiner 750 g",
"category": "PATE-TARTINER",
"rayon": "EPICERIE",
"univers": "ALIM",
"brand": "Ferrero",
"qty": 2,
"unitPriceCents": 495,
"lineTotalCents": 990,
"taxRateBp": 550
},
{
"lineNo": 2,
"ean": "4006381333931",
"ref": "STB001",
"name": "Stylo plume",
"category": "STYLOS",
"rayon": "PAPETERIE",
"univers": "MAISON",
"brand": "Stabilo",
"qty": 1,
"unitPriceCents": 4500,
"lineTotalCents": 4500,
"taxRateBp": 2000
}
],
"payments": [],
"coupons": [
{
"code": "BIENVENUE5",
"source": "typed"
}
]
}
Offres (1)
[
{
"schemaVersion": "1",
"id": "0193a1b2-0000-7000-8000-000000000025",
"code": "CODE-BIENV",
"name": "Code BIENVENUE5 : -5 €",
"status": "published",
"version": 1,
"trigger": {
"type": "coupon",
"coupon": {
"codes": [
"BIENVENUE5"
],
"redeem": true
}
},
"criteria": {
"kind": "group",
"id": "root",
"op": "and",
"children": []
},
"actions": [
{
"id": "a1",
"type": "discount_amount",
"params": {
"amountCents": 500,
"scope": "ticket"
}
}
],
"stacking": {
"level": 0,
"mode": "cumulative",
"priority": 100
},
"validity": {
"from": "2026-01-01T00:00:00+01:00",
"to": null,
"timezone": "Europe/Paris"
}
}
]
Résultat attendu (partiel)
{
"mode": "simulate",
"totals": {
"grossCents": 5490,
"discountCents": 500,
"netCents": 4990
},
"applied": [
{
"offerCode": "CODE-BIENV",
"valueCents": 500,
"triggeredBy": {
"couponCode": "BIENVENUE5"
}
}
]
}