How to Get Started with Google's AI Payment API (AP2)

Discover the Agent Payments Protocol (AP2), Google's AI Payment API for verifiable AI-driven transactions. Learn its architecture, core principles like user privacy and accountability, partners, and a sample transaction flow.

Ashley Goolam

Ashley Goolam

17 September 2025

How to Get Started with Google's AI Payment API (AP2)

Today, all payment ecosystems on e-commerce platforms are built for humans, creating a fundamental challenge as AI agents execute purchases on behalf of users. How can we verify that an agent has legitimate permission to make a specific transaction using an AI payment API? How can merchants trust that a purchase initiated by an AI isn’t fraudulent or a hallucination? And when disputes arise, who is accountable—the user, the model, or the merchant?

To address these critical questions, Google introduced the open-source AI payment API, the Agent Payments Protocol (AP2), in September 2025. This protocol is designed to bridge the gap between human-centric payment systems and the autonomous capabilities of AI, ensuring transactions are secure, transparent, and trustworthy. Compatible with both MCP (Model Context Protocol) and A2A (AI-to-Agent) frameworks, AP2 allows developers and businesses to build reliable agentic payment solutions on top of existing infrastructure.

In this deep dive, we’ll explore the architecture, core principles, and key partners behind AP2, and walk through a sample transaction to show how this AI payment API is laying the foundation for a seamless and accountable AI-powered economy.

💡
Want a great API Testing tool that generates beautiful API Documentation?

Want an integrated, All-in-One platform for your Developer Team to work together with maximum productivity?

Apidog delivers all your demands, and replaces Postman at a much more affordable price!
button

What's all the Hype Surrounding AP2?

Google's open-source Agent Payments Protocol (AP2) is a game-changing framework that's fully compatible with both the Model Context Protocol (MCP) and Agent-to-Agent (A2A) standards. This means you can layer AP2 right on top of your existing work without starting from scratch. As an AI Payment API, AP2 sets a solid foundation for AI-driven payments, ensuring every step is verifiable, secure, and accountable. Released on September 16, 2025, it's already sparking excitement across the tech world, promising to unlock new levels of autonomy in e-commerce and beyond.

Google's open-source Agent Payments Protocol (AP2)

The Architecture of AP2

At its heart, the AI Payment API, AP2 is built around a clever system of "Mandates"—think of them as unbreakable digital contracts that capture and verify every intent in a transaction. These Mandates are cryptographically signed, tamper-proof documents that create a chain of evidence, linking the user's instructions all the way to the final payment.

The architecture revolves around two key Mandate types:

These Mandates flow through verifiable credentials (VCs), ensuring authenticity. The protocol integrates with MCP for AI context sharing and A2A for agent communications, creating a seamless pipeline. On the backend, it's open-source, so you can fork the GitHub repo and customize it for your stack—whether you're using credit cards, stablecoins, or real-time bank transfers. This modular design makes AP2 scalable and adaptable, perfect for everything from real-time buys to delegated tasks like auto-purchasing event tickets when prices drop.

The Architecture of AP2

Core Principles Driving AP2

What makes AP2 stand out isn't just its tech—it's the rock-solid principles baked into its design. These ensure the protocol isn't just functional but also ethical and future-ready. Let's break them down:

Open & Connected: As an open-source project, AP2 fosters collaboration across ecosystems. It's built to connect users, agents, merchants, and payment networks seamlessly, avoiding silos and promoting interoperability with standards like MCP and A2A.

User Control and Privacy: Users stay in the driver's seat, approving transactions or setting delegation rules upfront. Privacy is paramount—Mandates ensure only necessary data is shared, and everything's encrypted to protect sensitive info.

Verifiable Intent: Every action traces back to a signed Mandate, proving the user's true wishes. This eliminates ambiguity, making sure agents act precisely as instructed.

No AI Guesswork: AP2 bans hallucinations by requiring explicit, signed approvals. No more rogue AI decisions—everything's grounded in verifiable user intent.

Clear Accountability: If something goes wrong, the chain of Mandates points fingers accurately. Is it the agent's fault, the merchant's, or fraud? The protocol's audit trail holds parties accountable, reducing disputes.

Global & Future-Proof: Supporting diverse payment methods—from fiat to crypto—AP2 works worldwide. Its open-source nature means it can evolve with tech like blockchain or new AI standards, staying relevant as payments go digital.

These principles make AP2 more than an AI Payment API—it's a blueprint for trustworthy AI commerce.

Partners Powering AP2

Google didn't build AP2 in isolation; it's a collaborative effort with over 60 partners spanning payments, tech, and AI. This broad buy-in signals AP2's potential to become an industry standard. Key players include:

These partners are already exploring AP2 integrations, from agentic shopping on Etsy to crypto rails with Coinbase. The full list is impressive, covering everything from fraud prevention (Forter) to enterprise workflows (Salesforce). As one X post highlighted, this coalition is "unlocking a new level for AI agents," with AP2 enabling agents to pay each other via stablecoins.

Partners Powering AP2

A Sample Transaction: When a Human is Present

To see AP2 in action, let's walk through a detailed sample transaction where the user is actively involved—think of it as AI-assisted shopping with safeguards.

User Request: The journey starts with you telling your AI agent, "I want to buy a pair of running shoes in size 10, under $100." The agent captures this as an Intent Mandate, cryptographically signing it to record your exact wishes.

Building the Cart: The agent shops around, querying merchant endpoints (via A2A if needed) to find matching options. It assembles a cart with details like product specs, price, shipping, and taxes.

Merchant Sign-Off: The merchant reviews and cryptographically signs the Cart Mandate. This is their ironclad promise: "We'll fulfill this order exactly as specified, at this price—no bait-and-switch."

User Approval: Back to you—the agent presents the signed Cart Mandate alongside payment options from your credential provider (e.g., saved cards or wallets). You review everything: items, total, terms. Happy? Approve it, and your device signs both the Cart Mandate (authorizing the merchant) and the Payment Mandate (greenlighting the network transfer).

Execution and Delivery: With all signatures in place, the transaction fires off. Funds move securely, and you get a confirmation. In a few days, your turquoise runners arrive at your door—easy peasy.

A Sample Transaction: When a Human is Present

This flow ensures transparency at every step, with AP2's Mandates creating an unbreakable audit trail. For delegated scenarios (no human in the loop), the process automates based on pre-signed Intent Mandates, like buying tickets when prices hit your threshold.

Why AP2 is Important for the Future

Diving deeper, AP2 isn't just about payments—it's about trust in an AI world. By open-sourcing it, Google invites the community to iterate, adding features like multi-currency support or advanced fraud detection. Developers can grab the code from GitHub, tweak it for their apps, and contribute back. Imagine agents coordinating complex tasks: booking a flight, hotel, and rental car within budget, all paid autonomously yet verifiably.

But it's not without challenges. Adoption will require merchants to upgrade endpoints and users to embrace delegation. Still, with partners like Coinbase pushing crypto extensions (x402 for stablecoins), AP2 is poised to blend fiat and digital currencies seamlessly.

In real-world tests, early adopters are raving. One X thread called it "breaking," highlighting how agents can now pay each other with stablecoins, unlocking agentic economies. Think personalized offers: Your agent shares preferences with a merchant, snagging a custom bundle deal, all secured by AP2.

Integrating AP2 into Your Projects

If you're a dev, starting with AP2 is straightforward. Clone the repo from google/ap2, dive into the docs, and experiment with reference implementations. It's Python-based for easy prototyping, but extensible to other languages. Key APIs handle Mandate creation, signing, and verification—perfect for building an AI Payment API layer in your agent app.

For example, use AP2 with MCP to pass context between agents and merchants, ensuring intents align. Test in sandboxes from partners like Adyen, then go live. The protocol's global focus means it supports diverse regulations, from GDPR privacy to PCI-DSS security.

Potential Drawbacks and the Road Ahead

No tech is perfect. AP2's reliance on cryptography means key management is crucial—lose a signing key, and you're in trouble. Also, while future-proof, it assumes widespread adoption; without merchants on board, agents stay sidelined.

Looking ahead, Google plans community updates, perhaps adding blockchain integrations or zero-knowledge proofs for enhanced privacy. As AI agents evolve, AP2 could power everything from autonomous supply chains to personal finance bots.

Conclusion

The AI Payment API, AP2 is more than code—it's a vision for an agentic future where AI handles the mundane, leaving us to dream big. With its Mandates ensuring trust, principles guiding ethics, and partners fueling growth, AP2 solves real problems in AI commerce. Whether you're buying shoes or building B2B bots, this protocol makes it secure and simple. Dive into the GitHub, join the conversation, and let's build the next era of payments together!

button
Download Apidog

Explore more

Are These the Top 10 AI Code Review Tools Revolutionizing Development in 2025

Are These the Top 10 AI Code Review Tools Revolutionizing Development in 2025

Explore the game-changing AI Code Review Tools 2025 transforming software development. From Open Source PR Reviewer solutions like PR-Agent to enterprise platforms, discover tools that automate bug detection, enhance security, and boost productivity.

17 September 2025

What Can GPT-5 Codex Do? Real Examples and Applications

What Can GPT-5 Codex Do? Real Examples and Applications

Unlock the potential of GPT-5 Codex with real-world examples that streamline coding tasks. Developers harness this AI to generate APIs, refactor code, and enhance productivity.

17 September 2025

What Is Status Code: 207 Multi-Status? The Bulk Operation Report

What Is Status Code: 207 Multi-Status? The Bulk Operation Report

Learn what HTTP status code 207 Multi-Status means, why it’s used in WebDAV and APIs, and how it helps report multiple outcomes in one response. Discover examples, best practices, and how to test 207 with Apidog.

17 September 2025

Practice API Design-first in Apidog

Discover an easier way to build and use APIs