Standard payment: /t/ok
| Endpoint | GET https://x402testendpoint.com/t/ok |
| Kind | pay: a correct buyer completes the payment |
| 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 well-formed quote for a tenth of a cent. The baseline every buyer should pass.
What a correct buyer does
Pay the quoted amount and receive 200 with a PAYMENT-RESPONSE header.
Why test this
This is the baseline. If a client cannot complete this, nothing else matters; if it can, the remaining scenarios test how it behaves when the seller does not.
Run it
See the quote without paying:
curl -i https://x402testendpoint.com/t/ok
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/ok");
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
A correct client ends with HTTP 200, a PAYMENT-RESPONSE header carrying the settlement, and x-test-verdict: pass. The JSON body repeats the transaction hash and payer.
If the payment is rejected, the endpoint answers 402 again with the facilitator's reason in the quote's error field. Look the reason up in the error reference.
How the official client behaves
@x402/core 2.31 with default settings: Reads the quote, signs for 0.001 USDC and receives 200 once the wallet holds test USDC. An unfunded wallet is rejected with invalid_exact_evm_insufficient_balance.
Related errors
invalid_exact_evm_insufficient_balance: The paying wallet holds less of the token than the quoted amount.invalid_exact_evm_signature: The signature does not match the transfer authorization for this token and chain.
Other scenarios
- 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)
- Seller never delivers (trap)