{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentline-nz/json-schema/agentline-nz-billing-schema.json",
  "title": "Billing",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/agentline-nz-api-openapi.json#/components/schemas/Billing",
  "type": "object",
  "required": [
    "plan",
    "planName",
    "priceNzdPerMonth",
    "status",
    "trialEligible",
    "trialEndsAt",
    "currentPeriodEnd",
    "allowances",
    "comped",
    "portalAvailable",
    "availablePlans"
  ],
  "properties": {
    "plan": {
      "type": "string"
    },
    "planName": {
      "type": [
        "string",
        "null"
      ]
    },
    "priceNzdPerMonth": {
      "type": [
        "number",
        "null"
      ]
    },
    "status": {
      "type": "string"
    },
    "trialEligible": {
      "type": "boolean"
    },
    "trialEndsAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "currentPeriodEnd": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "allowances": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "inboxes",
        "emailsPerMonth",
        "trial"
      ],
      "properties": {
        "numbers": {
          "type": "integer"
        },
        "inboxes": {
          "type": "integer"
        },
        "smsLimit": {
          "type": "integer"
        },
        "smsWindow": {
          "type": "string",
          "enum": [
            "trial",
            "month"
          ]
        },
        "emailsPerMonth": {
          "type": "integer"
        },
        "voice": {
          "type": "boolean"
        },
        "voiceMinutesPerMonth": {
          "type": "integer"
        },
        "trial": {
          "type": "boolean"
        }
      }
    },
    "comped": {
      "type": "boolean"
    },
    "portalAvailable": {
      "type": "boolean"
    },
    "availablePlans": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "priceNzdPerMonth",
          "trialDays"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "free",
              "starter",
              "pro"
            ]
          },
          "name": {
            "type": "string"
          },
          "priceNzdPerMonth": {
            "type": "number"
          },
          "trialDays": {
            "type": "integer"
          }
        }
      }
    }
  }
}