{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vertesiahq/json-schema/vertesiahq-stripe-billing-status-response-schema.json",
  "title": "StripeBillingStatusResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vertesiahq-accounts-api-openapi.yml#/components/schemas/StripeBillingStatusResponse",
  "oneOf": [
    {
      "$ref": "#/$defs/StripeBillingEnabled"
    },
    {
      "$ref": "#/$defs/StripeBillingDisabled"
    }
  ],
  "type": "object",
  "required": [
    "status"
  ],
  "$defs": {
    "BillingMethod": {
      "type": "string",
      "enum": [
        "stripe",
        "invoice"
      ]
    },
    "StripeBillingDisabled": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "disabled"
        },
        "billing_method": {
          "anyOf": [
            {
              "$ref": "#/$defs/BillingMethod"
            },
            {
              "type": "null"
            }
          ]
        },
        "reason": {
          "type": "string"
        }
      },
      "required": [
        "status",
        "billing_method",
        "reason"
      ],
      "additionalProperties": false
    },
    "StripeBillingEnabled": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "const": "enabled"
        },
        "billing_method": {
          "type": "string",
          "const": "stripe"
        },
        "portal_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Interactive billing portal URL; null for account API keys."
        }
      },
      "required": [
        "status",
        "billing_method",
        "portal_url"
      ],
      "additionalProperties": false
    }
  }
}