{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bewary/json-schema/bewary-billing-settings-in-schema.json",
  "title": "BillingSettingsIn",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bewary-billing-api-openapi.yml#/components/schemas/BillingSettingsIn",
  "properties": {
    "auto_topup": {
      "anyOf": [
        {
          "$ref": "#/$defs/AutoTopup"
        },
        {
          "type": "null"
        }
      ]
    },
    "low_balance_email": {
      "anyOf": [
        {
          "$ref": "#/$defs/LowBalanceEmail"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "$defs": {
    "AutoTopup": {
      "properties": {
        "enabled": {
          "type": "boolean",
          "title": "Enabled",
          "description": "Off by default. Needs a saved card (POST /v1/billing/card).",
          "default": false
        },
        "pack": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "pack_20",
                "pack_100",
                "pack_500",
                "pack_2000"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Pack",
          "description": "The pack bought each time."
        },
        "threshold": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Threshold",
          "description": "Buy when a call takes the balance under this many credits. Below the pack's credits."
        }
      },
      "type": "object",
      "title": "AutoTopup"
    },
    "LowBalanceEmail": {
      "properties": {
        "enabled": {
          "type": "boolean",
          "title": "Enabled",
          "description": "On by default; sent once each time the balance falls under the threshold after having been at or over it.",
          "default": true
        },
        "threshold": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Threshold",
          "default": 2000
        }
      },
      "type": "object",
      "title": "LowBalanceEmail"
    }
  }
}