CapsuleCredit
← All posts

Create Virtual Cards with Stripe Issuing in Minutes

May 11, 2026

▶ Watch the 60-second version on YouTube

Streamline Your Payment Experience with Virtual Cards

The world of payments is rapidly evolving, and virtual cards have become a game-changer for businesses looking to manage spending, enhance security, and streamline transactions. Stripe Issuing provides an API that allows developers to create and manage virtual cards effortlessly. In this post, we’ll explore how to set up virtual card issuance using the Stripe Issuing API, and I’ll share some best practices and a non-obvious gotcha that could save you time and headaches.

Getting Started with Stripe Issuing

To kick things off, ensure you have a Stripe account with access to the Issuing and Treasury APIs. Once you’ve set up your environment, you can start issuing virtual cards. The process involves a few key steps: 1. **Create a Cardholder**: This represents the entity that will use the card (e.g., your employee or a specific department). 2. **Issue a Card**: Create a virtual card linked to the cardholder. 3. **Manage Spending Controls**: Configure the card's spending limits and control features. ### Step 1: Create a Cardholder First, you need to create a cardholder. Here’s how you can do that with a simple API call:

import stripe

stripe.api_key = 'sk_test_YOUR_SECRET_KEY'

cardholder = stripe.Issuing.Cardholder.create(
    name="John Doe",
    email="john.doe@example.com",
    type="individual",
    billing={"address": {"line1": "123 Main St", "city": "San Francisco", "state": "CA", "postal_code": "94105", "country": "US"}},
)
print("Cardholder ID:", cardholder.id)
### Step 2: Issue a Virtual Card With the cardholder created, you can now issue a virtual card. Here’s an example of how to do that:

virtual_card = stripe.Issuing.Card.create(
    cardholder=cardholder.id,
    currency="usd",
    type="virtual",
    spending_controls={
        "spending_limits": [
            {
                "amount": 5000,  # set limit to $50.00
                "interval": "all_time",
            },
        ],
    },
)
print("Virtual Card ID:", virtual_card.id)
### Step 3: Configure Spending Controls Spending controls are crucial for managing budgets and ensuring compliance within your organization. You can set limits on your virtual cards as demonstrated above. Stripe also allows you to set controls based on merchant category codes (MCC), which can be particularly useful for restricting spending types. ### Non-Obvious Gotcha: Understanding Card Activation One important aspect of virtual cards that many tutorials gloss over is the activation process. Unlike physical cards, virtual cards issued through Stripe can sometimes require additional steps for activation, especially if you want them to be used for online transactions immediately. To activate a virtual card, you might need to set the `active` status explicitly. Here's how you can ensure your card is activated:

stripe.Issuing.Card.modify(
    virtual_card.id,
    active=True
)
Failing to do this step can lead to confusion when testing, as the card may appear valid but won't work until activated. Always double-check the status of your card after issuance. ### Testing Your Virtual Card Once your virtual card is issued and activated, you can start using it for transactions. Stripe provides a robust testing environment, allowing you to simulate transactions without real money being involved. Use test card numbers provided by Stripe to execute test payments and ensure everything is working as expected. Here’s an example of how to create a test transaction using your virtual card:

# This is just a simulation of a charge; replace with actual logic in production.
charge = stripe.Charge.create(
    amount=1000,  # $10.00
    currency="usd",
    source=virtual_card.id,  # Use the virtual card here
    description="Test charge for virtual card",
)
print("Charge ID:", charge.id)
### Best Practices for Managing Virtual Cards 1. **Monitor Usage**: Regularly check transaction logs to ensure that spending aligns with your expectations. 2. **Implement Alerts**: Set up webhooks to notify you of any transactions made with the virtual cards, enabling you to react swiftly to any suspicious activity. 3. **Use MCC-Based Controls**: Leverage merchant category code restrictions to prevent unauthorized spending outside specific categories. By implementing these best practices, you can optimize the use of virtual cards within your organization and enhance your overall payment security. ### Final Thoughts With Stripe Issuing, creating and managing virtual cards is straightforward, but understanding the nuances—like the activation step—is crucial for a smooth development process. By leveraging the power of API calls and adhering to best practices, you can build a robust virtual card system that not only protects your business but also empowers your teams to manage expenses effectively. Now, armed with this knowledge, you're ready to integrate virtual card issuance directly into your fintech products. Happy coding!

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

Get Brex →