{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/if/main/json-schema/if-card-account-create-request-schema.json",
  "title": "CardAccountCreateRequest",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/if-card-api-openapi.yml#/components/schemas/CardAccountCreateRequest",
  "required": [
    "connect",
    "data",
    "metadata",
    "workflow"
  ],
  "type": "object",
  "properties": {
    "workflow": {
      "$ref": "#/$defs/CardAccountCreateWorkflowContainer"
    },
    "data": {
      "$ref": "#/$defs/CardAccountCreateDataContainer"
    },
    "connect": {
      "$ref": "#/$defs/CardAccountCreateConnectContainer"
    },
    "metadata": {
      "$ref": "#/$defs/CardAccountCreateMetadataContainer"
    }
  },
  "$defs": {
    "AccountStatus": {
      "type": "string",
      "enum": [
        "pending",
        "active",
        "inactive",
        "suspended",
        "closed",
        "declined"
      ]
    },
    "CardAccountCreateConnectContainer": {
      "type": "object"
    },
    "CardAccountCreateDataContainer": {
      "required": [
        "linkedAccount"
      ],
      "type": "object",
      "properties": {
        "linkedAccount": {
          "$ref": "#/$defs/LinkedAccount"
        }
      }
    },
    "CardAccountCreateMetadataContainer": {
      "type": "object"
    },
    "CardAccountCreateWorkflowContainer": {
      "required": [
        "code"
      ],
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "workflow code",
          "enum": [
            "direct"
          ]
        }
      }
    },
    "LinkedAccount": {
      "required": [
        "accountId"
      ],
      "type": "object",
      "properties": {
        "accountId": {
          "type": "string",
          "description": "ID of the account linked to the card",
          "format": "uuid",
          "readOnly": true
        },
        "accountStatus": {
          "$ref": "#/$defs/AccountStatus"
        }
      },
      "description": "Linked Account Resource Object"
    }
  }
}