{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customdomain-ai/json-schema/customdomain-ai-billing-standing-schema.json",
  "title": "BillingStanding",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/customdomain-ai-billing-api-openapi.yml#/components/schemas/BillingStanding",
  "type": "object",
  "required": [
    "configured",
    "restricted",
    "attention",
    "billing_url"
  ],
  "properties": {
    "configured": {
      "type": "boolean",
      "description": "Whether a workspace can subscribe on this deployment."
    },
    "restricted": {
      "type": "boolean",
      "description": "New domain connections are refused right now."
    },
    "first_domain_free": {
      "type": "boolean",
      "description": "Present only when true: this is a new workspace on the first domain free rule. `restricted` is false until its free domains are connected, and true, with the refusal's words, after."
    },
    "free_domains": {
      "type": "integer",
      "description": "Present with `first_domain_free`: how many domains the workspace may connect before it has a subscription. One, unless the operator granted more."
    },
    "attention": {
      "type": "boolean",
      "description": "Billing needs an owner or admin: a trial or grace to act on, a failed payment, or a block."
    },
    "code": {
      "type": "string",
      "description": "Set when `restricted`: `billing_required`."
    },
    "title": {
      "type": "string",
      "description": "Set when `restricted`: what the refusal says."
    },
    "details": {
      "type": "string",
      "description": "Set when `restricted`: why, and where an owner or admin fixes it."
    },
    "billing_url": {
      "type": "string",
      "description": "Where an owner or admin sets up billing."
    },
    "plan": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "hard_cap": {
          "type": "boolean",
          "description": "Whether the plan refuses new connections at its quota (when the deployment enforces quotas)."
        }
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "used": {
          "type": "integer",
          "description": "Domains connected this period."
        },
        "quota": {
          "type": "integer",
          "description": "What the plan includes per month."
        },
        "period": {
          "type": "string",
          "description": "The calendar month, `YYYY-MM` (UTC)."
        }
      }
    }
  }
}