The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Agentpay Vn listing page.
VietQR payment infrastructure for AI agents — collect money inside any conversation.
AgentPay VN lets AI agents (Claude, GPT, custom bots) generate payment QR codes, send them to users, and automatically confirm when the money arrives — all without ever holding or touching funds. Money flows directly from the payer's bank account into the merchant's account; AgentPay only reads the bank transaction feed to confirm settlement.
Status: Early access / self-hosted — running on the same swarm as Sổ Nợ AI.
POST /v1/payment-requests → gets a VietQR image URL and a checkout page.await_settlement() (or the MCP tool) to poll until status = settled.AgentPay never holds money. The QR points directly at the merchant's bank account number. The platform only monitors the bank transaction feed to detect matching transfers.
Get a key from the admin dashboard (self-hosted) or contact the platform operator.
See examples/quickstart.py for the full runnable version.
AgentPay ships an MCP server so any MCP-compatible AI agent can call it as a tool — no extra code needed.
Add to claude_desktop_config.json (or use examples/claude_desktop_config.json):
Or use the installed console script:
| Tool | Description |
|---|---|
create_payment_request | Generate a VietQR code for a given amount |
check_payment | Get current status of a payment request |
await_settlement | Poll until payment arrives or timeout (max 600 s) |
list_recent_payments | List last N settled transactions |
Register a webhook endpoint:
agentpay-openapi.yamlhttps://agentpay.servicesai.vn/v1Authorization: Bearer ap_live_xxx (or ap_test_xxx for sandbox)| Method | Path | Description |
|---|---|---|
POST | /v1/payment-requests | Create payment request |
GET | /v1/payment-requests/{id} | Get status |
POST | /v1/payment-requests/{id}/cancel | Cancel pending request |
GET | /v1/transactions | List settled transactions |
POST | /v1/webhook-endpoints | Register webhook URL |
POST | /v1/sandbox/simulate-settlement | Simulate payment (sandbox only) |
GET | /pay/{pay_code} | Public checkout page (HTML, mobile-friendly) |
AgentPay runs as part of the Sổ Nợ AI FastAPI backend.
agentpay.servicesai.vn vhost| Variable | Default | Description |
|---|---|---|
AGENTPAY_BASE_URL | https://agentpay.servicesai.vn | Public base URL for checkout links |
MONGO_URI | mongodb://localhost:27017 | Inherited from Sono |
BILLING_WEBHOOK_TOKEN | — | SePay webhook token (inherited) |
The response includes the full key — store it immediately; it is shown only once.
| Tier | Settled payments/month | Requests/minute |
|---|---|---|
| Free | 50 | 120 |
No money held — QR codes point directly at the merchant's bank account. AgentPay only reads the transaction feed; it never touches the money.
Idempotency — pass an Idempotency-Key header on POST /payment-requests to safely retry without creating duplicates (24-hour deduplication window).
HMAC webhook verification — every outbound webhook is signed with HMAC-SHA256(whsec_..., raw_body) in the AgentPay-Signature header. Always verify before processing.
Sandbox — use ap_test_* keys and POST /v1/sandbox/simulate-settlement to develop and test without real transactions.
Minimal trust surface — the MCP server is a thin REST client with no local secrets beyond the API key. Compromising an agent key only exposes one tenant's payment-request creation ability.
MIT © 2026 ServicesAI — see LICENSE.