For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Marqeta provides comprehensive card issuing and processing infrastructure for the Virtual Card Agent. The integration uses Marqeta.js, a PCI-compliant JavaScript library that securely displays sensitive card data through iframes.
Integration Setup
1. Marqeta Account Configuration
Set up your Marqeta account:
Contact Marqeta sales team to enable Marqeta.js for your program
Complete the application and onboarding process
Obtain your API credentials and client access tokens
Configure webhook endpoints for transaction monitoring
2. Marqeta.js Setup
Marqeta.js is a PCI-compliant JavaScript library that securely displays card details. The library is automatically loaded based on your environment:
cardToken: The Marqeta card token for the virtual card
clientAccessToken: The Marqeta client access token for Marqeta.js authentication
sandbox: Optional boolean to determine environment (defaults to true based on organization settings)
Environment Detection
The system automatically determines whether to use sandbox or production based on your organization’s sandbox property. This ensures the correct Marqeta.js library URL is used.
Security Features
PCI Compliance
Marqeta.js handles all sensitive card data display
Card details are never exposed to your application
All card information is rendered through secure iframes
Authentication
Client access tokens provide secure authentication
Tokens are scoped to specific cards and users
Automatic token validation and refresh
Data Protection
Card details are encrypted in transit
No sensitive data is stored in your application
All card operations are logged for audit purposes
Implementation Example
Frontend Integration
The Marqeta embedded card page automatically handles:
Loading the appropriate Marqeta.js library
Initializing with your client access token
Displaying card details in secure iframes
Error handling and loading states
Backend Processing
The Virtual Card Agent automatically:
Extracts card details from the Marqeta iframe
Validates card information
Processes payments through the payment gateway
Handles errors and retries
Best Practices
Security
Always use client access tokens for authentication
Implement proper error handling for token failures
Monitor card usage and spending patterns
Use sandbox environment for testing
Performance
Cache client access tokens when possible
Implement proper loading states
Handle network failures gracefully
Monitor Marqeta.js library loading times
Error Handling
Implement fallback mechanisms for token failures
Provide clear error messages to users
Log all Marqeta.js initialization errors
Monitor card extraction success rates
Troubleshooting
Common Issues
Marqeta.js not loading: Check your internet connection and Marqeta.js URL
Client access token invalid: Verify token generation and expiration
Card details not displaying: Check card token validity and permissions
Environment mismatch: Ensure sandbox/production settings match your Marqeta account