Sardis

Merchant Categories and MCC Codes

Control which types of merchants your AI agent can transact with using industry-standard MCC codes.

What Are MCC Codes?

Merchant Category Codes (MCCs) are four-digit numbers assigned by card networks (Visa, Mastercard) to classify businesses by the type of goods or services they provide. Every card transaction includes the merchant's MCC, which Sardis uses to enforce category-based spending policies.

How It Works: When a virtual card transaction occurs, the card network reports the merchant's MCC. Sardis maps MCCs to human-readable categories and checks them against your policy's allowed_categories and blocked_categories lists.

Category Reference

CategoryMCC CodesExamplesDefault
saas5734, 5817Software subscriptionsAllowed
cloud_infrastructure7372AWS, GCP, Azure, VercelAllowed
developer_tools5734, 7372GitHub, JetBrains, DatadogAllowed
ai_services7372, 5818OpenAI, Anthropic, ReplicateAllowed
advertising7311Google Ads, Meta AdsAllowed
office_supplies5111, 5943Staples, Office DepotAllowed
telecommunications4812, 4814Twilio, Phone servicesAllowed
shipping4215FedEx, UPS, USPSAllowed
travel3000-3299, 4511, 7011Airlines, hotelsNeutral
food_delivery5811, 5812, 5814DoorDash, Uber EatsNeutral
retail5311, 5411, 5691Amazon, WalmartNeutral
gambling7800, 7801, 7802, 7995Casinos, lotteriesBlocked
adult_content5967Adult entertainmentBlocked
cash_advance6010, 6011ATMs, cash disbursementsBlocked
quasi_cash6051, 6540Money orders, prepaid cardsBlocked
securities6211Stock brokers, tradingBlocked
wire_transfer4829Wire transfersBlocked
pawn_shops5933Pawn shopsBlocked

Only specified categories are permitted. Everything else is blocked.

policy = await client.policies.create(
    wallet_id="wallet_abc",
    rules={
        "allowed_categories": ["saas", "cloud_infrastructure", "ai_services"],
        # All other categories are implicitly blocked
    },
)

Blocklist Mode

All categories allowed except those explicitly blocked.

policy = await client.policies.create(
    wallet_id="wallet_abc",
    rules={
        "blocked_categories": ["gambling", "adult_content", "securities"],
        # All other categories are allowed
    },
)

Natural Language Examples

# All these create equivalent category policies:

policy = await client.policies.create_from_natural_language(
    wallet_id="wallet_abc",
    description="Only allow SaaS and developer tools",
)
# -> allowed_categories: ["saas", "developer_tools"]

policy = await client.policies.create_from_natural_language(
    wallet_id="wallet_def",
    description="Block gambling, adult content, and cash advances",
)
# -> blocked_categories: ["gambling", "adult_content", "cash_advance"]

MCC Lookup Tool

# Python SDK
result = await client.mcc_lookup(code="5734")
# -> {"code": "5734", "category": "saas", "description": "Computer Software Stores"}

# Via MCP tool
sardis_mcc_lookup(code="7995")
# -> {"code": "7995", "category": "gambling", "description": "Betting/Casino/Lottery"}

Best Practices

  1. Use allowlists over blocklists -- Safer default: only known-good categories are permitted
  2. Always block high-risk MCCs -- Gambling, cash advances, and quasi-cash are blocked by default
  3. Combine with merchant rules -- Use per-merchant overrides for fine-grained control
  4. Review unknown MCCs -- Some merchants use unexpected MCCs; monitor and adjust
  5. Use the MCC lookup tool -- Verify merchant categories before adding to policies