{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/u-cash/json-schema/u-cash-resource-schema.json",
  "title": "Resource",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agents-u.cash-openapi.json#/components/schemas/Resource",
  "type": "object",
  "required": [
    "amount"
  ],
  "properties": {
    "amount": {
      "type": "number",
      "description": "fiat price, e.g. 0.05"
    },
    "currency": {
      "type": "string",
      "default": "USD"
    },
    "accepted_assets": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "defaults to all configured wallets"
    },
    "webhook_url": {
      "type": "string",
      "format": "uri",
      "description": "notified (HMAC-signed) on settlement"
    },
    "max_per_caller": {
      "type": "object",
      "description": "optional per-caller spend cap; a payer whose settled spend in the window reaches amount is refused new authorization",
      "properties": {
        "amount": {
          "type": "number"
        },
        "window_hours": {
          "type": "integer"
        },
        "by": {
          "type": "string",
          "enum": [
            "wallet",
            "ip"
          ],
          "default": "wallet",
          "description": "wallet = enforce at verify/settle; ip = enforce at the door before charge"
        }
      }
    },
    "checkout_url": {
      "type": "string",
      "format": "uri",
      "description": "response field: the canonical buyer door on pay.u.cash (/checkout/<enc>?cloud=<token>). A human gets the HTML checkout; an agent fetches ?agent=1 for the 402 manifest; an x402 client sends X-PAYMENT"
    },
    "test": {
      "type": "boolean",
      "description": "test mode: settles instantly for $0, no wallet needed, marked in responses, excluded from earnings"
    },
    "test_confirmations": {
      "type": "integer",
      "minimum": 0,
      "maximum": 12,
      "default": 1,
      "description": "sandbox only: simulated confirmations required before settle (POST /v1/simulate-payment advances them; default 1 = instant, like the historic behavior)"
    }
  }
}