Nexi and Google Cloud signed an MoU this week committing to AP2 -- an open-source agentic payment protocol sitting on top of Europe's ISO 20022 payment network. AP2 processes 2.9 trillion EUR per year. It's now officially open to AI agents.
The problem: there's no non-custodial path. Every existing integration assumes a corporate bank account, a custodial processor, and a human in the loop.
We built the bridge that removes all three.
What AP2 Actually Is
AP2 (Agent Payments Protocol) is a structured message format on top of ISO 20022 -- the XML standard that European banks use for interbank settlement (pacs.008 for credit transfers, pacs.004 for payment returns). Nexi, which processes payments across the European Economic Area, committed to AP2 as an open-source standard in their Google Cloud partnership.
That means: if you can generate a valid ISO 20022 message, you can participate in AP2. No proprietary SDK. No Nexi partnership agreement required at the message level.
The Gap We Closed
Traditional flow:
Corporate ERP -> Bank API -> Nexi/AP2 -> Creditor Bank -> Creditor
With our handler:
AI Agent -> ISO 20022 pacs.008 -> agentwallet-sdk signs x402 header
-> CCTP V2 USDC bridge -> AP2 Euro off-ramp -> Creditor Bank
The agent holds its own private key. Signs locally. No custodian touches the funds.
How It Works
Install the handler:
pip install -r requirements.txt
uvicorn ap2_handler:app --host 0.0.0.0 --port 8080
Send a standard ISO 20022 credit transfer:
import httpx
pacs008_xml = """<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08">
<FIToFICstmrCdtTrf>
<GrpHdr>
<MsgId>AP2-TEST-001</MsgId>
<CreDtTm>2026-03-05T01:00:00</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<TtlIntrBkSttlmAmt Ccy="EUR">1500.00</TtlIntrBkSttlmAmt>
</GrpHdr>
<CdtTrfTxInf>
<IntrBkSttlmAmt Ccy="EUR">1500.00</IntrBkSttlmAmt>
<Cdtr><Nm>Supplier GmbH</Nm></Cdtr>
<CdtrAcct><Id><IBAN>DE89370400440532013000</IBAN></Id></CdtrAcct>
<CdtrAgt><FinInstnId><BIC>COBADEFFXXX</BIC></FinInstnId></CdtrAgt>
</CdtTrfTxInf>
</FIToFICstmrCdtTrf>
</Document>"""
response = httpx.post(
"http://localhost:8080/ap2/payment",
content=pacs008_xml,
headers={"Content-Type": "application/xml"}
)
print(response.json())
Response:
{
"status": "quote_ready",
"ap2_message_id": "AP2-TEST-001",
"creditor_iban": "DE89370400440532013000",
"creditor_bic": "COBADEFFXXX",
"amount_eur": 1500.0,
"usdc_required": 1389583333,
"bridge_fee_usdc": 3474000,
"x402_header": "x402-payment: ...",
"agent_wallet_calldata": {
"module": "x402",
"method": "pay",
"sign_locally": true
}
}
The sign_locally: true flag is the key detail. Your agent's private key never leaves the device. The x402 header gets signed on-device via agentwallet-sdk, then submitted to the CCTP V2 bridge for USDC-to-EUR conversion.
Validation Built In
The handler validates every AP2 payment before quoting:
# IBAN mod-97 checksum (catches typos before they hit the network)
def validate_iban(iban: str) -> bool:
iban = iban.replace(" ", "").upper()
rearranged = iban[4:] + iban[:4]
numeric = "".join(str(ord(c) - 55) if c.isalpha() else c for c in rearranged)
return int(numeric) % 97 == 1
# BIC ISO 9362 format
def validate_bic(bic: str) -> bool:
import re
return bool(re.match(r'^[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}([A-Z0-9]{3})?$', bic.upper()))
41 unit tests cover the validation edge cases, XML parsing quirks (Python's ElementTree has a falsy-element footgun we caught and fixed), and the full FastAPI endpoint response codes.
Who Should Care About This
If you're building AI agents that need to pay European suppliers, contractors, or services -- this is the path that doesn't require a corporate bank account or a custodial processor.
If you're building on top of AP2 or the Nexi/Google Cloud partnership -- this is the non-custodial reference implementation for agent-side payment handling.
If you're evaluating agentwallet-sdk -- this shows the SDK doing real payment work against a live open standard.
What's Next
The current handler generates a bridge quote and x402 header. The next step is wiring the CCTP V2 bridge execution so the full round-trip is automated: agent decision -> ISO 20022 message -> USDC bridge -> SEPA settlement.
We're also watching the UCP (Universal Commerce Protocol) standard that Nexi committed to alongside AP2. If UCP defines the shopping journey layer, AP2 handles the payment layer -- and our non-custodial SDK sits underneath both.
Code: github.com/agentwallet-sdk | npm: agentwallet-sdk | Handler: tools/ap2_handler/
Top comments (0)