{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/clarafintech/main/json-schema/clarafintech-card-v3-schema.json",
  "title": "CardV3",
  "x-generated": "2026-10-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clarafintech-openapi.json#/components/schemas/CardV3",
  "type": "object",
  "required": [
    "uuid",
    "alias",
    "status",
    "maskedPan",
    "type"
  ],
  "properties": {
    "uuid": {
      "type": "string",
      "format": "uuid"
    },
    "alias": {
      "type": "string"
    },
    "status": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "$ref": "#/$defs/StatusObject"
        }
      ]
    },
    "claraStatus": {
      "type": "string",
      "deprecated": true,
      "description": "Deprecated as of May 2025. Use status instead."
    },
    "lockCode": {
      "type": [
        "string",
        "integer",
        "null"
      ]
    },
    "maskedPan": {
      "type": "string"
    },
    "threshold": {
      "type": "number"
    },
    "periodicity": {
      "oneOf": [
        {
          "$ref": "#/$defs/Periodicity"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "$ref": "#/$defs/Periodicity"
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "type": {
      "oneOf": [
        {
          "$ref": "#/$defs/CardListType"
        },
        {
          "type": "object",
          "additionalProperties": true
        }
      ]
    },
    "user": {
      "$ref": "#/$defs/CardUser"
    }
  },
  "additionalProperties": true,
  "$defs": {
    "CardListType": {
      "type": "string",
      "enum": [
        "MASTER_WORLD_ELITE",
        "MASTER_CORPORATE",
        "MASTER_VIRTUAL",
        "VISA_PHYSICAL",
        "VISA_VIRTUAL"
      ]
    },
    "CardUser": {
      "type": "object",
      "properties": {
        "uuid": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "fullName": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      },
      "additionalProperties": true
    },
    "Periodicity": {
      "type": "string",
      "enum": [
        "DAILY",
        "WEEKLY",
        "MONTHLY"
      ]
    },
    "StatusObject": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }
  }
}