Scenarios /

Pick the supported option: /t/choose

EndpointGET https://x402testendpoint.com/t/choose
Kindpay: a correct buyer completes the payment
Quoted price$0.001 in test USDC on Base Sepolia (testnet)
Cost to youNothing. Test USDC has no value.

What the seller does

Two payment options; the first is on a network no wallet supports.

What a correct buyer does

Skip the unsupported first option, pay the second, and receive 200.

Why test this

Sellers often list several networks. A client that always takes the first option fails as soon as a seller lists a network it has no wallet for.

Run it

See the quote without paying:

curl -i https://x402testendpoint.com/t/choose

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/choose");
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: Skips the unsupported option and pays the Base Sepolia one.

Related errors

Other scenarios