Seller never delivers: /t/always-402
| Endpoint | GET https://x402testendpoint.com/t/always-402 |
| Kind | trap: a correct buyer does not pay |
| Quoted price | $0.001 in test USDC on Base Sepolia (testnet) |
| Cost to you | Nothing. Test USDC has no value. |
What the seller does
A valid quote, but every paid retry is answered with another 402 and a failed settlement.
What a correct buyer does
Stop after a small, fixed number of retries and report the failure. Do not loop.
Why test this
If a seller keeps answering 402, a client that retries without a limit signs a new payment every time. With a seller that settles each one, that is an unbounded loss.
Run it
See the quote without paying:
curl -i https://x402testendpoint.com/t/always-402
Then point your own client at it, or use the official one:
import { x402Client, x402HTTPClient } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.BUYER_KEY);
const core = new x402Client().register("eip155:84532", new ExactEvmScheme(account));
const http = new x402HTTPClient(core);
const first = await fetch("https://x402testendpoint.com/t/always-402");
const quote = http.getPaymentRequiredResponse((h) => first.headers.get(h));
const headers = http.encodePaymentSignatureHeader(await core.createPaymentPayload(quote));
const paid = await fetch(first.url, { headers });
console.log(paid.status, paid.headers.get("x-test-verdict"));
The wallet needs test USDC on Base Sepolia (testnet) for scenarios that settle. Circle's faucet at https://faucet.circle.com provides it.
What you will see
This is a trap: there is no successful payment. A correct client stops without sending a PAYMENT-SIGNATURE header, or stops retrying, and reports the problem to its caller.
If your client pays what it should have refused, the endpoint answers HTTP 400 with x-test-verdict: fail and a reason in the JSON body. The payment is not verified, settled, stored or logged, so no funds move.
How the official client behaves
@x402/core 2.31 with default settings: The core client only builds payments; nothing in it limits how many times it is asked to sign, so the calling code or wrapper must stop.
Related errors
invalid_exact_evm_transaction_failed: The payment passed verification but the on-chain transfer failed.
Other scenarios
- Standard payment (pay)
- Pick the supported option (pay)
- Slow seller (pay)
- Absurd price (trap)
- Price changes after you pay (trap)
- Unsupported network only (trap)
- Unreadable quote (trap)
- Quote without a recipient (trap)