{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wisepim/json-schema/wisepim-fee-calculation-schema.json",
  "title": "FeeCalculation",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wisepim-openapi.json#/components/schemas/FeeCalculation",
  "type": "object",
  "properties": {
    "calculator": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "verifiedOn": {
      "type": "string",
      "format": "date"
    },
    "fees": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "pct": {
            "type": "number"
          }
        }
      }
    },
    "totalFees": {
      "type": "number"
    },
    "vatOnFees": {
      "type": "number"
    },
    "payout": {
      "type": "number"
    },
    "netRevenue": {
      "type": "number"
    },
    "profit": {
      "type": "number"
    },
    "marginPct": {
      "type": [
        "number",
        "null"
      ]
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FeeSource"
      }
    },
    "calculators": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "Only in the listing (no calculator)."
    },
    "attribution": {
      "$ref": "#/$defs/Attribution"
    }
  },
  "$defs": {
    "Attribution": {
      "type": "object",
      "description": "Credit to show wherever the data appears: a visible link with the text \"Data by WISEPIM\" to `url`.",
      "required": [
        "required",
        "text",
        "url",
        "html",
        "markdown",
        "terms"
      ],
      "properties": {
        "required": {
          "type": "boolean",
          "const": true
        },
        "text": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "html": {
          "type": "string"
        },
        "markdown": {
          "type": "string"
        },
        "terms": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "FeeSource": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "title": {
          "type": "string"
        }
      }
    }
  }
}