{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/UsageEvent",
  "title": "UsageEvent",
  "type": "object",
  "required": [
    "subscriberId",
    "serviceType",
    "quantity",
    "usageTimestamp"
  ],
  "properties": {
    "externalId": {
      "type": "string",
      "description": "External identifier for deduplication"
    },
    "subscriberId": {
      "type": "string"
    },
    "serviceType": {
      "type": "string"
    },
    "quantity": {
      "type": "number",
      "format": "double"
    },
    "unit": {
      "type": "string"
    },
    "usageTimestamp": {
      "type": "string",
      "format": "date-time"
    },
    "attributes": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  }
}