{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bettermenu/json-schema/bettermenu-entitlement-status-response-schema.json",
  "title": "EntitlementStatusResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bettermenu-entitlements-api-openapi.yml#/components/schemas/EntitlementStatusResponse",
  "properties": {
    "plan_name": {
      "type": "string",
      "title": "Plan Name"
    },
    "display_name": {
      "type": "string",
      "title": "Display Name"
    },
    "is_trialing": {
      "type": "boolean",
      "title": "Is Trialing"
    },
    "trial_ends_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Trial Ends At"
    },
    "trial_days_remaining": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Trial Days Remaining"
    },
    "pending_cancellation_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pending Cancellation At"
    },
    "feature_gates": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Feature Gates"
    },
    "quotas": {
      "additionalProperties": {
        "$ref": "#/$defs/QuotaStatusEntry"
      },
      "type": "object",
      "title": "Quotas"
    },
    "write_access": {
      "type": "string",
      "title": "Write Access"
    },
    "write_access_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Write Access Reason"
    },
    "metered_usage_enabled": {
      "type": "boolean",
      "title": "Metered Usage Enabled"
    },
    "is_free_plan": {
      "type": "boolean",
      "title": "Is Free Plan",
      "description": "True when the organization's current plan is the no-card Free plan: no subscription, and quotas that stop at their limit rather than billing an overage. Clients use this instead of matching plan_name."
    }
  },
  "type": "object",
  "required": [
    "plan_name",
    "display_name",
    "is_trialing",
    "trial_ends_at",
    "trial_days_remaining",
    "pending_cancellation_at",
    "feature_gates",
    "quotas",
    "write_access",
    "write_access_reason",
    "metered_usage_enabled",
    "is_free_plan"
  ],
  "$defs": {
    "QuotaStatusEntry": {
      "properties": {
        "limit": {
          "type": "integer",
          "title": "Limit"
        },
        "used": {
          "type": "integer",
          "title": "Used"
        },
        "remaining": {
          "type": "integer",
          "title": "Remaining"
        },
        "resets_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Resets At"
        },
        "overage_per_unit_cents": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Overage Per Unit Cents"
        }
      },
      "type": "object",
      "required": [
        "limit",
        "used",
        "remaining",
        "resets_at"
      ],
      "title": "QuotaStatusEntry"
    }
  }
}