Mastercard Agent Pay
Payment Rail
Official
Enterprise
Best for: Agent-initiated card payments with spending controls; enterprise deployments needing Mastercard's network
Not ideal for: Crypto; open source; small teams; self-serve onboarding
Integration
Note: Mastercard Agent Pay is an enterprise program requiring a partnership agreement. The snippet below is conceptual based on public announcements — actual API interfaces are provided to partners under contract.
const mcClient = new MastercardAgentPay({
consumerKey: process.env.MC_CONSUMER_KEY,
privateKey: process.env.MC_PRIVATE_KEY,
environment: 'production',
});
const agentCard = await mcClient.agents.provision({
agentId: 'procurement-agent-42',
agentRole: 'ProcurementBot',
controls: {
maxTransactionAmount: { value: 1000, currency: 'USD' },
allowedMCC: ['5045', '5065', '5112'],
geographicScope: 'DOMESTIC',
dailySpendLimit: { value: 5000, currency: 'USD' },
},
});
const payment = await mcClient.payments.initiate({
agentCardId: agentCard.id,
amount: { value: 299_99, currency: 'USD' },
merchant: { id: 'MERCH_001', name: 'Tech Supplies Inc' },
metadata: { purchaseOrderId: 'PO-2026-1234' },
});