Effortlessly Issue Virtual Cards in Minutes: 5 Steps
May 13, 2026
▶ Watch the 60-second version on YouTube
Getting Started with Virtual Card Issuance
Building a virtual card issuance flow can seem daunting, but with the right APIs, you can set up a fully functioning card program in a matter of minutes. Stripe Issuing is one of the most robust solutions available, allowing you to create, manage, and control virtual cards programmatically.
Step 1: Setting Up Your Stripe Account
- Ensure you have a Stripe account set up with access to the Issuing API.
- Enable the Issuing feature in your Stripe Dashboard.
Make sure to review Stripe's API documentation for any prerequisites related to your account and the necessary permissions you'll need.
Step 2: Create a Cardholder
Cardholders are the entities that will be tied to the virtual cards you issue. You can create a cardholder using the Stripe API. Here’s how to do it:
import stripe
stripe.api_key = 'sk_test_your_api_key_here'
cardholder = stripe.Issuing.Cardholder.create(
type="individual",
billing={"address": {
"line1": "123 Main St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94111",
"country": "US",
}},
name="John Doe",
email="john.doe@example.com",
)
print(cardholder)
This creates a cardholder for John Doe, including billing information. Make sure the email address is valid, as it will be used for notifications and other communications.
Step 3: Issue a Virtual Card
Once you have a cardholder, issuing a virtual card is straightforward. Here’s the code to do that:
card = stripe.Issuing.Card.create(
cardholder=cardholder.id,
currency="usd",
type="virtual",
spending_controls={
"spending_limits": [
{
"amount": 10000, # In cents, so this is $100
"categories": ["food_and_drink"],
"interval": "all_time"
}
]
}
)
print(card)
This code snippet creates a virtual card with a $100 spending limit restricted to food and drink categories. The spending control feature is a powerful way to manage how cardholders use their cards.
Step 4: Retrieve and Manage Cards
After creating the card, you will likely want to retrieve the card's details or manage its settings. The following snippet shows how to retrieve a card's information:
retrieved_card = stripe.Issuing.Card.retrieve(card.id)
print(retrieved_card)
You can also update card information or settings using the stripe.Issuing.Card.modify method. This could be useful for adjusting spending limits or enabling/disabling the card.
Step 5: Monitor Transactions
Monitoring transactions is crucial for effective management of your card program. You can set up webhooks to listen to events related to your cards. Here’s an example of how to set up a webhook endpoint:
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/webhooks/stripe', methods=['POST'])
def stripe_webhook():
event = request.json
if event['type'] == 'issuing.transaction.created':
transaction = event['data']['object']
print(f"New transaction: {transaction}")
return jsonify(success=True)
In this example, we set up a Flask application to listen for Stripe webhook events. The key event we’re handling is issuing.transaction.created, which will trigger every time a transaction occurs on one of your issued cards.
Gotcha: Handling Edge Cases with Spending Controls
One non-obvious insight when working with spending controls is that they do not automatically update if the cardholder’s spend limit is reached. For example, if you set a spending limit of $100 for a specific category and the cardholder makes a $100 purchase, the card will be blocked for that category until you either reset the limit or modify the card. Therefore, you should implement logic to monitor and adjust limits based on user activity or transaction history, ensuring a smoother user experience. Not doing so can lead to user frustration when their card is unexpectedly declined.
Final Thoughts
By following these steps, you can effectively issue virtual cards using Stripe Issuing and set up a robust card program. The combination of flexibility in cardholder setup, spending controls, and real-time transaction monitoring makes it a powerful tool for any fintech initiative.
Remember to thoroughly test your implementation and consider edge cases to ensure a seamless experience for your users.
💳 Best card for API and cloud spend — earn rewards on every Stripe, AWS, and OpenAI charge.