{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gsma/json-schema/gsma-response-account-status-schema.json",
  "title": "responseAccountStatus",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gsma-accounts-api-openapi.yml#/components/schemas/responseAccountStatus",
  "type": "object",
  "required": [
    "accountStatus"
  ],
  "properties": {
    "accountStatus": {
      "$ref": "#/$defs/accountStatus"
    },
    "subStatus": {
      "$ref": "#/$defs/subStatus"
    },
    "lei": {
      "description": "Indicates the Legal Entity Identifier of the organisation holding the account.",
      "allOf": [
        {
          "$ref": "#/$defs/lei"
        }
      ]
    }
  },
  "$defs": {
    "accountStatus": {
      "type": "string",
      "enum": [
        "available",
        "unavailable",
        "unregistered"
      ],
      "description": "Indicates a harmonised representation of the account status. This will be shown as available, unavailable or unregistered.",
      "minLength": 1,
      "maxLength": 256
    },
    "lei": {
      "type": "string",
      "description": "Legal Entity Identifier.",
      "minLength": 0,
      "maxLength": 20,
      "pattern": "^[A-Z0-9]{4}00[A-Z0-9]{12}\\d{2}$"
    },
    "subStatus": {
      "type": "string",
      "description": "Can be used to return a provider-specific status for the account.",
      "minLength": 0,
      "maxLength": 256
    }
  }
}