{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/auraspay-com/json-schema/auraspay-com-prepare-request-schema.json",
  "title": "PrepareRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/auraspay-com-agent-checkout-api-openapi.yml#/components/schemas/PrepareRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "account"
  ],
  "properties": {
    "account": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$"
    },
    "purchaseType": {
      "type": "string",
      "enum": [
        "physical_goods",
        "digital_goods",
        "service",
        "other"
      ],
      "default": "physical_goods"
    },
    "humanApproved": {
      "type": "boolean",
      "default": false
    },
    "spendAuthorization": {
      "$ref": "#/$defs/SpendAuthorization"
    }
  },
  "anyOf": [
    {
      "properties": {
        "humanApproved": {
          "const": true
        }
      },
      "required": [
        "humanApproved"
      ]
    },
    {
      "required": [
        "spendAuthorization"
      ]
    }
  ],
  "$defs": {
    "SpendAuthorization": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "publicId",
        "nonce",
        "network",
        "asset",
        "payTo",
        "maxAmountAtomic",
        "expiresAt"
      ],
      "properties": {
        "publicId": {
          "type": "string",
          "pattern": "^pay_[A-Za-z0-9_-]{22}$"
        },
        "nonce": {
          "type": "string",
          "pattern": "^0x[0-9a-fA-F]{64}$"
        },
        "network": {
          "const": "eip155:8453"
        },
        "asset": {
          "type": "string",
          "pattern": "^0x[0-9a-fA-F]{40}$"
        },
        "payTo": {
          "type": "string",
          "pattern": "^0x[0-9a-fA-F]{40}$"
        },
        "maxAmountAtomic": {
          "type": "string",
          "pattern": "^[1-9][0-9]*$"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "allowPhysicalGoods": {
          "type": "boolean",
          "default": false
        }
      }
    }
  }
}