HTTP 402 Payment Required has existed as a status code since 1991. For three decades, it was reserved for future use. AI agents changed the calculus. When software systems need to pay for API access, data, or compute without a human in the loop, the gap in HTTP's payment vocabulary becomes a real engineering problem. x402 is the protocol that fills it.
What x402 is
x402 is an open HTTP-native payment protocol built around the 402 status code. When an agent or automated client requests a paid resource, the server returns HTTP 402 with a machine-readable payment specification in the response headers. The client reads the specification, executes the payment on-chain, and retries the request with proof of payment. If payment verification succeeds, the server delivers the resource.
The full cycle is: request, payment-required response, pay on-chain, retry with proof, receive resource. No human interaction, no browser redirect, no OAuth flow, no stored payment credential. The payment happens at the protocol layer.
Why XRP is a strong fit for x402
x402 can theoretically work with any on-chain payment system, but the practical requirements are demanding: transactions must confirm in seconds (not minutes), network fees must be negligible relative to the payment amount, and the settlement must be final with no reversal mechanism.
XRP Ledger satisfies all three. Transactions confirm in 3 to 5 seconds. Network fees are under one cent per transaction. Once a transaction is on the ledger, it is final. These properties make micropayments viable in a way that most other chains do not support.
For pay-per-use API models, where a single agent might make hundreds of calls per session, a 30-second confirmation time or a $0.50 network fee would make the model unworkable. XRP's characteristics are not incidental to x402. They are what make the use case viable at the transaction level.
How DropPay implements x402
DropPay implements x402 as part of its Embedded Checkout infrastructure. The same integration that processes payments from human customers also handles x402 payments from AI agents. There is no separate x402 product or parallel setup.
The endpoints relevant to x402 are:
/x402/payment-requiredreturns the payment specification for a given resource, including the XRP amount, destination wallet, and a memo field the agent uses to reference the transaction./payments/requestscreates a payment request. The same endpoint used for human checkout flows works for agents./payments/{id}/verifyaccepts a transaction hash and confirms payment on the XRP Ledger. If verified, the webhook fires. The same webhook your system already handles for human payments applies here.
This means a single integration covers both audiences. A merchant or developer who builds Embedded Checkout for human customers gets x402 support for AI agents with no additional code. The full API specification is in the developer documentation.
The x402 payment flow in detail
- The AI agent requests a paid resource from your API or service.
- Your server returns HTTP 402 with payment details from
/x402/payment-required. - The agent reads the payment specification, constructs the XRP transaction, and sends it on-chain.
- The agent calls
/payments/{id}/verifywith the transaction hash as proof of payment. - DropPay checks the XRP Ledger, confirms the transaction matches the payment request, and fires your webhook.
- Your system fulfills the request and the agent receives the resource.
The XRP arrives in your wallet at step 3 - before verification even completes. Verification is confirmation, not transfer.
What x402 enables
Pay-per-API-call. Research tools, data providers, and AI-powered APIs can charge per request without requiring developers to manage API keys, usage quotas, or billing integrations. The agent pays at the protocol layer, per call.
Data marketplaces. Access to proprietary datasets, real-time feeds, or curated content can be gated behind x402. An agent retrieves data by paying for it on-chain. No subscription, no account required from the agent's operator.
Compute and inference. AI agents that need to use external compute, run models, or access inference endpoints can pay per request without a standing billing relationship between systems.
Agent-to-agent transactions. One AI agent can pay another agent for a service. x402 is not limited to human-built APIs - any system that can receive XRP and implement the protocol can participate.
Security and verification considerations
The x402 flow has two key verification points. First, the memo field in the XRP transaction links the on-chain payment to a specific payment request. DropPay validates that the memo matches. Second, the amount must meet or exceed the required payment. DropPay rejects underpayments.
For your webhook handler, treat x402 webhook events the same as any payment webhook. Verify the webhook signature, confirm the payment status is confirmed, and grant access only after successful verification. The documentation covers webhook security in detail.
Frequently asked questions
Do I need a separate DropPay account or plan for x402? No. x402 is part of the Pro plan's API and webhook support. Any Pro account with Embedded Checkout enabled can use x402.
How is x402 different from standard Embedded Checkout? The payment mechanism is identical. The difference is the client. Embedded Checkout is designed for a human customer who visits a pay page, scans a QR code, or uses a wallet app. x402 is designed for an automated agent that reads the payment specification and executes the transaction programmatically. Both use the same API, the same payment request flow, and the same webhook.
Can I support both human and AI agent payments on the same product? Yes. A single Embedded Checkout integration handles both. Human customers use the pay page UI. AI agents call the API directly and handle payment programmatically. The same webhook delivers payment confirmation in both cases.
Where can I find code examples and the full API specification? The developer documentation covers the full x402 flow, request format, verification endpoint, and webhook schema. The AI agent payments page has an overview of the use case and architecture.
Create a free account and review the developer documentation to get started.
Create your developer account