To accept x402 payments, define a paid API resource, configure the accepted payment method and receiving wallet, and verify payment before providing access under your chosen integration. Test the complete request-to-settlement flow before accepting production traffic.
TL;DR
- x402 payments connect a paid resource with verifiable payment evidence.
- Test resource protection, valid payment, retries and settlement failures.
- HEVN receipt, later conversion and bank payout remain separate payment stages.
x402 is a standard for payments within web interactions. A compatible client can receive payment requirements, prepare a payment and retry the request with payment evidence.
That makes it relevant to APIs, data and other resources purchased by automated applications. It does not automatically provide a billing system, tax process or bank payout. The SaaS and AI payment-platform guide covers the wider payment-provider decision.
Before you start
You need an API or server you can modify, a compatible receiving wallet and an implementation supported by your application stack.
Choose the network, asset and payment scheme deliberately. The receiving address must belong to the intended business arrangement and support the selected asset on that network.
Start in a test environment. Test tokens are not production revenue, and a development facilitator must not be assumed to support production settlement.
Define exactly what the buyer purchases
Choose a bounded resource: one response, one dataset or another clearly described unit of access.
State the price, accepted asset, network and receiving destination. Decide what happens if the resource cannot be delivered.
For an initial implementation, a fixed-price resource is easier to reconcile than variable usage. x402 documents other schemes, but their charging and settlement behaviour requires separate implementation decisions.
| Payment approach | Best for | Limitation |
|---|---|---|
| Fixed-price resource | A known unit of access | Does not automatically represent variable usage |
| Usage-based scheme | A charge that depends on work performed | Requires usage measurement and correct settlement rules |
Do not expose every API operation as paid access before checking which operations customers can actually use.
Configure payment protection around the resource
- Follow the official seller guide for your framework and selected version.
- Configure the protected resource, payment requirements, receiving wallet and settlement service.
- Confirm an unpaid request receives payment requirements rather than protected content.
- Have a compatible buyer client prepare payment evidence and retry.
- Validate the evidence and handle settlement according to the selected scheme.
A facilitator can assist with verification and settlement. It does not determine whether your business delivered the promised data or met its contractual obligations.
Test the complete payment lifecycle
| Test | Expected business outcome |
|---|---|
| Request without payment | Buyer receives requirements, not paid content |
| Invalid payment evidence | Resource remains protected |
| Valid paid request | Payment and delivered resource can be matched |
| Repeated or interrupted request | No unintended duplicate charge or fulfilment |
| Settlement or service failure | Recorded exception and defined recovery process |
Check the implementation’s precise handling of failed responses. Different integration wrappers and payment schemes can settle at different points.
Record the resource, request reference, amount, asset, network, payment evidence and delivery outcome. A successful response alone is not enough for financial reconciliation.
Move to production deliberately
Replace test settings with production settings only after reviewing the network, facilitator, receiving address and credentials.
Run a small, authorised production pilot. Confirm the expected asset arrives at the correct address and the payment matches the resource delivered.
Set monitoring and an incident owner. If verification or settlement is unavailable, do not silently serve protected content or assume payment succeeded.
Where HEVN enters the workflow
Confirm the approved HEVN receiving arrangement accepts the chosen asset on the chosen network.
Separate three events: x402 payment, receipt into the supported wallet and any later conversion or bank payout. A fast token receipt does not guarantee equally fast bank credit.
An agent can assist with configuration, but a single request is not proof that deployment, payment verification and accounting are correct. Test the actual implementation.
HEVN is not a bank. Digital assets are not bank deposits, and availability and conversion terms remain product-specific.
Bring HEVN the resource description, asset, network, receiving arrangement and expected volume before committing to production.
Understand the HTTP 402 payment handshake
An unpaid request to a protected resource receives HTTP 402 Payment Required with the payment requirements defined by the selected x402 implementation. A compatible client prepares payment evidence and retries. The server-side integration then verifies the evidence and applies the scheme’s settlement rules.
Keep these concepts separate:
- Payment requirements: what the resource costs and which asset, network and scheme it accepts.
- Payment evidence: what the client supplies for verification.
- Facilitator: the service used for verification or settlement where the integration requires one.
- Settlement receipt: the record connecting the accepted payment with its result.
- Resource fulfilment: delivery of the API response or content purchased.
Use the official documentation for the precise headers and payloads of your selected version. Do not mix examples from different protocol versions or assume that an ordinary browser redirect implements the handshake. For agent payments, the test must cover both the buyer client and the paid endpoint, including retries and failed delivery.
FAQ
Are x402 and MCP the same protocol?
No. x402 addresses payment for resources; MCP connects an AI application to software capabilities.
Does receiving a token mean bank money is available?
No. Conversion and bank payout are separate operations with their own conditions.
Is a development facilitator automatically suitable for production?
No. Confirm production support, the network and settlement conditions before using real payments.