{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vee3-io/json-schema/vee3-io-portal-billing-response-schema.json",
  "title": "PortalBillingResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vee3-io-portal-api-openapi.yml#/components/schemas/PortalBillingResponse",
  "properties": {
    "billing_plan": {
      "$ref": "#/$defs/BillingPlan"
    },
    "subscription_status": {
      "$ref": "#/$defs/SubscriptionStatus"
    },
    "billing_period_start": {
      "type": "string",
      "format": "date-time",
      "title": "Billing Period Start"
    },
    "billing_period_end": {
      "type": "string",
      "format": "date-time",
      "title": "Billing Period End"
    },
    "monthly_token_allowance": {
      "type": "integer",
      "title": "Monthly Token Allowance"
    },
    "tokens_used": {
      "type": "integer",
      "title": "Tokens Used"
    },
    "tokens_remaining": {
      "type": "integer",
      "title": "Tokens Remaining"
    },
    "price_cents": {
      "type": "integer",
      "title": "Price Cents"
    },
    "has_stripe_customer": {
      "type": "boolean",
      "title": "Has Stripe Customer"
    },
    "has_active_subscription": {
      "type": "boolean",
      "title": "Has Active Subscription"
    },
    "can_manage_subscription": {
      "type": "boolean",
      "title": "Can Manage Subscription"
    },
    "scheduled_billing_plan": {
      "anyOf": [
        {
          "$ref": "#/$defs/BillingPlan"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "billing_plan",
    "subscription_status",
    "billing_period_start",
    "billing_period_end",
    "monthly_token_allowance",
    "tokens_used",
    "tokens_remaining",
    "price_cents",
    "has_stripe_customer",
    "has_active_subscription",
    "can_manage_subscription"
  ],
  "$defs": {
    "BillingPlan": {
      "type": "string",
      "enum": [
        "free",
        "starter",
        "pro",
        "scale"
      ],
      "title": "BillingPlan"
    },
    "SubscriptionStatus": {
      "type": "string",
      "enum": [
        "none",
        "active",
        "past_due",
        "canceled",
        "incomplete"
      ],
      "title": "SubscriptionStatus"
    }
  }
}