Skip to content

Agents

Getting started

Agents

Hook Fiscal402 after your agent has already settled. Fiscal402 is not a wallet and not a facilitator. MCP JSON-RPC is implemented for capabilities, evaluate, and receipts.

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.

  1. agent pays via x402
  2. transfer settled
  3. afterSettlement(evidence)
  4. 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

FieldWhy
txHash + network + amountUsdcAlready-settled x402 exact transfer
timestampFX as-of (USDC→EUR)
payerWallet / receiverWalletPayment identity only
consumerCountryEU 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.