{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/canopyservicing-com/json-schema/canopyservicing-com-create-lien-request-schema.json",
  "title": "CreateLienRequest",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canopyservicing-com-liens-api-openapi.yml#/components/schemas/CreateLienRequest",
  "properties": {
    "lien_id": {
      "type": "string",
      "title": "Lien Id",
      "description": "The ID associated with the lien for future requests. If not provided on creation, Canopy will generate this field."
    },
    "position": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "title": "Position",
      "description": "The position of the lien in the list of liens associated with the collateral. The highest priority lien should have a position of 1.",
      "hidden": false
    },
    "include_in_ltv": {
      "type": "boolean",
      "title": "Include In Ltv",
      "description": "Whether the lien should be included in the LTV calculation.",
      "hidden": false
    },
    "outstanding_debt_amount_cents": {
      "type": "integer",
      "title": "Outstanding Debt Amount Cents",
      "description": "The outstanding debt amount secured by this lien, in cents. This represents the current balance of debt that the lien secures. If not provided (null), this may indicate a blanket lien that secures all current and future debts."
    },
    "association": {
      "$ref": "#/$defs/CreateLienAssociationRequest",
      "description": "The association (loan or line of credit) associated with the lien. This should only reference loans/lines of credit that exist within Canopy."
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "items": {},
          "type": "array"
        }
      ],
      "maxLength": 100,
      "title": "Metadata",
      "description": "Metadata associated with the lien."
    }
  },
  "type": "object",
  "required": [
    "position",
    "include_in_ltv"
  ],
  "$defs": {
    "AssociationType": {
      "type": "string",
      "enum": [
        "LOAN",
        "LINE_OF_CREDIT"
      ],
      "title": "AssociationType"
    },
    "CreateLienAssociationRequest": {
      "properties": {
        "association_id": {
          "type": "string",
          "title": "Association Id",
          "description": "The ID of the association (loan or line of credit) associated with the lien.",
          "hidden": false
        },
        "association_type": {
          "$ref": "#/$defs/AssociationType",
          "description": "The type of the association associated with the lien.",
          "hidden": false
        }
      },
      "type": "object",
      "required": [
        "association_id",
        "association_type"
      ],
      "title": "CreateLienAssociationRequest"
    }
  }
}