{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/when-i-work/json-schema/when-i-work-schemas-account-schema.json",
  "title": "schemas-Account",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/when-i-work-accounts-api-openapi.yml#/components/schemas/schemas-Account",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true,
      "description": "Unique identifier for the account."
    },
    "master_id": {
      "type": "integer",
      "readOnly": true,
      "description": "This ID indicates the status of a parent/child relationship\n * `0` - Indicates that this account does NOT have a parent/child relationship.\n * `An ID that does NOT match the account's ID` - Indicates that this account is a child and `master_id` is the parent.\n * `An ID that DOES match the account's ID` - Indicates that this account is the parent and has children.\n"
    },
    "type": {
      "readOnly": true,
      "type": "integer",
      "enum": [
        1,
        2,
        3
      ],
      "description": "The account's type, must be one of:\n * `1` - Scheduling\n * `2` - Attendance\n * `3` - Both\n"
    },
    "logo": {
      "type": "string",
      "description": "Path to the image file for the company's logo."
    },
    "company": {
      "readOnly": true,
      "type": "string",
      "description": "Name of the company for which this account is in use."
    },
    "subdomain": {
      "type": "string",
      "deprecated": true,
      "description": "Subdomain of wheniwork.com to access company-specific When I Work web application. No longer used."
    },
    "enabled": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether the account is enabled (i.e. not on an expired plan or failed credit card payment)"
    },
    "bad_credit_card": {
      "type": "boolean",
      "readOnly": true,
      "description": "Whether this account has an invalid credit card in use"
    },
    "plan_expires": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "Date and time when this account's plan expires"
    },
    "features": {
      "readOnly": true,
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List of all the enabled features on the account"
    },
    "timezone_id": {
      "readOnly": true,
      "type": "integer",
      "description": "Identifier for the account's timezone"
    },
    "timezone_name": {
      "readOnly": true,
      "type": "string",
      "description": "Name for the timezone specified in the timezone_id"
    },
    "settings": {
      "type": "string",
      "format": "json",
      "description": "A list of settings for this account"
    },
    "place": {
      "$ref": "#/$defs/schemas-Place"
    },
    "created_at": {
      "readOnly": true,
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "readOnly": true,
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "schemas-Place": {
      "type": "object",
      "properties": {
        "business_name": {
          "type": "string",
          "description": "(Optional) Business Name"
        },
        "address": {
          "type": "string",
          "description": "Place Address"
        },
        "place_id": {
          "type": "string",
          "description": "Place id returned by google"
        },
        "place_type": {
          "type": "string",
          "description": "Types returned by google"
        },
        "latitude": {
          "type": "number",
          "format": "double",
          "description": "Latitude of place location"
        },
        "longitude": {
          "type": "number",
          "format": "double",
          "description": "Longitude of place location"
        }
      }
    }
  }
}