four02_invoice_create
Create a signed or unsigned 402 EIP-712 invoice for native USDC on Ink, returning the canonical invoice and content-addressed ID for agent payments.
Instructions
Create a 402 EIP-712 invoice for native USDC on Ink (chain 57073). Returns the canonical invoice plus its content-addressed id. If FOUR02_COMMERCE_INVOICE_KEY is configured and matches the issuer, the invoice is signed; otherwise it is returned unsigned with instructions to sign client-side (domain "402 Invoice", version "1").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nonce | No | Optional replay-protection nonce (decimal or 0x hex); random when omitted | |
| payer | No | Buyer agent address; zero address = payable by anyone | 0x0000000000000000000000000000000000000000 |
| issuer | Yes | Seller agent address (must match the signing key) | |
| termsHash | No | Optional keccak256 of the full terms document (bytes32 hex); defaults to keccak256(description) | |
| amountUsdc | Yes | Amount in USDC, e.g. "1.50" (max 6 decimals) | |
| description | Yes | Human-readable line item | |
| expiresInSeconds | No | Invoice lifetime in seconds from now |