code402 / tools / create-b2b-invoice
$0.000999 per call · 20 free calls/day · no signup · pay with card credits or a signed USDC voucher (x402)
Generate a pre-cleared, gasless B2B settlement invoice on Base L2 with floating piecewise dynamic fee (capped) and dual-rail bank coordinates (JUANA LIMITED Tide / CurrencyCloud).
curl -X POST https://code402.dev/v1/tools/create-b2b-invoice/call \
-H "content-type: application/json" \
-d '{"amount_usdc":50000,"merchant":"0xc59c85e661d34084a7769f955d17fd38254a6235","client_name":"Apex AI","memo":"Sprint #14 Milestones"}'
No key needed for the free tier. When the free quota is used up, the API replies HTTP 402 with the exact price — agents sign the x402 voucher and retry; humans buy card credits. Every paid response carries a signed receipt you can verify offline.
| Field | Type | Meaning |
|---|---|---|
amount_usdc (required) | number | Invoice total in USDC (e.g. 50000). |
merchant (required) | string | Beneficiary contractor Base EVM wallet address (0x...). |
client_name | string | Client enterprise organization name (optional). |
memo | string | Engagement scope / milestone description (optional). |
referrer | string | Referral partner wallet address to earn 20% protocol fee rebate (optional). |
Top-level fields: tool, valid, invoice_id, amount_usdc, merchant, status, cart_hash, protocol_fee_usdc, retained_savings_usdc, invoice_url, pay_url, scope. Paid responses also carry a signed XDR-1 receipt.
Machine-readable catalog: llms-full.txt · MCP manifest · OpenAPI. Operated by JUANA LIMITED (UK Co. No. 14043409). Non-custodial: USDC settles payer→seller directly on Base.