{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/entitylight/json-schema/entitylight-usage-schema.json",
  "title": "Usage",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entitylight-openapi.json#/components/schemas/Usage",
  "type": "object",
  "properties": {
    "plan": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "lookups": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Lookups included per period"
        },
        "lookupPeriod": {
          "type": "string",
          "enum": [
            "once",
            "month"
          ]
        },
        "watches": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991,
          "description": "Businesses that can be watched at once"
        }
      },
      "required": [
        "key",
        "name",
        "lookups",
        "lookupPeriod",
        "watches"
      ],
      "additionalProperties": false
    },
    "periodStart": {
      "description": "ISO 8601; null for a one-time allowance",
      "type": [
        "string",
        "null"
      ]
    },
    "periodEnd": {
      "description": "ISO 8601; null for a one-time allowance",
      "type": [
        "string",
        "null"
      ]
    },
    "lookupsUsed": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Charged lookups, watch checks, UCC searches, OFAC screenings and business searches in the period. One where nothing was searched isn't charged."
    },
    "byKind": {
      "type": "object",
      "properties": {
        "lookups": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "watchChecks": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "uccSearches": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "businessSearches": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "ofacScreenings": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "lookups",
        "watchChecks",
        "uccSearches",
        "businessSearches",
        "ofacScreenings"
      ],
      "additionalProperties": false,
      "description": "lookupsUsed split by kind"
    },
    "lookupsRemaining": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "activeWatches": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "plan",
    "periodStart",
    "periodEnd",
    "lookupsUsed",
    "byKind",
    "lookupsRemaining",
    "activeWatches"
  ],
  "additionalProperties": false
}