{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/whmcs/main/json-schema/whmcs-client-schema.json",
  "title": "WHMCS Client",
  "description": "A WHMCS client account representing a customer of the hosting provider.",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "description": "Unique client identifier."
    },
    "firstname": {
      "type": "string",
      "description": "Client first name."
    },
    "lastname": {
      "type": "string",
      "description": "Client last name."
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "Client primary email address."
    },
    "companyname": {
      "type": "string",
      "description": "Client company name."
    },
    "address1": {
      "type": "string",
      "description": "Client billing address line 1."
    },
    "address2": {
      "type": "string",
      "description": "Client billing address line 2."
    },
    "city": {
      "type": "string",
      "description": "Client billing city."
    },
    "state": {
      "type": "string",
      "description": "Client billing state or region."
    },
    "postcode": {
      "type": "string",
      "description": "Client billing postal or zip code."
    },
    "country": {
      "type": "string",
      "description": "Client country (ISO 3166 2-letter code).",
      "minLength": 2,
      "maxLength": 2,
      "pattern": "^[A-Z]{2}$"
    },
    "phonenumber": {
      "type": "string",
      "description": "Client phone number."
    },
    "status": {
      "type": "string",
      "enum": ["Active", "Inactive", "Closed"],
      "description": "Client account status."
    },
    "credit": {
      "type": "number",
      "format": "float",
      "description": "Account credit balance."
    },
    "taxexempt": {
      "type": "boolean",
      "description": "Whether the client is tax exempt."
    },
    "groupid": {
      "type": "integer",
      "description": "Client group ID."
    },
    "currency": {
      "type": "integer",
      "description": "Currency ID assigned to the client."
    },
    "notes": {
      "type": "string",
      "description": "Internal notes about the client."
    },
    "datecreated": {
      "type": "string",
      "format": "date",
      "description": "Date client account was created."
    }
  },
  "required": ["id", "firstname", "lastname", "email", "status"],
  "additionalProperties": true
}
