payment_required
Create a x402 payment request (HTTP 402) for a resource you sell to another agent. Returns a paymentId, the USDC amount in units, the destination address and the TraceaPayments contract to call. The paying agent must then call TraceaPayments.payX402(destination, amount, paymentId) on-chain — the contract enforces financial cap + whitelist on-chain. Deliver the resource only after payment_incoming confirms fulfilment.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent | No | Address of the paying agent, if known | |
| resource | No | Identifier/URL of the resource to unlock after payment | |
| amount_usdc | Yes | Amount in USDC, e.g. '0.50' or '2' | |
| destination | Yes | Address that receives the USDC payment (yours) | |
| ttl_seconds | No | Validity of the payment session (30-3600s, default 300) |