{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/divvy/json-schema/divvy-card-account-response-dto-schema.json",
  "title": "CardAccountResponseDto",
  "description": "Card Account response DTO.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/divvy-funding-accounts-api-openapi.yml#/components/schemas/CardAccountResponseDto",
  "required": [
    "archived",
    "id"
  ],
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "BILL-generated ID of the card account. The value begins with `cat`."
    },
    "archived": {
      "type": "boolean",
      "description": "Set as `true` if the card account is archived"
    },
    "createdTime": {
      "type": "string",
      "description": "Created date and time",
      "format": "date-time"
    },
    "updatedTime": {
      "type": "string",
      "description": "Updated date and time",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string",
      "description": "BILL-generated ID of the user that created the card account. The value begins with `006`."
    },
    "issuingBankName": {
      "type": "string",
      "description": "Card issuing bank name"
    },
    "nameOnAccount": {
      "type": "string",
      "description": "Full name on card account"
    },
    "brand": {
      "type": "string",
      "description": "Card brand"
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/$defs/CardAccountType"
        },
        {
          "description": "Card type."
        }
      ]
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/CardAccountStatus"
        },
        {
          "description": "Card account status."
        }
      ]
    },
    "last4": {
      "type": "string",
      "description": "Card last four digits"
    },
    "expiration": {
      "allOf": [
        {
          "$ref": "#/$defs/CardAccountExpiration"
        },
        {
          "description": "Card expiration information"
        }
      ]
    },
    "default": {
      "allOf": [
        {
          "$ref": "#/$defs/CardAccountDefault"
        },
        {
          "description": "Card payment defaults for BILL operations"
        }
      ]
    }
  },
  "$defs": {
    "CardAccountDefault": {
      "type": "object",
      "properties": {
        "payables": {
          "type": "boolean",
          "description": "Set as `true` if the card account is set as default for Accounts Payable operations"
        },
        "receivables": {
          "type": "boolean",
          "description": "Set as `true` if the card account is set as default for Accounts Receivable operations"
        },
        "funding": {
          "type": "boolean",
          "description": "Set as `true` if the card account is set as default for funding"
        },
        "disbursement": {
          "type": "boolean",
          "description": "Set as `true` if the card account is set as default for disbursement"
        }
      },
      "description": "Card Account Response Default."
    },
    "CardAccountExpiration": {
      "type": "object",
      "properties": {
        "year": {
          "type": "string",
          "description": "Card expiration year"
        },
        "month": {
          "type": "string",
          "description": "Card expiration month"
        }
      },
      "description": "Card Account response Expiration."
    },
    "CardAccountStatus": {
      "type": "string",
      "description": "Card Account response status.",
      "enum": [
        "NOT_VERIFIED",
        "VERIFIED",
        "PENDING",
        "BLOCKED",
        "EXPIRED",
        "INVALID",
        "UNDEFINED"
      ]
    },
    "CardAccountType": {
      "type": "string",
      "description": "Card Account response type.",
      "enum": [
        "UNDEFINED",
        "CREDIT_CARD",
        "DEBIT_CARD",
        "PREPAID_CARD",
        "UNKNOWN"
      ]
    }
  }
}