{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/canopyservicing-com/json-schema/canopyservicing-com-line-of-credit-card-response-schema.json",
  "title": "LineOfCreditCardResponse",
  "description": "Response schema for retrieving line of credit cards endpoint for a single card.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canopyservicing-com-cards-api-openapi.yml#/components/schemas/LineOfCreditCardResponse",
  "properties": {
    "account_id": {
      "type": "string",
      "title": "Account Id",
      "description": "The ID of the account associated with the line of credit.",
      "hidden": false
    },
    "card_id": {
      "type": "string",
      "title": "Card Id",
      "description": "The ID of the card associated with the the line of credit.",
      "hidden": false
    },
    "line_of_credit_id": {
      "type": "string",
      "title": "Line Of Credit Id",
      "description": "The ID of the line of credit.",
      "hidden": false
    },
    "issuer_card_id": {
      "type": "string",
      "title": "Issuer Card Id",
      "description": "The issuer generated ID of the card.",
      "hidden": false
    },
    "issuer_cardholder_id": {
      "type": "string",
      "title": "Issuer Cardholder Id",
      "description": "The issuer generated ID of the cardholder.",
      "hidden": false
    },
    "cardholder_details": {
      "$ref": "#/$defs/CardholderDetails",
      "description": "The cardholder details.",
      "hidden": false
    },
    "issuer_name": {
      "$ref": "#/$defs/IssuerProcessor",
      "description": "The issuer name.",
      "hidden": false
    },
    "card_type": {
      "$ref": "#/$defs/IssuerProcessorCardType",
      "description": "The card type.",
      "hidden": false
    },
    "card_brand": {
      "$ref": "#/$defs/IssuerProcessorCardBrand",
      "description": "The card brand (VISA, MASTERCARD, etc).",
      "hidden": false
    },
    "exp_month": {
      "type": "integer",
      "title": "Exp Month",
      "description": "The expiration month of the card.",
      "hidden": false
    },
    "exp_year": {
      "type": "integer",
      "title": "Exp Year",
      "description": "The expiration year of the card.",
      "hidden": false
    },
    "last_digits": {
      "type": "string",
      "title": "Last Digits",
      "description": "The last 4 digits of the card number.",
      "hidden": false
    },
    "card_status": {
      "$ref": "#/$defs/CardStatusResponse",
      "hidden": false
    },
    "spending_limits": {
      "items": {
        "$ref": "#/$defs/IssuerProcessorCardSpendingLimits"
      },
      "type": "array",
      "title": "Spending Limits",
      "description": "The configured spending limits for the card.",
      "hidden": false
    },
    "card_metadata": {
      "additionalProperties": true,
      "type": "object",
      "title": "Card Metadata",
      "description": "The metadata of the card.",
      "hidden": false
    },
    "created_at": {
      "type": "string",
      "title": "Created At",
      "description": "The datetime the card was created.",
      "hidden": false
    },
    "replaced_by_card_id": {
      "type": "string",
      "title": "Replaced By Card Id",
      "description": "The ID of the card that replaced this card."
    }
  },
  "type": "object",
  "required": [
    "account_id",
    "card_id",
    "line_of_credit_id",
    "issuer_card_id",
    "issuer_cardholder_id",
    "cardholder_details",
    "issuer_name",
    "card_type",
    "card_brand",
    "exp_month",
    "exp_year",
    "last_digits",
    "card_status",
    "spending_limits",
    "card_metadata",
    "created_at"
  ],
  "$defs": {
    "CardStatusResponse": {
      "properties": {
        "status": {
          "$ref": "#/$defs/IssuerProcessorCardStatus",
          "description": "The status of the card.",
          "hidden": false
        },
        "cancellation_reason": {
          "$ref": "#/$defs/IssuerProcessorCardCancellationReason",
          "description": "The reason the card was cancelled, if applicable."
        }
      },
      "type": "object",
      "required": [
        "status"
      ],
      "title": "CardStatusResponse",
      "description": "The status of the card."
    },
    "CardholderDetails": {
      "properties": {
        "email": {
          "type": "string",
          "title": "Email"
        },
        "first_name": {
          "type": "string",
          "title": "First Name"
        },
        "last_name": {
          "type": "string",
          "title": "Last Name"
        },
        "phone_number": {
          "type": "string",
          "title": "Phone Number"
        }
      },
      "type": "object",
      "required": [
        "email",
        "first_name",
        "last_name",
        "phone_number"
      ],
      "title": "CardholderDetails"
    },
    "IssuerProcessor": {
      "type": "string",
      "enum": [
        "STRIPE",
        "FIRSTDATA",
        "MOCK_FOR_TESTING"
      ],
      "title": "IssuerProcessor"
    },
    "IssuerProcessorCardBrand": {
      "type": "string",
      "enum": [
        "VISA",
        "MASTERCARD"
      ],
      "title": "IssuerProcessorCardBrand"
    },
    "IssuerProcessorCardCancellationReason": {
      "type": "string",
      "enum": [
        "LOST",
        "STOLEN",
        "CUSTOMER_REQUESTED"
      ],
      "title": "IssuerProcessorCardCancellationReason"
    },
    "IssuerProcessorCardSpendingLimitIntervalType": {
      "type": "string",
      "enum": [
        "DAILY",
        "WEEKLY",
        "MONTHLY",
        "YEARLY"
      ],
      "title": "IssuerProcessorCardSpendingLimitIntervalType"
    },
    "IssuerProcessorCardSpendingLimits": {
      "properties": {
        "amount_cents": {
          "type": "integer",
          "title": "Amount Cents"
        },
        "interval_type": {
          "$ref": "#/$defs/IssuerProcessorCardSpendingLimitIntervalType"
        }
      },
      "type": "object",
      "required": [
        "amount_cents",
        "interval_type"
      ],
      "title": "IssuerProcessorCardSpendingLimits"
    },
    "IssuerProcessorCardStatus": {
      "type": "string",
      "enum": [
        "ACTIVE",
        "INACTIVE",
        "CANCELED",
        "PENDING"
      ],
      "title": "IssuerProcessorCardStatus"
    },
    "IssuerProcessorCardType": {
      "type": "string",
      "enum": [
        "PHYSICAL",
        "VIRTUAL"
      ],
      "title": "IssuerProcessorCardType"
    }
  }
}