Core Concepts
Understand x402, the payment flow, event system, and Dunmore architecture.
Key concepts you need to understand to work with Dunmore.
The x402 Protocol
x402 is an HTTP-native payment protocol. When a client requests a paid resource without payment, the server returns HTTP 402 with payment requirements. The client signs a USDC payment and resubmits.
Payment Flow
Client → Gateway → 402 Payment Required
Client → Signs USDC payment → Gateway → Verify → Forward to upstream → Settle on-chain
- Client hits the gateway URL
- Gateway returns 402 with payment terms (amount, wallet, chain)
- Client signs a payment and resubmits with the
X-PAYMENTheader - Gateway verifies the payment signature
- Request is forwarded to your upstream API
- Payment settles asynchronously on Base
Event System
Every action in Dunmore emits a structured event via a PostgreSQL transactional outbox. Events are delivered to:
- Webhooks — HTTP POST with HMAC signature
- Slack — Rich Block Kit messages
- Discord — Embed notifications
- Segment — Analytics tracking
- Email — Digest notifications
Projects and Endpoints
A project represents one API you want to monetize. Each project has its own endpoints, webhooks, connectors, and API keys. You can manage multiple projects from one account.