My x402 API got its first real payment. Here is the receipt, and the three things that were actually wrong.
I run a small pay-per-call API on Base. For weeks it had zero paying callers. Hundreds of agents found it, read the docs, got the 402 challenge, and left. I know that because I counted: 2,399 requests in one day, 254 distinct IPs, 783 402 responses, 0 payment headers. Then one payment landed. This is the receipt and the three real defects it exposed. The receipt tx:…
One of the smallest pay-per-call APIs on Base made its first real payment. The receipt is provided, along with three significant issues discovered. The API is hosted on Base mainnet, and the transaction status is 0x1. The asset used for the payment was USDC at the atomic value of 20000, equivalent to $0.02. The payer's address and the recipient's address are also provided. The transaction can be verified directly on the Base mainnet website rather than trusting an email.
Defect 1: The payer paid but received a 400 error response. The payment was confirmed on the chain, but the server returned a 400 Bad Request error. The code_explain task attempted to parse the received text using ast.parse(text). The caller sent a normal sentence, "explain print(sum(range(10)))", which resulted in an invalid syntax error (line 1).
The issue is that the money was taken, but no service was delivered. The solution is to accept both raw source and prose, extract the Python expression from the sentence, explain it, and provide a helpful structured response with a copy-paste example if no parseable code is found. Additionally, a concrete example should be included in the 402 body and schema, as agents often read the example rather than the prose.
Defect 2: All routes had the same description. Despite having 28 catalog rows, all endpoints shared a single generic description, listing summarize, sentiment, translation, code tools, and web_search. However, the bazaar schema declared {"task":"web_search"} while the description mentioned something else. Buyers reading the 402 were misled, thinking the endpoint performed a different job.
This issue is more significant than it appears, as an independent audit of 10,000 public catalog rows found a 14.7% misdescription of products. To address this, each task should have a unique description, a 402 resource, discovery documents, and an OpenAPI schema.
Defect 3: The settlement process bypassed the facilitator. The 402 declared the CDP facilitator, but the first payer settled directly, bypassing the facilitator. The transaction input selector was 0xe3ee160e, which is a direct EIP-3009 call to the USDC contract, bypassing the facilitator. There was no call to the facilitator in the transaction.
While the money arrived, the CDP Bazaar merchant endpoint still reported a total of 0, as a row is written only when a payment settles through the facilitator. It is essential to note that declaring a facilitator in the challenge does not force the payer to use it. This bug caused the most time spent on debugging. When verifying the signed authorization manually, EIP-3009 v normalization can cause issues.
The library may recover address(0) and return an "invalid signature" error without clear explanation. To resolve this, normalize 27/28 in some clients and 0/1 in others before recovery. The single most time-consuming bug was the EIP-3009 v normalization issue. To increase the likelihood of a paid API, fix the issue that charges and fails, provide a precise 402 description of the route, verify how payments actually settle, and publish the receipt when someone pays.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to