{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/canopyservicing-com/json-schema/canopyservicing-com-create-draw-schema-schema.json",
  "title": "CreateDrawSchema",
  "description": "Request schema for creating a draw on a line of credit.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canopyservicing-com-draws-api-openapi.yml#/components/schemas/CreateDrawSchema",
  "properties": {
    "draw_id": {
      "type": "string",
      "title": "Draw Id",
      "description": "The ID associated to be with the draw for future requests. If not provided on draw creation, Canopy will generate this field."
    },
    "card_id": {
      "type": "string",
      "title": "Card Id",
      "description": "The ID associated to the card that is being used to create the draw."
    },
    "amount_cents": {
      "type": "integer",
      "title": "Amount Cents",
      "description": "The amount to draw from the line of credit",
      "hidden": false
    },
    "draw_type": {
      "type": "string",
      "title": "Draw Type",
      "description": "The type of draw to create",
      "hidden": false
    },
    "settlement_status": {
      "$ref": "#/$defs/TransactionStatusTypeStatuses",
      "description": "The settlement status of the draw, if not provided, the draw will be created with a SETTLED settlement status.",
      "default": "SETTLED",
      "hidden": false
    },
    "interest_rate_percent": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ],
      "title": "Interest Rate Percent",
      "description": "The annual interest rate to apply to the draw as a percentage (e.g., 5.0 for 5%)",
      "hidden": false
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "items": {},
          "type": "array"
        }
      ],
      "maxLength": 100,
      "title": "Metadata",
      "description": "Metadata that can be associated with the draw"
    },
    "override_draw_restrictions": {
      "$ref": "#/$defs/OverrideDrawRestrictions",
      "description": "Temporarily override draw restrictions for this request only."
    },
    "promo_id": {
      "type": "string",
      "title": "Promo Id",
      "description": "The ID of the promo to apply to the draw. If not provided, eligible promos will be applied automatically to the draw."
    }
  },
  "type": "object",
  "required": [
    "amount_cents",
    "draw_type"
  ],
  "$defs": {
    "OverrideDrawRestrictions": {
      "properties": {
        "restrict_ltv_breach_draw_requests": {
          "type": "boolean",
          "title": "Restrict Ltv Breach Draw Requests",
          "description": "Indicates whether the draw request should be restricted. If set to true, the request will be rejected if the resulting LTV exceeds the maximum allowed threshold.",
          "default": false,
          "hidden": false
        }
      },
      "type": "object",
      "title": "OverrideDrawRestrictions",
      "description": "Schema for overriding draw restrictions on a line of credit."
    },
    "TransactionStatusTypeStatuses": {
      "type": "string",
      "enum": [
        "NONE",
        "PENDING",
        "FAILED",
        "INVALID",
        "VALID",
        "REVERSED",
        "DECLINED",
        "SETTLED",
        "PARTIALLY_SETTLED",
        "IN_DISPUTE",
        "LENDER_WON",
        "LENDER_LOST",
        "POURED",
        "UNPOURED",
        "REPOURED",
        "AUTHORIZED",
        "DEFERRED"
      ],
      "title": "TransactionStatusTypeStatuses"
    }
  }
}