Stripe Issuing
Overview
Stripe Issuing allows you to create virtual cards programmatically for use with the Virtual Card Agent.
Integration Setup
Stripe Account Configuration
Ensure your Stripe account has Issuing enabled:
- Navigate to your Stripe Dashboard
- Go to Issuing in the left sidebar
- Complete the application process if not already done
- Note your
publishable_key
andsecret_key
Virtual Card Creation
Create virtual cards for specific invoices:
This is just an example, please refer to the Stripe Issuing documentation for more information.
API Integration
The Stripe Issuing integration with the Virtual Card Agent provides a secure, automated workflow for processing virtual card payments. This integration uses ephemeral keys and iFrame technology to ensure sensitive card data is handled securely.
How It Works
The integration follows a secure workflow where your Stripe virtual card is used to process payments through the Virtual Card Agent:
Process Flow:
- Create a Stripe virtual card with spending controls matching the invoice amount
- Call the Mercoa API with your card ID and ephemeral key endpoint configuration
- The agent uses your backend to generate a temporary ephemeral key
- Secure card data is retrieved through Stripe’s iFrame technology
- The agent completes the payment through the vendor’s payment gateway
- Receipt and confirmation details are captured for reconciliation
API Request Structure
When using Stripe Issuing with the Virtual Card Agent, your API request should include:
Field Descriptions
Card Details Object
Ephemeral Key Endpoint
Supported Variables
The postBody
and headers
template supports these variables that will be replaced with actual values:
{{cardId}}
- The Stripe card ID{{nonce}}
- A unique nonce for this request{{accountId}}
- Your Stripe account ID (if applicable)
Backend Implementation
Your backend needs to implement an endpoint that generates ephemeral keys. Here’s an example:
Ephemeral Key Response Structure
Your ephemeral key endpoint must return the ephemeral key secret in one of these formats:
Option 1: Object with ephemeralKeySecret
property
Option 2: Object with secret
property
Option 3: Plain string (the ephemeral key secret directly)
The ephemeral key secret must be a valid Stripe ephemeral key that was created for the specific card and nonce provided in the request.
Security Considerations
- Ephemeral Keys: These keys expire quickly (typically 1 hour) and can only be used for specific operations
- No Card Data Storage: Your backend never stores or processes actual card numbers
- PCI Compliance: The integration is designed to minimize your PCI compliance burden
- Audit Trail: All operations are logged for security and compliance purposes
Error Handling
Common error scenarios and how to handle them:
Best Practices
Security
- Use one-time cards with exact amounts
- Set appropriate spending limits
- Monitor card usage through Stripe Dashboard
- Implement proper error handling
Reconciliation
- Store Stripe transaction IDs with invoice records
- Use metadata to link cards to specific invoices
- Implement webhook handling for real-time updates