{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/plugsurfing/json-schema/plugsurfing-user-info-schema.json",
  "title": "UserInfo",
  "description": "User profile details returned by user management endpoints.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/plugsurfing-users-api-openapi.yml#/components/schemas/UserInfo",
  "type": "object",
  "required": [
    "id",
    "hasDebt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "User identifier"
    },
    "email": {
      "type": "string",
      "description": "User email address."
    },
    "vatNumber": {
      "type": "string",
      "description": "VAT number associated with the user."
    },
    "billingAddress": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "companyName": {
          "type": "string"
        },
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "addressLine1": {
          "type": "string"
        },
        "addressLine2": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "billingEmail": {
          "type": "string"
        },
        "additionalInformation": {
          "type": "string"
        }
      },
      "description": "Billing address associated with the user."
    },
    "hasDebt": {
      "type": "boolean",
      "description": "true if any of the sessions payments failed. (Relevant only if clearing is done by Plugsurfing)"
    },
    "userGroups": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UserGroup"
      },
      "description": "User groups the user currently belongs to."
    }
  },
  "$defs": {
    "UserGroup": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the user group."
        },
        "memberSince": {
          "type": "string",
          "format": "date-time",
          "description": "UTC timestamp when the user joined the group."
        }
      },
      "description": "Membership information for a user group."
    }
  }
}