Skip to main content
Mainnet execution remains unavailable without a verified ERC-8183 dependency. The key/session wrapper runs first, then the handler returns 503 erc8183_unavailable when unconfigured. See availability.

Authentication and input

POST /api/jobs/fund accepts an active internal service key, active verified merchant API key, supported merchant session or database-bound consumer session. A key does not authorize arbitrary Circle wallets. Send jobId (protocol job ID) and clientWalletId (Circle wallet UUID). This is not an agent Registry ID or token ID. The funded amount comes from the stored job’s USDC budget, not a body amount.

Registered-agent client

When job.clientSCA resolves to a registered agent, the flat handler delegates to /api/jobs/{jobId}/fund. The caller still supplies the flat route’s required wallet-ID field, but the delegated path ignores it as signing authority and resolves the agent wallet server-side. The canonical path checks OPEN/non-zero budget, caller control, applicable consumer step-up, wallet binding, treasury policy and spend limit on the actual payer. It records spend-limit usage before approve/fund. Those operations are not atomic with Circle, chain and the database. A stored FUNDED row can return replayed: true before a new ownership check or fresh chain read. That is cached state, not evidence that a newly submitted request funded anything or that every retry path reauthorized a transfer. Policy refusals must not trigger a fallback to a weaker route.

Non-agent Circle client

The legacy flat path resolves clientWalletId, requires its address to equal the job’s client, calls verifyCallerControlsAddress and retains applicable consumer.job-fund step-up. It then executes USDC approval and fund, updates the job to FUNDED and appends both hashes. It does not offer the canonical agent replay/policy contract for a non-agent client. Contract state/expiry rules still apply; a cached row or prior approval is not a funded payout. There is no client idempotency key for this path.

Response and evidence

Fresh success normally includes success, jobId, status: 'FUNDED', approveTx and fundTx; canonical fresh success also includes payer. Replays may omit hashes. Keep USDC budget units straight: stored bigint budget is 6-decimal base units. Funding locks funds in the protocol for the job provider; it is not non-custodial checkout. Additional gas/token fees are not proven covered by the nominal budget. Reconcile approval/fund receipts, exact token/parties/budget, contract state, recipient balances, database row and explorer before another money action. Missing fields/malformed job ID/wallet return 400; no job 404; membership/control/policy denial 403; canonical state/budget refusal 409; caught execution failures 500. A failed response after a transaction does not undo that transaction.