Never discount below margin. Holds the checkout before the payment token is issued when the cart would breach the floor.
For: Ecommerce and finance ops running promotions on Shopify
Blocks a checkout whose net margin falls below the encoded floor, before the token is issued.
Blocks a cart whose combined discount exceeds the authorized ceiling.
Restrains a price override written by a pricing engine or agent rather than a named merchandiser.
# Shopify Margin Floor Guard
# Fork: replace margin_floor_pct with your own cost basis and floor, and run
# in shadow mode until the would-have-blocked list looks right.
apiVersion: decionis.dev/v1
kind: PolicyPack
metadata:
name: shopify-margin-floor-guard
surface: shopify
workflow_key: checkout_margin_guard
standards: [SOC2-CC8.1, ISO27001-A.8.34]
defaults:
mode: shadow
emit_dossier: true
margin_floor_pct: 15
rules:
- name: margin_floor
when: "action == 'checkout.commit'"
decision: |
BLOCK IF order.net_margin_pct < margin_floor_pct
ALLOW OTHERWISE
reason_code: below_margin_floor
- name: stacked_discount_ceiling
when: "action == 'checkout.apply_discount'"
decision: |
BLOCK IF combined_discount_pct >= 50
ESCALATE IF discounts.count > 1
ALLOW OTHERWISE
reason_code: stacked_discount_over_ceiling
- name: agent_price_override_restraint
when: "action == 'price.override'"
decision: |
RESTRAIN IF actor.type in ['automation', 'agent']
ALLOW OTHERWISE
reason_code: price_override_by_non_human
Fork it, change the thresholds to match your environment, and deploy in shadow mode first — it defaults to listen-only so nothing in your live pipeline changes.
The app evaluates checkouts and order admissions in read-only mode by default — no live behavior changes until you enable enforcement.
1. Install "Decionis Margin Protection" from the Shopify App Store.
2. Pick a starter pack (margin guard / oversell prevention / refund threshold).
3. App is in read-only mode by default — every governed checkout / order
produces a signed Decision Dossier. No shopper-facing change.Ships in shadow mode — every verdict is recorded, nothing is blocked.
This recipe is one step in a path. The same five steps apply to every recipe in the exchange.
Run the policy against a realistic action in the browser. Push it past what the rules allow and watch the verdict come back. No account.
See exactly what was decided and why: the rule that fired, the evidence it read, the policy version in force, and an Ed25519 signature you can verify yourself.
Measure what the policy would have caught on your own traffic without touching the live path. Every recipe defaults to shadow, so the first deployment carries no execution risk.
Point the same policy at the system where the action actually originates — a checkout, an ERP posting, a Zap, an agent's tool call.
Publish the proof: a public verification link, an embeddable badge, a PR comment, or an anonymized shadow-mode finding. This is how the next person discovers Decionis.