Step 1: Integrate with the facilitator
The facilitator's job is to verify that a payment happened and settle it on-chain, so your service never has to implement signature verification or chain logic itself.
- Respond to unpaid requests with HTTP 402. When a request comes in without payment, your server returns a 402 status with the payment requirements: price, asset, network, and your payTo address.
- Call the facilitator's verify endpoint before fulfilling the request. Once a client resubmits with payment attached, hand that payment to the facilitator to confirm it's valid before you do any work or return any data.
- Call settle once you've confirmed the request is legitimate. This is what finalizes the payment on-chain. The facilitator is currently covering the transaction fee, so neither you nor your payer needs to hold a balance for fees. This is set by the facilitator and may be subject to change.
- Test on testnet end-to-end before touching mainnet. Run the full 402 → verify → settle loop against Algorand testnet first. It's free to get wrong there and expensive to debug on Mainnet.
- Watch your first few settlements land on the GoPlausible dashboard. This is a useful sanity check: if a payment isn't showing up there, something in your integration isn't calling settle correctly, not just a display issue on their end.
Best practice: never write your own on-chain verification logic in parallel with the facilitator's. The whole point of using it is that verification and settlement are handled for you. Duplicating that logic yourself is where most integration bugs come from.
Step 2: Make your service discoverable
If you want your service to be discoverable, give people and machines a clear way to understand it. A good landing page should explain what the service does and why it is useful, while the Bazaar discovery extension should describe how it works. Both are worth a little care.
- Fill out your OpenGraph metadata properly for your landing page. Title, description, logo, and banner. The facilitator's metadata enrichment engine fetches each merchant domain roughly once a day and pulls exactly these fields to build your listing. If they're missing or generic, your entry in the directory will look unfinished no matter how good your API is.
- Publish an llms.txt file. This follows the llmstxt.org convention and is one of the first things the facilitator checks when it probes your domain, along with any agent well-knowns you support (an A2A agent card, an ai-plugin manifest, an MCP manifest, or an x402 well-known descriptor). If your service is agent-facing at all, this is where that gets communicated.
- No need to manually register anywhere. There's no form to submit. Once you complete a real, successful transaction, you're cataloged automatically, and your listing pulls from the metadata you've already published. The landing page is the input; the directory entry is the output.
- Keep it current. Since the enrichment engine refreshes at most once a day, treat your metadata like a small but real part of your API contract, not a one-time task. If you change your pricing or endpoints, update the page and expect the directory to catch up within a day.
- Add a Bazaar discovery declaration. This gives the GoPlausible facilitator the information it needs to offer your endpoint in the Bazaar catalog, including a description of the endpoint, what it expects as input, and an example of what it returns, declared alongside the payment details in the 402 response you built in Step 1. Keep it clear and specific: “Current weather for any city, returned as JSON” is more useful than “Weather API.” Your payment flow can work without this information, but your endpoint will be harder for developers and agents to find and use. Algorand’s official x402 tutorial includes a working example.
Best practice: build your landing page as if it's read by a crawler first and a person second. A short, accurate OpenGraph block and a working llms.txt will do more for your visibility than an elaborate design.
Step 3: Build a working demo
A demo proves the whole loop works, from a human clicking connect to money actually landing on-chain. The core flow looks like this regardless of what you're gating:
- Connect wallet. A user connects an Algorand wallet to your demo page.
- Hit the gated endpoint. The demo calls your API without payment and gets back a 402 with the price and payment details.
- Sign the payment. The wallet signs a transaction for the required amount to your payTo address, on the network you specified.
- Resubmit with payment attached. The demo calls the endpoint again, this time including proof of payment.
- Get the resource. Your server verifies through the facilitator, settles, and returns whatever the user paid for, whether that's data, a file, or an API response.
A few things worth building into the demo specifically:
- Show the price clearly before the wallet prompt appears. Nobody should be surprised by what they're signing.
- Show the transaction ID and a link to it once settled, so a skeptical user can verify it happened on-chain themselves.
- Keep the whole loop fast. Algorand settles with instant finality, so a demo that hangs undercuts the pitch.
Best practice: build and test the demo on testnet, but keep a mainnet toggle ready. The first thing a new visitor will ask is whether this works with real money, and being able to show that immediately matters.
A use case worth highlighting: gating ordinary APIs with crypto
x402 has mostly been pitched as a way for AI agents to pay each other, and that's a real use case. There's a simpler one sitting right underneath it that's easy to miss. This is also a way to sell access to a regular API.
Right now, most APIs gate access with keys, tiers, and subscriptions, because there's never been a cheap way to charge per call. x402 on Algorand removes that constraint. A developer with an existing API doesn't need to be building for agents at all to benefit here. They can gate any endpoint behind a payment priced in cents, collected in USDC, and settled within seconds, with no payment processor, no card minimums, and no subscription tier standing between a user and a single request.
That matters for two different audiences at once:
- Developers who already have an API get a way to monetize per-request usage that credit card economics never made viable, and they get it without becoming a crypto company to do it.
- Developers who aren't thinking about crypto or agents at all get an on-ramp into building on Algorand. For anyone already running an API, per-request payment is a practical option that credit card economics never supported — agent traffic or not.
This is also where Algorand's specific design pays off, independent of the agentic-commerce story:
- Fixed, sub-cent fees mean the payment doesn't eat the price. Charging half a cent for a call only works if the fee isn't ten times the charge.
- Instant, deterministic finality means a normal synchronous API call doesn't have to wait around for confirmation, so gating a request with a payment doesn't make the API feel slower.
- Predictable performance under load means a busy API doesn't need to build congestion-aware retry logic on top of its payment layer.
Framed this way, x402 on Algorand isn't just infrastructure for agent economies that don't fully exist yet. It's a payments upgrade available today to anyone who already runs an API and has been living with the tradeoffs of keys and subscriptions because there was no real alternative.
Best practices, quick recap
- Start on testnet, move to mainnet only once the full loop works end to end.
- Let the facilitator handle verify and settle. Don't duplicate that logic.
- Treat your landing page's metadata as part of your integration, not a design afterthought.
- Price in the smallest sensible unit. The advantage here is that fractional-cent pricing works, so use it.
- Check the dashboard after your first live settles to confirm everything is wired up correctly.
- If you already run an API, you don't need an agent use case to justify trying this. Ordinary paid access is a use case on its own.
The content provided in this blog is for informational purposes only. The information is provided by the Algorand Foundation and while we strive to keep the information up-to-date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability with respect to the blog or the information, products, services, or related graphics contained in the blog for any purpose. The content of this blog is not intended to be legal, financial, or investment advice nor is it an endorsement, guarantee, or investment recommendation. You should not take any action before conducting your own research or consulting with a qualified professional. Any reliance you place on such information is therefore strictly at your own risk. All companies are independent entities solely responsible for their operations, marketing, and compliance with applicable laws and regulations. In no event will Algorand Foundation nor any affiliates be liable for any loss or damage including without limitation, indirect, or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this blog. Through this blog, you may be able to link to other websites which are not under the control of the Algorand Foundation. We have no control over the nature, content, and availability of those sites. The inclusion of any links does not imply a recommendation nor endorse the views expressed therein.