Trying to buy a sandwich with HTTP 402

· Andrew Acomb ·

7 min read Original article ↗

For agents to complete long-horizon tasks such as booking a full vacation, building a data center, or running a whole company, they will need to be able to make purchases entirely on their own. If you use coding agents at all, you’ve surely noticed how much more effective they are when you allow full autonomy (e.g., `--dangerously-skip-permissions`).

This line of reasoning led me to perform a basic experiment:

Buying the bananas required me to intervene multiple times, authenticating and updating payment information as needed. I doubted that this was the state of the art, so I started doing research on what other options were out there. In doing so, I learned about the two competing protocols for agentic commerce, Coinbase’s x402 and Stripe and Tempo’s Machine Payments Protocol (MPP).

Normally a purchase makes an agent stop and create an account, log in, and save a card. With x402 and MPP, the payment itself carries the identity, allowing the agent to skip these human-shaped steps.

Both protocols build on top of the rarely used HTTP 402 ‘Payment Required’ status code. At a high level, the flow is the same in both: your agent asks a server for something, the server says “402, that’ll cost you,” your agent pays, and then it gets the thing back along with a receipt.

The main differences between the two come down to which payment rails each is built on and how each proves who’s paying.

x402 (Coinbase) is crypto-native. Payments are stablecoins settled on-chain, and Coinbase runs a “facilitator” so the merchant doesn’t have to touch any blockchain infrastructure themselves.

MPP (co-authored by Stripe and Tempo) is payment-method-agnostic. It accepts stablecoins, but also regular cards via Visa. It is able to support pay-per-use and micropayments via its “session” primitive: your agent authorizes a spending limit once, then streams lots of tiny payments against it instead of settling every single one individually. This allows your agent to avoid the fixed per-transaction fee that would otherwise dwarf each tiny payment.

Of course, any such protocol is only useful to the extent that it has been adopted by merchants, so let’s take a look at what kinds of things you can buy with each. Both protocols publish directories of the merchants that accept them, and this is where the two ecosystems diverge sharply.

For MPP, Stripe and Tempo maintain a single canonical list, which currently has 137 merchants. Most are APIs (Anthropic, OpenAI, Alchemy, browser sessions, image generation, various search engines), but only five sell physical goods: Papercut mails a postcard with an AI-generated roast of your GitHub; PostalForm prints and mails real letters and postcards via USPS; Prospect Butcher sold sandwiches for pickup in Brooklyn; Martin Estate Winery ships Napa wine; and Sayer & Stone makes lab-grown-diamond jewelry to order.

x402 has many more merchants but not much more variety. It has no single directory like MPP does. Instead, each of the ~9 production “facilitators” (Coinbase’s CDP, Corbits, Dexter, PayAI, and others) publishes its own catalog. I was able to query two of them, and each returned 1,000+ services. Of those two thousand combined, the only one I found selling a physical good was another print-and-mail-letters service called PostAgent, which is functionally identical to PostalForm on MPP. The rest were APIs offering DNS lookups, crypto market data, DeFi analytics, address parsing, business intelligence, ML inference, and so on.

Some of the merchants in the MPP registry also advertise x402 as one of their accepted settlement methods too, so you should be able to pay Martin Estate for a bottle of rosé (in theory, anyway - more on that below), or Sayer & Stone for a diamond bracelet with either method.

First, I hit Anthropic’s pay-per-token Claude API access, over MPP. The endpoint is at /v1/messages, exactly the same path as the standard Anthropic API. I asked for a haiku:

tokens cost money

the bot pays itself to think

death spiral begins

Cost: one-tenth of a cent. The way it worked was by opening a payment channel on-chain, depositing two dollars of USDC as an escrow ceiling, spending 0.001 USDC against it, then closing the channel and returning the unspent balance. The total on-chain footprint for that haiku was two settlement transactions, one open and one close, with the actual charge happening off-chain in between. This is MPP’s session primitive working as intended; I wouldn’t need to make 1,000 payments for a chat with 1,000 turns.

Next, I tried to buy a sandwich.

Prospect Butcher’s whole pitch was ordering-by-agent: POST to a URL, get a pickup code, walk into the Brooklyn shop with your phone. The API was still up, but their /buy endpoint answered with a 403: “Ordering is closed. MPP Day pre-orders are wrapped up - it was a huge success!”. It turns out that it was just a demo run during a one-day launch event Stripe put on, and has been inactive since, so unfortunately I was not able to buy a sandwich.

Afterwards, I tried to buy a bottle of Martin Estate rosé on the MPP Shared Payment Token (fiat) rail. Because wine is age-restricted, the merchant routed me through a KYC layer called AgentScore (which is basically a cross-merchant wrapper over Stripe Identity). The handshake was elegant: the agent handed me a link and polled in the background while I did the human-only part (take a photo of my ID, take a selfie, close the tab). A few minutes later it was verified and the agent resumed the order.

However, due to an implementation issue, Martin Estate never requests the ‘jurisdiction’ field, even though it requires it. This was consistent across all rails and protocols, including Stripe’s own Link wallet, which definitely knows what country I’m in. I was never able to complete the purchase.

The stablecoin rail is where physical goods finally worked.

I bridged some USDC onto Tempo and had the agent use MPP to buy postcards from Papercut for a dollar or two. The equivalent process worked for ordering from PostalForm via x402. At time of writing (just under a week later), I have not yet received either, although it did say 3-7 business days.

At this point, I realized I still hadn’t completed a successful purchase using MPP over fiat rails, so I decided to test the full end-to-end flow with a real transaction. In practice, that meant making a donation to Stripe Climate.

This turned out to be more work than I expected. One hiccup was that Shared Payment Tokens are meant to be minted by a payments platform that sits between you and the merchant rather than a solo person. As such, to truly get down to zero humans in the loop, I had to register as the "agent" and mint the tokens myself.

Getting there required some yak-shaving: Stripe uses “profile” for two unrelated things (account activation and your public identity in the agentic-commerce network; the latter lives at an undocumented URL), and mppx‘s CLI is hardcoded to reject live keys. Once I found the right profile page and wrote my own script to hit the /contribute endpoint directly, it worked the first time.

The payoff:

I received a real one-dollar charge on my card, funding real carbon removal. This was the first time a real card had been charged via MPP in any of my experiments. The payment settled instantly and felt like a normal Stripe transaction, which is exactly what it was.

Stripe minted a Shared Payment Token against my credit card, and sent it over an agentic-commerce protocol that Stripe co-designed, to pay a service hosted by Stripe, which is just about the happiest happy path one could imagine (but at least it worked).

Agentic commerce is nascent and sparsely adopted, but works in its current form, at least in the best cases. Both pay-as-you-go API usage and digital goods purchases work quite well on both protocols, but there’s not much else to buy.

Merchant adoption is the real bottleneck. Few support either protocol, and the implementations are often buggy or temporary, as evidenced by Martin Estate and Prospect Butcher, respectively.

In future articles, I’ll cover why merchants block buying agents (see: Amazon suing Perplexity); why irreversible payments are a bug, not a feature, for agentic commerce; and who eats the chargebacks.

Discussion about this post

Ready for more?