{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/agent-commercial-layer.schema.json",
  "title": "Agent Commercial Layer",
  "type": "object",
  "required": [
    "schema_version",
    "mode"
  ],
  "properties": {
    "schema_version": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": [
        "read_fee_catalog",
        "quote_fee",
        "record_fee_event",
        "create_commercial_plan"
      ]
    },
    "fee_type": {
      "type": "string",
      "enum": [
        "micro_routing_fee",
        "receipt_fee",
        "escrow_fee",
        "premium_wallet_tier",
        "developer_fee",
        "trust_badge_fee",
        "enterprise_controls"
      ]
    },
    "amount_units": {
      "type": "number",
      "minimum": 0
    },
    "payment_amount_units": {
      "type": "number",
      "minimum": 0
    },
    "receipt_count": {
      "type": "integer",
      "minimum": 1
    },
    "usage_quantity": {
      "type": "integer",
      "minimum": 1
    },
    "bps": {
      "type": "number",
      "minimum": 0
    },
    "unit_fee_units": {
      "type": "number",
      "minimum": 0
    },
    "monthly_units": {
      "type": "number",
      "minimum": 0
    },
    "fee_units": {
      "type": "number",
      "minimum": 0
    },
    "currency": {
      "type": "string"
    },
    "wallet_id": {
      "type": "string"
    },
    "payment_intent_id": {
      "type": "string"
    },
    "wallet_bound_run_id": {
      "type": "string"
    },
    "receipt_id": {
      "type": "string"
    },
    "escrow_reference": {
      "type": "string"
    },
    "developer_account_id": {
      "type": "string"
    },
    "trust_listing_id": {
      "type": "string"
    },
    "enterprise_account_id": {
      "type": "string"
    },
    "commercial_state": {
      "type": "string"
    },
    "source_payload": {
      "type": "object"
    }
  },
  "additionalProperties": true
}