{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/sellfy/main/json-schema/sellfy-license-state-response-schema.json",
  "title": "LicenseStateResponse",
  "description": "Current state of the license key.",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-sellfy-openapi.json#/components/schemas/LicenseStateResponse",
  "properties": {
    "valid": {
      "description": "Whether the key is currently usable.",
      "readOnly": true,
      "title": "Valid",
      "type": "boolean"
    },
    "status": {
      "description": "`issued` (sold, not activated yet), `activated` (has at least one activation), or the reason the key is not valid: `revoked` or `expired`.",
      "readOnly": true,
      "title": "Status",
      "type": "string"
    },
    "activations": {
      "description": "Currently active activations, oldest first.",
      "items": {
        "$ref": "#/$defs/LicenseActivationResponse"
      },
      "readOnly": true,
      "title": "Activations",
      "type": "array"
    }
  },
  "required": [
    "valid",
    "status",
    "activations"
  ],
  "type": "object",
  "$defs": {
    "LicenseActivationResponse": {
      "description": "A single activation recorded on the license key.",
      "properties": {
        "id": {
          "description": "Id of the activation — deactivate it with `DELETE /v1/licenses/activations/{activation_id}/`.",
          "title": "Id",
          "type": "string"
        },
        "activated_at": {
          "title": "Activated At",
          "type": "string"
        },
        "meta": {
          "description": "The `meta` data sent when activating.",
          "readOnly": true,
          "title": "Meta",
          "type": "object"
        }
      },
      "required": [
        "id",
        "activated_at",
        "meta"
      ],
      "title": "LicenseActivationResponse",
      "type": "object"
    }
  }
}