CapsuleCredit
← All posts

Enforce Spending Limits with Merchant Category Codes (MCCs)

May 7, 2026

Merchant Category Codes: The Key to Controlled Spending

▶ Watch the 60-second version on YouTube

Merchant Category Codes (MCCs) are an integral component when it comes to enforcing spending limits on corporate cards, especially for businesses that need to control employee expenses. By leveraging MCCs, you can issue virtual cards that restrict spending to specific categories, ensuring that budgets are adhered to without the risk of overspending. Let’s dive into how you can implement this using APIs from Stripe Issuing and Visa Token Service.

Understanding MCCs

MCCs are four-digit numbers assigned to businesses by credit card networks, categorizing them based on the type of goods or services they provide. For instance, a grocery store might have a different MCC than a gas station. By using MCCs, you can create cards that can only be used at certain types of merchants. This is particularly valuable for organizations looking to manage agent or employee spending without constantly monitoring transactions.

Setting Up Your Card Program

To start enforcing MCCs, you’ll need to set up a card program through Stripe Issuing. Below are the essential steps to create a program with specific MCC restrictions.

  • Create a Stripe Account: Ensure you have a Stripe account and access to the Issuing API.
  • Define Your MCCs: Decide which categories are approved for spending.
  • Create a Cardholder: Set up the cardholder details for the employee or agent.
  • Issue a Card: Use the API to create a card with MCC restrictions.

Step-by-Step Implementation

Let’s break down the API calls needed to set up a card with MCC restrictions using Stripe Issuing.

import stripe

# Set your secret key
stripe.api_key = 'sk_test_your_secret_key'

# Create a cardholder
cardholder = stripe.Issuing.Cardholder.create(
    type='individual',
    billing={
        'address': {
            'line1': '123 Test St',
            'city': 'Test City',
            'state': 'CA',
            'postal_code': '90210',
            'country': 'US',
        },
    },
    name='John Doe',
    email='johndoe@example.com',
)

# Define the MCCs you want to restrict
approved_mccs = ['5812', '5813']  # Restaurants and fast food

# Issue a card with MCC restrictions
card = stripe.Issuing.Card.create(
    cardholder=cardholder.id,
    currency='usd',
    type='virtual',
    spending_controls={
        'allowed_categories': approved_mccs,
        'blocked_categories': [],
    },
)

print(f"Card issued: {card.id}")

Gotchas and Considerations

One common oversight when implementing MCC restrictions is not accounting for the fact that some merchants can belong to multiple MCCs. For example, a grocery store may accept payments for gas and food, but if you only allow the MCC for food, purchases made at the gas station could lead to transaction declines. Always verify the merchant's MCC before issuing a card with restrictions.

Additionally, it's worth noting that not all merchants strictly adhere to their assigned MCCs. In some cases, a merchant can change their MCC based on how they categorize their business, which can lead to unexpected declines. Regularly update and monitor your approved MCC lists to avoid any disruptions in service.

Testing Your Implementation

Before rolling out your card program, ensure you test it thoroughly. Use test cardholders and transactions to validate that the MCC restrictions are functioning as expected. Stripe provides a test mode that allows you to simulate various scenarios, including blocked transactions based on MCCs.

Here’s an example of how to test a transaction using a test card:

curl https://api.stripe.com/v1/issuing/transactions \
  -u sk_test_your_secret_key: \
  -d "card"="card_id" \
  -d "amount"=1000 \
  -d "currency"="usd" \
  -d "merchant"="merchant_id" \
  -d "description"="Test transaction"

Integrating with Other Services

Consider integrating your MCC enforcement with services like Plaid or Privacy.com for additional layers of oversight. Plaid can help you verify the merchant details and understand their categories, while Privacy.com can provide a layer of security by masking card details for online transactions.

Conclusion

Using MCCs to enforce spending controls on corporate cards not only simplifies budget management but also streamlines compliance with company policies. By leveraging Stripe Issuing, you can create a robust card program that ensures your agents and employees are spending within approved categories. Remember to stay vigilant about updating your MCC lists and testing your configurations to maintain a seamless experience.

💳 Best card for API and cloud spend — earn rewards on every Stripe, AWS, and OpenAI charge.

Get Brex →