{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/canopyservicing-com/json-schema/canopyservicing-com-create-line-of-credit-card-schema-schema.json",
  "title": "CreateLineOfCreditCardSchema",
  "description": "Request schema for issuing a card for a line of credit.",
  "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/CreateLineOfCreditCardSchema",
  "properties": {
    "type": {
      "$ref": "#/$defs/IssuerProcessorCardType",
      "description": "The type of card to create.",
      "hidden": false
    },
    "spending_limits": {
      "items": {
        "$ref": "#/$defs/IssuerProcessorCardSpendingLimits"
      },
      "type": "array",
      "title": "Spending Limits",
      "description": "The spending limits for the card.",
      "hidden": false
    },
    "cardholder": {
      "$ref": "#/$defs/CardholderDetails",
      "description": "The cardholder information for the card.",
      "hidden": false
    },
    "shipping_info": {
      "$ref": "#/$defs/IssuerProcessorCardShippingInfo",
      "description": "The shipping information for the card."
    },
    "metadata": {
      "additionalProperties": {},
      "type": "object",
      "title": "Metadata",
      "description": "Metadata that can be associated with the card."
    },
    "issuer": {
      "$ref": "#/$defs/IssuerProcessor",
      "description": "The issuer of the card.",
      "hidden": false
    }
  },
  "type": "object",
  "required": [
    "type",
    "spending_limits",
    "cardholder",
    "issuer"
  ],
  "$defs": {
    "AddressDetails": {
      "properties": {
        "line1": {
          "type": "string",
          "title": "Line1"
        },
        "city": {
          "type": "string",
          "title": "City"
        },
        "state": {
          "type": "string",
          "title": "State"
        },
        "postal_code": {
          "type": "string",
          "title": "Postal Code"
        },
        "country": {
          "type": "string",
          "title": "Country"
        },
        "line2": {
          "type": "string",
          "title": "Line2"
        }
      },
      "type": "object",
      "required": [
        "line1",
        "city",
        "state",
        "postal_code",
        "country"
      ],
      "title": "AddressDetails"
    },
    "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"
    },
    "IssuerProcessorCardShippingInfo": {
      "properties": {
        "address": {
          "$ref": "#/$defs/AddressDetails"
        },
        "phone_number": {
          "type": "string",
          "title": "Phone Number"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "require_signature": {
          "type": "boolean",
          "title": "Require Signature",
          "default": true
        },
        "shipping_service": {
          "$ref": "#/$defs/IssuerProcessorCardShippingService",
          "default": "STANDARD"
        }
      },
      "type": "object",
      "required": [
        "address",
        "phone_number",
        "name"
      ],
      "title": "IssuerProcessorCardShippingInfo"
    },
    "IssuerProcessorCardShippingService": {
      "type": "string",
      "enum": [
        "STANDARD",
        "EXPRESS",
        "PRIORITY"
      ],
      "title": "IssuerProcessorCardShippingService"
    },
    "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"
    },
    "IssuerProcessorCardType": {
      "type": "string",
      "enum": [
        "PHYSICAL",
        "VIRTUAL"
      ],
      "title": "IssuerProcessorCardType"
    }
  }
}