Loading…
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.