How an AI agent actually pays for something

There's a lot written about AI agents doing your shopping and very little about the payment itself, which is the part where the idea meets an obstacle. Card networks were designed around a person holding a card. Take the person out and most of the machinery stops producing meaningful answers.

We're Cryptorefills, selling gift cards, mobile top-ups, eSIMs and travel for crypto, and we've been running agent payments on a live catalog, so here's the mechanical version of what happens.

https://www.cryptorefills.com

The request that gets refused first

An agent asks a merchant server for something priced. The server answers with HTTP 402, a status code that has existed since the early web and went essentially unused for thirty years. It means Payment Required.

The 402 response is not a rejection so much as a quote. It carries a structured body naming which chain to pay on, which asset, the exact amount, the receiving address, and a timestamp after which the quote expires.

The request that gets paid

The agent takes that quote, signs a payment payload with its wallet, and sends the identical request again with the payload attached in a header called X-PAYMENT.

This time the server checks the payment, hands over the product, and includes a signed receipt confirming settlement. Two round trips, no account, no stored card, no relationship that existed before the first request.

That last part is what makes it work for software. An agent encountering a merchant for the first time can complete a purchase immediately, because everything needed to authorize it travels with the request.

Why it settles in stablecoins

There are five things an agent payment has to do, and each one has to be handled by the rail itself rather than by a person.

Prove who is paying. A wallet signature over the payment payload.

Cap what can be spent. A ceiling set in advance, per resource and per agent.

Settle fast enough to deliver instantly. One second or less on Base and Solana.

Produce a checkable receipt. A signed settlement proof, verifiable on chain.

Keep fees below the purchase price. Cents on the networks in use.

A bank transfer fails the third of those. A card fails the first and the fourth, since the identity it verifies is a cardholder's and the receipt it produces is a statement line. Stablecoins on inexpensive networks clear all five, which is the whole reason agent commerce settled on them rather than on anything a bank issues.

The part that took us longest

Fast final settlement creates a problem that slow reversible settlement hides. Once payment is irreversible in one second, the merchant has to be certain about what "delivered" means before accepting it.

For a gift card, that's simple, since the product is a code and delivery happens the moment the code is issued. An eSIM needs a carrier to provision a QR, and that can fail after the money has already arrived. A mobile top-up calls a carrier API that might time out halfway. A flight is a reservation against inventory that other people are also booking against.

Four products, four different ways for payment and delivery to come apart, and no chargeback available to clean up afterward. Each one needs a resolution path decided in advance, because deciding it during an incident goes badly.

We wrote ours down publicly, CC0 licensed, so it's there to be copied:

https://github.com/Cryptorefills/agentic-commerce

Where it stands

Autonomous purchasing gets the headlines, and it currently makes most sense for machine-to-machine spending like metered API access. The consumer version keeps a person in the loop: the assistant finds the product and quotes the price, you approve the payment once.

Whether that becomes normal depends on something nobody can currently measure, which is how people feel about software holding a spending allowance. The protocol side is largely solved. The trust side has not really been tested yet, and the first serious test will probably be an incident rather than a launch.

The setup path for connecting an assistant to a live catalog, along with the payment methods endpoint an agent reads on first contact, is documented here:

https://www.cryptorefills.com/en/api-docs

Sort:  
Loading...