Merchant Policy Schema (v1)

Overview

Merchant policy determines whether agent-submitted order intent is approved, reviewed, clarified, or rejected before anything reaches checkout. This is the control surface ChatBasket evaluates during the Agentic Commerce Flow.

Design goal: deterministic decisions. Policies should be readable by commerce and risk teams, and predictable for engineers and agents.

What policy controls

What policy does not control


Technical details

This section defines the JSON structure and evaluation behavior used by ChatBasket when authorizing SKU-level order intent.

Decision actions

Every policy evaluation returns one of four actions:

Rule precedence

When multiple rules could apply, ChatBasket resolves them in a predictable order:

SKU overrides → Category rules → Agent rules → Global defaults

Schema

The policy document is a single JSON object per merchant. It is designed to be human-editable and UI-friendly.

{
  "merchant_id": "merchant_abc",
  "version": "v1",
  "global": {
    "max_order_value": { "amount": 200, "currency": "USD", "action": "REVIEW" },
    "default_action": "ALLOW",
    "default_substitutions_allowed": false
  },
  "agents": {
    "agent_xyz": {
      "enabled": true,
      "max_order_value": { "amount": 100, "currency": "USD", "action": "DENY" },
      "category_overrides": {
        "produce": { "action": "ALLOW" }
      }
    }
  },
  "categories": {
    "alcohol": { "action": "DENY", "reason_code": "AGE_RESTRICTED" },
    "tobacco": { "action": "DENY", "reason_code": "AGE_RESTRICTED" },
    "gift_cards": { "action": "REVIEW", "reason_code": "HIGH_FRAUD_RISK" }
  },
  "skus": {
    "SKU-12345": { "max_quantity": 5, "action_on_violation": "REVIEW", "reason_code": "QTY_REVIEW" }
  }
}
        

Field notes

Evaluation behavior

Inputs

ChatBasket evaluates policy using SKU-level order intent (from ACP) plus merchant context.

Outputs

Every evaluation produces an action and a small set of reason codes. ChatBasket stores a full evaluation trace for auditability.

{
  "transaction_id": "cb-789",
  "final_action": "REVIEW",
  "reason_codes": ["ORDER_VALUE_REVIEW"],
  "matched_rules": [
    { "level": "global", "rule": "max_order_value", "action": "REVIEW" }
  ]
}
        

Examples

1) Require approval over $150

{
  "global": {
    "max_order_value": { "amount": 150, "currency": "USD", "action": "REVIEW" }
  }
}
        

2) Block restricted categories

{
  "categories": {
    "alcohol": { "action": "DENY", "reason_code": "AGE_RESTRICTED" },
    "tobacco": { "action": "DENY", "reason_code": "AGE_RESTRICTED" }
  }
}
        

3) Allowlist one agent and set a lower spend limit

{
  "agents": {
    "agent_xyz": {
      "enabled": true,
      "max_order_value": { "amount": 75, "currency": "USD", "action": "REVIEW" }
    },
    "agent_unknown": {
      "enabled": false
    }
  }
}
        

Notes on v1 scope

v1 is intentionally small. The goal is to make policy predictable, auditable, and easy to operate. Over time, this schema can expand to cover additional constraints (store lists, hours, delivery zones, substitution policies by category), without changing the core actions or precedence.

Back to homepage · View the flow · Request beta access