{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/proxmint/json-schema/proxmint-account-schema.json",
  "title": "Account",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/proxmint-openapi.json#/components/schemas/Account",
  "type": "object",
  "properties": {
    "balance": {
      "type": "object",
      "description": "Prepaid wallet balance.",
      "properties": {
        "cents": {
          "type": "integer"
        },
        "usd": {
          "type": "string"
        }
      },
      "required": [
        "cents",
        "usd"
      ]
    },
    "products": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Product"
      }
    }
  },
  "required": [
    "balance",
    "products"
  ],
  "$defs": {
    "Product": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable product id; matches `productId` in usage rows."
        },
        "product": {
          "type": "string",
          "enum": [
            "datacenter",
            "residential",
            "premium-residential",
            "mobile"
          ]
        },
        "name": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "suspended",
            "expired"
          ],
          "description": "`expired` means the bandwidth is used up — packs never expire by date."
        },
        "statusChangedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When `status` last changed. Poll and compare to catch a change. `null` means it hasn't changed since 2026-11-04, when recording began."
        },
        "billing": {
          "type": "string",
          "enum": [
            "pack",
            "payg"
          ]
        },
        "bandwidth": {
          "type": "object",
          "properties": {
            "limitBytes": {
              "type": "integer"
            },
            "usedBytes": {
              "type": "integer"
            },
            "remainingBytes": {
              "type": "integer"
            },
            "syncedAt": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time"
            }
          },
          "required": [
            "limitBytes",
            "usedBytes",
            "remainingBytes",
            "syncedAt"
          ]
        },
        "proxy": {
          "type": "object",
          "description": "Everything a client needs to connect.",
          "properties": {
            "host": {
              "type": "string"
            },
            "httpPort": {
              "type": "integer"
            },
            "socks5Port": {
              "type": "integer"
            },
            "username": {
              "type": "string"
            },
            "password": {
              "type": "string"
            }
          },
          "required": [
            "host",
            "httpPort",
            "socks5Port",
            "username",
            "password"
          ]
        }
      },
      "required": [
        "id",
        "product",
        "name",
        "status",
        "statusChangedAt",
        "billing",
        "bandwidth",
        "proxy"
      ]
    }
  }
}