{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/canopyservicing-com/json-schema/canopyservicing-com-create-line-of-credit-schema-schema.json",
  "title": "CreateLineOfCreditSchema",
  "description": "Request schema for creating a line of credit.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canopyservicing-com-lines-of-credit-api-openapi.yml#/components/schemas/CreateLineOfCreditSchema",
  "properties": {
    "line_of_credit_id": {
      "type": "string",
      "title": "Line Of Credit Id",
      "description": "The ID associated to be with the line of credit for future requests. If not provided on creation, Canopy will generate this field."
    },
    "template_id": {
      "type": "string",
      "title": "Template Id",
      "description": "The ID of the template to use for setting the policies on the line of credit",
      "hidden": false
    },
    "credit_limit_cents": {
      "type": "integer",
      "title": "Credit Limit Cents",
      "description": "The credit limit on this line of credit in the smallest unit of the currency (e.g., cents for USD)",
      "hidden": false
    },
    "currency": {
      "type": "string",
      "title": "Currency",
      "description": "The ISO 4217 3-letter currency code of the line of credit",
      "default": "USD",
      "hidden": false
    },
    "billing_cycle_interval": {
      "type": "string",
      "title": "Billing Cycle Interval",
      "description": "The interval between billing cycles",
      "hidden": false
    },
    "payment_due_offset": {
      "type": "string",
      "title": "Payment Due Offset",
      "description": "The interval between payment due dates",
      "hidden": false
    },
    "interest_rate_percent": {
      "type": "number",
      "title": "Interest Rate Percent",
      "description": "The annual interest percentage rate to apply to the line of credit as a whole number (e.g., 5.0 for 5%)",
      "default": 0,
      "hidden": false
    },
    "term_length": {
      "type": "string",
      "title": "Term Length",
      "description": "The full term length of the closed-ended line of credit, based on duration from line of credit's `effective_at` date"
    },
    "late_fee_grace_offset": {
      "type": "string",
      "title": "Late Fee Grace Offset",
      "description": "The interval between the payment due date and the late fee grace period, in cases where product requires a late fee assessment to be made if a borrower doesn't pay their minimum payment in full."
    },
    "first_billing_cycle_interval": {
      "type": "string",
      "title": "First Billing Cycle Interval",
      "description": "The interval between the first billing cycle and the second billing cycle. This is sometimes needed to ensure payment due dates are consistent throughout the term of the line of credit."
    }
  },
  "type": "object",
  "required": [
    "template_id",
    "credit_limit_cents",
    "billing_cycle_interval",
    "payment_due_offset"
  ]
}