{
  "example_id": "subscription-renewals",
  "title": "Pay subscription renewals up to $20/month (recurring, open merchant)",
  "description": "A subscription manager agent automatically pays renewal charges for streaming and software services up to $20 per transaction. The mandate is locked by MCC (software, data services, digital goods) rather than specific merchants — any vendor whose MCC matches is allowed. Human approves once; all subsequent credential requests are auto-validated.",
  "flow": {
    "step_1": "Agent calls POST /v1/mandates with cadence='monthly', per_transaction_max=2000, merchants=[], merchant_category_codes=['7372','7375','5815']. Mandate created with status='pending_approval'.",
    "step_2": "Human reviews and approves the mandate (any streaming/software merchant, max $20/transaction, no expiry). Mandate moves to status='active'.",
    "step_3": "At Netflix renewal time, agent calls POST /v1/mandates/{id}/credential-requests for $17.99. System validates: within limit, MCC 5815 matches, merchant restriction open (merchants=[]).",
    "step_4": "Validation passes. Virtual card (PAN, expiry, CVV) returned. Agent enters card details at Netflix checkout. Mandate stays active for future renewals."
  },
  "mandate": {
    "id": "mnd_example_subs_001",
    "owner_id": "usr_example_consumer",
    "agent_id": "agent_subscription_manager",
    "budget": {
      "cadence": "monthly",
      "per_transaction_max": 2000,
      "total_max": null,
      "currency": "USD",
      "merchants": [],
      "merchant_category_codes": ["7372", "7375", "5815"],
      "categories": ["subscriptions", "software", "streaming"],
      "expires_at": null
    },
    "risk_controls": {
      "require_merchant_match": false,
      "block_international": false,
      "max_daily_spend": 4000,
      "velocity_limit_per_hour": 3
    },
    "status": "active",
    "approved_at": "2026-01-01T10:00:00Z",
    "created_at": "2026-01-01T09:58:00Z",
    "expires_at": null,
    "metadata": {
      "task": "auto-renew approved subscriptions under $20/month"
    }
  },
  "credential_request": {
    "id": "cr_example_subs_001",
    "mandate_id": "mnd_example_subs_001",
    "amount": 1799,
    "currency": "USD",
    "merchant": "Netflix",
    "merchant_category_code": "5815",
    "context": "Netflix Standard monthly subscription renewal — billing date Feb 17, 2026. $17.99/month plan.",
    "idempotency_key": "netflix-renewal-2026-02-17",
    "metadata": {
      "service": "Netflix",
      "plan": "Standard",
      "billing_date": "2026-02-17"
    },
    "validation": {
      "passed": true,
      "constraints": {
        "within_amount_limit": { "passed": true, "detail": "1799 <= 2000 (per_transaction_max)" },
        "merchant_match": { "passed": true, "detail": "merchants is empty array — no merchant restriction applies" },
        "mcc_match": { "passed": true, "detail": "5815 (Digital Goods) matches merchant_category_codes [7372, 7375, 5815]" },
        "within_time_period": { "passed": true, "detail": "Mandate has no expiry" },
        "cadence_not_exhausted": { "passed": true, "detail": "monthly cadence — 0 of 2000 cents used this month" },
        "velocity_check": { "passed": true, "detail": "0 requests in past hour; limit is 3/hour" }
      },
      "reasons": [
        "Amount $17.99 is within the $20.00 per-transaction limit",
        "MCC 5815 (Digital Goods) matches allowed category codes",
        "No merchant restriction — any vendor with matching MCC is allowed",
        "All constraints passed — virtual card issued automatically, no human approval needed"
      ]
    },
    "virtual_card": {
      "pan": "4111111111111111",
      "expiry_month": "02",
      "expiry_year": "2026",
      "cvv": "552",
      "billing_zip": "94105",
      "network": "visa",
      "expires_at": "2026-02-17T06:15:00Z",
      "single_use": true,
      "amount_limit": 1799,
      "merchant_lock": null
    },
    "status": "approved",
    "created_at": "2026-02-17T06:00:00Z"
  },
  "mcc_reference": {
    "7372": "Computer Programming, Data Processing",
    "7375": "Computer Information Services",
    "5815": "Digital Goods: Games, Music, Books, Movies"
  },
  "amount_note": "amount: 1799 = $17.99. merchants: [] (empty array) means no merchant restriction — any vendor whose MCC matches is allowed. This is semantically distinct from a mandate with an explicit merchants allowlist.",
  "open_merchant_note": "The empty merchants array is intentional for subscription mandates — the agent doesn't know in advance which specific billing entity each service uses. MCC restriction provides the category-level guardrail instead."
}
