Payments: timeouts without double spend
No reply is not “pay again”. Idempotency, status and fees decide whether the agent burns money.
The agent finds an offer, pays and waits for the file. Then nothing comes back. The file is missing. The money may already be gone. A missing reply is not a second payment attempt. You need an approval you can check later, a status you can trust, and a match between the amount and the service that was delivered.
A timeout is not a blank cheque
A purchase has more states than “paid” and “not paid”. A card authorization is not a final charge. A confirmed blockchain transaction does not prove delivery. Authorization, capture and settlement are three different moments. Read status words the way the payment rail you use defines them.
| Step | Question | Evidence |
|---|---|---|
| Order | Which service, on what terms? | Order ID, description, price cap |
| Approval | May this order spend money now? | Policy decision, and human approval where you require it |
| Payment | Requested, authorized or settled? | Payment ID and status at the provider or on-chain |
| Delivery | Did the agreed service arrive? | Response, delivery receipt, acceptance |
| Reconciliation | Do order, payment and delivery match? | Booking, and documented exceptions |
Give the job a stable business ID before the first payment attempt. If the provider supports idempotency, repeat the request with the same key, inside the rules it documents. You need to know how long that promise lasts and what it covers. When the outcome is unclear, look up the payment ID or the transaction hash first. Keep the reserved budget tied up while the status stays open. A second attempt with a new payment ID can pay for the same purchase again.
On a blockchain, broadcasting the same signed transaction again and creating a new payment are two different operations. Nonce and replacement rules depend on the network. The Transaction Decoder shows what a signed raw transaction contains. A generic retry button treats those two operations as one.
A workable exception path distinguishes at least: payment failed, payment still open, paid and delivered, paid without delivery. The last one needs a fresh delivery attempt or its own refund process. If you mark it as failed, the outflow disappears from the books.
Fees and batches
Tiny amounts need the full fee calculation. Suppose a fictional payment costs €0.01 fixed plus 1% of the amount. On a purchase of €0.05:
Fee = €0.01 + 0.01 × €0.05 = €0.0105
That is 21% of the purchase price. The fixed part alone is already a fifth of €0.05. One hundred such payments produce €1.05 in fees on €5 of goods. One batched payment of €5 costs €0.06 under the same assumed formula, or 1.2%. These are not the current fees of any particular network or provider. On a €0.05 purchase, the fixed charge sets the price.
| Purchase | Fee | Share |
|---|---|---|
| 1 × €0.05 | €0.0105 | 21% |
| 100 × €0.05 | €1.05 | 21% |
| 1 × €5, batched | €0.06 | 1.2% |
Batching can require pre-funding, a balance held with the supplier, and an extra internal record of who consumed what. Currency conversion, network fees, withdrawals and operating costs can sit on top of that. Count the total cost of each service that arrived and that you accepted. A cheap payment for an unusable answer is still a failed purchase.
A fictional daily budget of €20 does little if ten jobs run at once and each of them sees the same untouched remainder. Approval has to check the budget and reserve the amount as one indivisible step. Once a job has reserved money, the others must already see that amount as taken. When the job finishes, reconcile the reservation against the actual cost. Fees belong in the reservation. An unknown payment status must not release the budget early. Add a per-purchase cap, an allowlist of merchants, allowed currencies or tokens, and an escalation when the recipient is new. These rules have to fire outside the language model. “Spend at most €20” in the prompt is not a spending lock. The wallet side of that is chapter 5.
x402, AP2 and Co.
x402, AP2 and ACP often share a sentence, and they attach to different parts of the purchase.
- x402 ties a payment requirement and a payment proof to HTTP access. That fits an API that sells a single dataset. The request, proof and retry flow is in the Coinbase x402 docs.
- AP2 works with cryptographically provable mandates. The version checked for this atlas (10 October 2026) is v0.2 and uses SD-JWT checkout and payment mandates: what the agent was authorized to do, and which purchase was approved.
- ACP describes the interaction with the merchant, in particular checkout and the payment flows that go with it.
Which rails are supported depends on the version and the implementation. A protocol name on a product page does not say what happens if delivery fails, a dispute comes up, or a refund is due. With an established supplier, an ordinary API account with invoicing can already be enough. Per-item payments become interesting when each service has its own price and there is no billing relationship yet. Integration and reconciliation decide whether that is worth the trouble.
Pilot metrics
For the start, one limited service from an approved supplier, in a test environment, is enough. Deliberately test delayed replies, duplicate calls, unusable deliveries, parallel purchases and refunds.
Count accepted deliveries, total cost, double charges, open reconciliation cases and human interventions. Transaction counts count payments. Whether the delivery was usable shows up in accepted results and in reconciliation. Only reconciliation posts the job into the books. The same unit logic, review and operations per accepted result, is in What an AI agent actually costs.
Sources
- Deep dive: When AI agents pay. Limits before the signature: chapter 5.
- x402: protocol and implementations, How it works.
- AP2: specification. ACP: Agentic Commerce Protocol.
- Stripe: Idempotent requests.
- OWASP: Excessive Agency.
Cheat sheet: formulas and go-live checklist.