This is a buyer-side example for a wallet you control. Our seller service never needs your wallet key. The fixed offer is 0.10 USDC on Solana mainnet for one board snapshot.
Download the buyer adapter and Node.js file journal. The adapter checks the service URL, recipient, asset, network and exact price before asking your configured x402 client to sign. It submits once. The journal prevents reuse of a request ID, and retains the payment header and receipt privately for reconciliation.
import { x402Client } from '@x402/core/client';
import { ExactSvmScheme } from '@x402/svm/exact/client';
import { buyListingSnapshot } from './listing-buyer.mjs';
import { FileJournal } from './file-journal.mjs';
// Supply your existing Solana TransactionSigner and private journal directory.
// Do not put wallet keys or the journal in a public website or workflow export.
const client = new x402Client().register(
'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
new ExactSvmScheme(buyerOwnedSigner, { rpcUrl: buyerChosenRpcUrl })
);
const journal = new FileJournal(absolutePrivateJournalDirectory);
const { report, settlement } = await buyListingSnapshot({
requestId: uniqueBusinessOperationId,
input: { provider: 'greenhouse', board: 'figma', maxJobs: 100 },
client, journal
});
// Use report.jobs; retain settlement.transaction as the payment receipt.
Reference SDK versions used in our tests: @x402/core@2.28.0, @x402/svm@2.28.0, Node.js 24. The signer and RPC are buyer configuration, not included credentials. Only call the purchasing function after approving the 0.10 USDC spend in your application. Polling on a schedule creates a new purchase each time; set your own total budget.
A plain HTTP Request node can receive the 402 offer but cannot sign it. For a self-hosted automation, run the buyer adapter in your own payment-capable backend and call that backend from n8n. Keep the signer, RPC settings and private journal there. Authenticate the backend and enforce your own spending limits before scheduling calls. No native verified n8n Cloud payment node is being advertised here.
Do not wrap this purchasing function in an automatic retry with a fresh request ID. If submission times out, read the existing journal and reconcile its signed payment and transaction. A confirmed settled request can be replayed against the seller with the same input and PAYMENT-SIGNATURE to obtain its saved snapshot without another settlement. A different input with that payment is rejected.
Our server integration completed a real devnet transfer with test tokens, and returned its cached report on replay. The adapter’s guards and journal are covered by automated tests; this public buyer example has not made a mainnet purchase.