{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mencoro-com/json-schema/mencoro-com-entitlements-resource-schema.json",
  "title": "EntitlementsResource",
  "description": "What an organization's plan allows and what it has consumed",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mencoro-com-openapi.json#/components/schemas/EntitlementsResource",
  "required": [
    "status",
    "isEntitled"
  ],
  "properties": {
    "status": {
      "description": "\"none\" when the organization has never had a subscription contract.",
      "type": "string",
      "enum": [
        "active",
        "inactive",
        "none"
      ]
    },
    "isEntitled": {
      "description": "Whether the organization may use paid features right now: an active contract, or a cancelled one still inside its paid grace window.",
      "type": "boolean"
    },
    "checkBudget": {
      "description": "Checks the current cycle allows. Null when there is no plan on file, which is not the same as a budget of zero.",
      "type": [
        "integer",
        "null"
      ]
    },
    "checksConsumed": {
      "description": "Checks consumed so far in the current cycle. Null when there is no plan on file.",
      "type": [
        "integer",
        "null"
      ]
    },
    "checksAvailable": {
      "description": "Checks left in the current cycle. Null when there is no plan on file.",
      "type": [
        "integer",
        "null"
      ]
    },
    "billingCycleType": {
      "description": "How often the allowance renews. Null when there is no plan on file.",
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "monthly",
        "yearly"
      ]
    },
    "billingCycleAnchor": {
      "description": "Start of the current cycle. Null when there is no plan on file.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "nextResetAt": {
      "description": "When the check budget next resets. Null when there is no plan on file.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "cancelledAt": {
      "description": "When the subscription was terminally cancelled. Null while it has not been.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "scheduledToCancelAt": {
      "description": "When a scheduled cancellation takes effect, while the subscription is still running. Null when none is scheduled.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "gracePeriodEndsAt": {
      "description": "When paid access ends after a cancellation. Null when the subscription has not been cancelled.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "type": "object"
}