Where an agent plugs in
Fiscal402 is not an agent wallet and not a Coinbase CDP wrapper. An MCP JSON-RPC server exposes capabilities, evaluate, receipt lookup, and verification. process_event requires the ingest key. The agent still calls Fiscal402 after the transfer exists.
- agent pays via x402
- ↓
- transfer settled
- ↓
- afterSettlement(evidence)
- ↓
- fiscal402.receipt
Twenty-line hook
Drop this next to CrewAI / LangChain / CDP only as a post-settlement callback. Do not wrap the wallet. Do not issue HTTP 402 from this function. A wallet address is payment identity, not a legal person.
after-settlement.ts
/** After YOUR agent/framework has settled x402. Fiscal402 is not a wallet. */
export async function afterSettlement(ev: {
txHash: string;
amountUsdc: string;
timestamp: string;
payerWallet: string;
receiverWallet: string;
network: "eip155:1" | "eip155:8453";
consumerCountry?: string;
}) {
const res = await fetch("https://api.fiscal402.com/settlements", {
method: "POST",
headers: {
"content-type": "application/json",
"X-Fiscal402-Key": process.env.FISCAL402_API_KEY!,
},
body: JSON.stringify({ ...ev, asset: "USDC", scheme: "exact" }),
});
if (!res.ok) throw new Error(`Fiscal402 ${res.status}`);
return res.json();
}What the hook must send
| Field | Why |
|---|---|
| txHash + network + amountUsdc | Already-settled x402 exact transfer |
| timestamp | FX as-of (USDC→EUR) |
| payerWallet / receiverWallet | Payment identity only |
| consumerCountry | EU VAT destination; attested, not inferred from the wallet |
What this is not
- Default fiscal tracking inside an agent wallet.
- A LangChain tool that fiscalizes a raw hash.
- An MCP server that dumps admin state, signing keys, or merchant secrets.
- Tax remittance, filing, or a guarantee of legal compliance.