{
  "openapi": "3.1.0",
  "info": {
    "title": "Quantum Lending Solutions Partner API",
    "version": "3.0.0",
    "description": "Combined API reference for partner integration"
  },
  "servers": [
    {
      "url": "https://qa.quantumlends.com",
      "description": "QA Environment"
    },
    {
      "url": "https://quantumlends.com",
      "description": "Production Environment"
    }
  ],
  "tags": [
    {
      "name": "Applications"
    },
    {
      "name": "Accounts",
      "description": "These endpoints allow you to:\n- Request draws from existing lines of credit\n- Submit payment requests for loan repayment\n- Manage account servicing operations\n\nAll operations are processed asynchronously with status updates sent via webhooks."
    }
  ],
  "paths": {
    "/api/v3/applications/submit": {
      "post": {
        "operationId": "applications_api_submit_application",
        "summary": "Submit an Application",
        "parameters": [
          {
            "in": "header",
            "name": "X-Forwarded-For",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The original client IP address for fraud detection.",
              "title": "X-Forwarded-For"
            },
            "required": false,
            "description": "The original client IP address for fraud detection."
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationOut"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          },
          "510": {
            "description": "Not Extended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSchema"
                }
              }
            }
          }
        },
        "description": "Submit a loan application for review. The submit will identify any issues with the loan application such as missing fields.",
        "tags": [
          "Applications"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Application"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/prefill": {
      "post": {
        "operationId": "applications_api_prefill_application",
        "summary": "Prefill an Application",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrefillApplicationOut"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          },
          "510": {
            "description": "Not Extended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorMessageSchema"
                }
              }
            }
          }
        },
        "description": "Create a prefilled application with minimal owner data. Returns a URL for the applicant to continue the application.",
        "tags": [
          "Applications"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrefillApplication"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/prefill": {
      "get": {
        "operationId": "applications_api_get_prefill_token",
        "summary": "Get Application Prefill Link",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrefillTokenOut"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "510": {
            "description": "Not Extended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorMessageSchema"
                }
              }
            }
          }
        },
        "description": "Returns the prefill URL and token for a previously created prefill application. Use the returned `prefill_url` to send the applicant directly to their pre-filled application form. If the original link has expired, a new one is automatically issued.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}": {
      "get": {
        "operationId": "applications_api_get_application",
        "summary": "Retrieve an Application",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationWithDecisionOut"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          }
        },
        "description": "Get a loan application that was previously created using the unique identifier that was generated. For applications with a status of 'Declined' or 'Offer Declined', the response includes a 'decision' field containing information about why the application was not approved. This includes business-related reasons, guarantor-related reasons, and the date the adverse action was taken. For applications in other statuses, this field will not be present.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/status": {
      "get": {
        "operationId": "applications_api_get_application_status",
        "summary": "Get Application Status",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationStatusOut"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "510": {
            "description": "Not Extended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorMessageSchema"
                }
              }
            }
          }
        },
        "description": "Get the current status of an application by its UUID.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications": {
      "get": {
        "operationId": "listApplications",
        "summary": "List Applications",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "title": "Page",
              "type": "integer"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 10,
              "title": "Limit",
              "type": "integer"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "sort_direction",
            "schema": {
              "default": "desc",
              "enum": [
                "asc",
                "desc"
              ],
              "title": "Sort Direction",
              "type": "string"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "statuses",
            "schema": {
              "items": {
                "description": "",
                "enum": [
                  "submitted",
                  "In Processing",
                  "Under Credit Review",
                  "Approved",
                  "Awaiting Offer Acceptance",
                  "Preparing Loan Documents",
                  "Pending Closing Information from Customer",
                  "Awaiting Document Execution",
                  "Awaiting Funding",
                  "Booked",
                  "Declined",
                  "Offer Declined",
                  "Withdrawn"
                ],
                "title": "ApplicationStatus",
                "type": "string"
              },
              "title": "Statuses",
              "type": "array"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "reference_ids",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Reference Ids"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "ids",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Ids"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationListResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "List all applications for your account with optional filtering and pagination. Returns a paginated list of applications sorted by the submitted date.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/documents": {
      "post": {
        "operationId": "uploadDocuments",
        "summary": "Upload supporting documents",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentList"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          },
          "510": {
            "description": "Not Extended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorMessageSchema"
                }
              }
            }
          }
        },
        "description": "Upload documents for an application. Documents can be uploaded using individual parameters for each document type: bank_statements, business_tax_return, personal_tax_return, ytd_financials, ye_financials, debt_schedule, photo_id, utility_bill, lease_agreement, business_license, sos_record, lien_release, lien_filing, proof_of_payoff, ssn_card, insurance_document, mortgage_document, personal_document, formation_documents. Use multipart/form-data format. Note: At least one file must be provided - empty file lists will result in a 422 error.",
        "tags": [
          "Applications"
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "bank_statements": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Bank statement files",
                    "title": "Bank Statements"
                  },
                  "business_tax_return": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Business tax return files",
                    "title": "Business Tax Return"
                  },
                  "personal_tax_return": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Personal tax return files",
                    "title": "Personal Tax Return"
                  },
                  "ytd_financials": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Year-to-date financial statement files",
                    "title": "Ytd Financials"
                  },
                  "ye_financials": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Year-end financial statement files",
                    "title": "Ye Financials"
                  },
                  "debt_schedule": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Debt schedule document files",
                    "title": "Debt Schedule"
                  },
                  "photo_id": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Photo identification files",
                    "title": "Photo Id"
                  },
                  "utility_bill": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Utility bill files",
                    "title": "Utility Bill"
                  },
                  "lease_agreement": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Lease agreement files",
                    "title": "Lease Agreement"
                  },
                  "business_license": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Business license files",
                    "title": "Business License"
                  },
                  "sos_record": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Secretary of State record files",
                    "title": "Sos Record"
                  },
                  "lien_release": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Lien release document files",
                    "title": "Lien Release"
                  },
                  "ssn_card": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Social Security card files",
                    "title": "Ssn Card"
                  },
                  "void_check": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Voided check files",
                    "title": "Void Check"
                  },
                  "insurance_document": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Insurance document files",
                    "title": "Insurance Document"
                  },
                  "mortgage_document": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Mortgage document files",
                    "title": "Mortgage Document"
                  },
                  "personal_document": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Personal document files",
                    "title": "Personal Document"
                  },
                  "formation_documents": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Formation document files",
                    "title": "Formation Documents"
                  },
                  "lien_filing": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Lien filing document files",
                    "title": "Lien Filing"
                  },
                  "proof_of_payoff": {
                    "anyOf": [
                      {
                        "items": {
                          "format": "binary",
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Proof of payoff document files",
                    "title": "Proof Of Payoff"
                  }
                },
                "title": "FileParams",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      },
      "get": {
        "operationId": "applications_api_retrieve_documents",
        "summary": "Get supporting documents info",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentList"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          }
        },
        "description": "Get the documents info for a given application id.\n\nIt's also useful to track the status of the documents uploaded.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/offers": {
      "get": {
        "operationId": "applications_api_get_offers",
        "summary": "Get offers",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Offers"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Get the offers for a given application id.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/offer/{offer_id}/accept": {
      "post": {
        "operationId": "applications_api_accept_offer",
        "summary": "Accept an offer",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "offer_id",
            "schema": {
              "format": "uuid",
              "title": "Offer Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSchema"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Accept an offer for a given application id.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/decline-offers": {
      "post": {
        "operationId": "applications_api_decline_offers",
        "summary": "Decline offers",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSchema"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Decline offers for a given application id with a reason.",
        "tags": [
          "Applications"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/DeclineOfferRequest"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "required": false
        },
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/withdraw": {
      "post": {
        "operationId": "applications_api_withdraw_application",
        "summary": "Withdraw Application",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationWithdrawnSucessSchema"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationNotWithdrawnErrorSchema"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Withdraw an application by marking it as reversed.",
        "tags": [
          "Applications"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WithdrawRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/owners": {
      "post": {
        "operationId": "applications_api_add_additional_owners",
        "summary": "Add Additional Owners",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddAdditionalOwnersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSchema"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Add additional owners to an application after initial submission. This endpoint is typically used when you initially submit an application with only the primary owner and need to add additional owners once their information is collected. Applications must not be in a terminal status (Declined, Booked, Non Take-up, or Offer Declined) to add owners.",
        "tags": [
          "Applications"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/AdditionalOwnerIn"
                },
                "title": "Owners",
                "type": "array"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/bank-accounts": {
      "post": {
        "operationId": "applications_api_add_bank_accounts",
        "summary": "Add Bank Accounts",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddBankAccountsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          },
          "510": {
            "description": "Not Extended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSchema"
                }
              }
            }
          }
        },
        "description": "Add bank accounts to an application after initial submission. Supports both aggregator-based accounts (Plaid/MX) for transaction analysis and direct-from-customer accounts for loan disbursement. Only one direct-from-customer account is allowed per request.",
        "tags": [
          "Applications"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/DirectFromCustomerBankAccountInput"
                    },
                    {
                      "$ref": "#/components/schemas/AggregatorBankAccountInput"
                    }
                  ]
                },
                "minItems": 1,
                "title": "Bank Accounts",
                "type": "array"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/transactions": {
      "post": {
        "operationId": "applications_api_add_transactions",
        "summary": "Add transaction data",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestTransactionsResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSchema"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          },
          "510": {
            "description": "Not Extended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSchema"
                }
              }
            }
          }
        },
        "description": "Add transaction data for an application. The request body is a discriminated-union envelope keyed on ``type``. Today supports ``plaid_asset_report``; additional source types may be added over time.",
        "tags": [
          "Applications"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "discriminator": {
                  "mapping": {
                    "plaid_asset_report": "#/components/schemas/PlaidAssetReportEnvelope"
                  },
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/PlaidAssetReportEnvelope"
                  }
                ],
                "title": "Envelope"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/tasks": {
      "get": {
        "operationId": "applications_api_get_tasks",
        "summary": "Get application tasks",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TaskStatus"
                },
                {
                  "type": "null"
                }
              ]
            },
            "required": false
          },
          {
            "in": "query",
            "name": "show_details",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": false,
              "title": "Show Details"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "items": {
                        "$ref": "#/components/schemas/TaskSchema"
                      },
                      "type": "array"
                    },
                    {
                      "items": {
                        "$ref": "#/components/schemas/TaskDetailSchema"
                      },
                      "type": "array"
                    }
                  ],
                  "title": "Response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSchema"
                }
              }
            }
          }
        },
        "description": "Get all tasks for an application. Use show_details=true to include actions for each task.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/tasks/{task_id}": {
      "get": {
        "operationId": "applications_api_get_task_details",
        "summary": "Get application task details",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "task_id",
            "schema": {
              "format": "uuid",
              "title": "Task Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskDetailSchema"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSchema"
                }
              }
            }
          }
        },
        "description": "Get detailed information about a specific task, including all available actions that can be taken to complete it.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/adverse-action-notification": {
      "get": {
        "operationId": "applications_api_retrieve_adverse_action_notification",
        "summary": "Get adverse action notification PDF",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "format": "binary",
                  "title": "Response",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          }
        },
        "description": "Get the adverse action notification PDF for a given application id.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/offers/{offer_id}/disclosure": {
      "get": {
        "operationId": "applications_api_retrieve_commercial_financing_disclosure",
        "summary": "Get commercial financing disclosure PDF",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "offer_id",
            "schema": {
              "format": "uuid",
              "title": "Offer Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "format": "binary",
                  "title": "Response",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          }
        },
        "description": "Get the commercial financing disclosure PDF for a given application id and offer id.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/signed-disclosure": {
      "get": {
        "operationId": "applications_api_retrieve_signed_disclosure",
        "summary": "Get signed disclosure PDF",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "format": "binary",
                  "title": "Response",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          }
        },
        "description": "Get the signed disclosure PDF for a given application id.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/applications/{app_id}/contracts": {
      "get": {
        "operationId": "applications_api_get_application_contracts",
        "summary": "Get embedded contract signing tokens for an application",
        "parameters": [
          {
            "in": "path",
            "name": "app_id",
            "schema": {
              "format": "uuid",
              "title": "App Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContractsResponseSchema"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__2"
                }
              }
            }
          },
          "410": {
            "description": "Gone",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorMessageSchema"
                }
              }
            }
          },
          "510": {
            "description": "Not Extended",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorMessageSchema"
                }
              }
            }
          }
        },
        "description": "Returns the list of signers on the application's contract along with a `signing_token` for each. The token is an opaque value to be passed to the Quantum-wrapped embedded signing JS SDK to drive the embedded signing experience. The contract must already have been sent for signers to be available.",
        "tags": [
          "Applications"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/accounts/{account_id}/draw-requests": {
      "post": {
        "operationId": "request_draw",
        "summary": "Request a draw from a line of credit",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "schema": {
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DrawRequestOutput"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Submit a draw request for a specific account. This endpoint allows you to request funds from an existing line of credit on behalf of your customers.\n\nThe request will be processed asynchronously and status updates will be sent via webhooks to the draw status endpoint.",
        "tags": [
          "Accounts"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DrawRequestInput"
              }
            }
          },
          "required": true
        }
      },
      "get": {
        "operationId": "listDrawRequests",
        "summary": "List draw requests for an account",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "schema": {
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "$ref": "#/components/schemas/DrawRequestStatus"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "size",
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "title": "Size",
              "type": "integer"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "sort_by",
            "schema": {
              "default": "id",
              "title": "Sort By",
              "type": "string"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "sort_dir",
            "schema": {
              "default": "asc",
              "title": "Sort Dir",
              "type": "string"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedDrawRequest"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Retrieve a paginated list of draw requests for a specific account with optional status filtering and sorting.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v3/accounts/{account_id}/payment-requests": {
      "post": {
        "operationId": "makePayment",
        "summary": "Make a payment towards an account",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "schema": {
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequestOutput"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Submit a payment request for a specific account. This endpoint allows you to process payments on behalf of your customers for loan repayment, payoff, or past due amounts.\n\nThe payment will be processed asynchronously and status updates will be sent via webhooks to the repayment status endpoint.",
        "tags": [
          "Accounts"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentRequestInput"
              }
            }
          },
          "required": true
        }
      },
      "get": {
        "operationId": "listPaymentRequests",
        "summary": "List payment requests for an account",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "schema": {
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "$ref": "#/components/schemas/PaymentRequestStatus"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "size",
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "title": "Size",
              "type": "integer"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedPaymentRequest"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Retrieve a paginated list of payment requests for a specific account with optional status filtering.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v3/accounts/{account_id}": {
      "get": {
        "operationId": "getAccount",
        "summary": "Get account details by ID",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "schema": {
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/FBLoan"
                    },
                    {
                      "$ref": "#/components/schemas/IBLoan"
                    },
                    {
                      "$ref": "#/components/schemas/TermLoan"
                    }
                  ],
                  "title": "Response"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Retrieve detailed information about a specific account including balances, status, and account terms.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v3/accounts/{account_id}/payment-requests/{payment_request_id}": {
      "get": {
        "operationId": "getPaymentRequest",
        "summary": "Get payment request details",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "schema": {
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "payment_request_id",
            "schema": {
              "format": "uuid",
              "title": "Payment Request Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequestOutput"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Retrieve details about a specific payment request including status and amount.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v3/accounts/{account_id}/draw-requests/{draw_request_id}": {
      "get": {
        "operationId": "getDrawRequest",
        "summary": "Get draw request details",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "schema": {
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            },
            "required": true
          },
          {
            "in": "path",
            "name": "draw_request_id",
            "schema": {
              "format": "uuid",
              "title": "Draw Request Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DrawRequestOutput"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Retrieve details about a specific draw request including status, amount, and fees.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v3/accounts/{account_id}/transactions": {
      "get": {
        "operationId": "getAccountTransactions",
        "summary": "Get account transactions by account ID",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "schema": {
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start Date"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End Date"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "transaction_type",
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TransactionType"
                },
                {
                  "type": "null"
                }
              ]
            },
            "required": false
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "size",
            "schema": {
              "default": 10,
              "maximum": 100,
              "minimum": 1,
              "title": "Size",
              "type": "integer"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedTransaction"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Retrieve a list of transactions for a specific account with filtering and pagination.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v3/accounts/{account_id}/amortizations": {
      "get": {
        "operationId": "getAccountAmortizations",
        "summary": "Get account amortizations by account id",
        "parameters": [
          {
            "in": "path",
            "name": "account_id",
            "schema": {
              "format": "uuid",
              "title": "Account Id",
              "type": "string"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start Date"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End Date"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "size",
            "schema": {
              "default": 10,
              "maximum": 25,
              "minimum": 1,
              "title": "Size",
              "type": "integer"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedAmortization"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorSchema"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuantumException"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorSchema"
                }
              }
            }
          }
        },
        "description": "Retrieve a list of amortizations for a specific account with filtering and pagination.",
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v3/webhooks/subscriptions": {
      "post": {
        "operationId": "app_subscriptions_api_create_subscription",
        "summary": "Create a webhook subscription",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            }
          }
        },
        "description": "Create a new webhook subscription for the authenticated partner. The secret is only shown once at creation time.",
        "tags": [
          "Subscriptions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      },
      "get": {
        "operationId": "app_subscriptions_api_list_subscriptions",
        "summary": "List webhook subscriptions",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "description": "Page number (default: 1)",
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            },
            "required": false,
            "description": "Page number (default: 1)"
          },
          {
            "in": "query",
            "name": "size",
            "schema": {
              "default": 25,
              "description": "Page size (default: 25, max: 100)",
              "maximum": 100,
              "minimum": 1,
              "title": "Size",
              "type": "integer"
            },
            "required": false,
            "description": "Page size (default: 25, max: 100)"
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WebhookSubscriptionStatus"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status: active, paused, or disabled"
            },
            "required": false,
            "description": "Filter by status: active, paused, or disabled"
          },
          {
            "in": "query",
            "name": "events",
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WebhookTopic"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event type (e.g., application.offer.created)"
            },
            "required": false,
            "description": "Filter by event type (e.g., application.offer.created)"
          },
          {
            "in": "query",
            "name": "sort_by",
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "created",
                    "modified",
                    "status"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Sort by field: created, modified, or status",
              "title": "Sort By"
            },
            "required": false,
            "description": "Sort by field: created, modified, or status"
          },
          {
            "in": "query",
            "name": "sort_dir",
            "schema": {
              "default": "desc",
              "description": "Sort direction: asc or desc (default: desc)",
              "enum": [
                "asc",
                "desc"
              ],
              "title": "Sort Dir",
              "type": "string"
            },
            "required": false,
            "description": "Sort direction: asc or desc (default: desc)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            }
          }
        },
        "description": "List all webhook subscriptions for the authenticated partner with pagination support. Supports filtering by status and events, and sorting by created, modified, or status.",
        "tags": [
          "Subscriptions"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/webhooks/subscriptions/{subscription_uuid}": {
      "patch": {
        "operationId": "app_subscriptions_api_update_subscription",
        "summary": "Update a webhook subscription",
        "parameters": [
          {
            "in": "path",
            "name": "subscription_uuid",
            "schema": {
              "format": "uuid",
              "title": "Subscription Uuid",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSubscriptionUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            }
          }
        },
        "description": "Update an existing webhook subscription. Only provided fields will be updated (partial update). The secret cannot be changed and is not returned in the response.",
        "tags": [
          "Subscriptions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/webhooks/subscriptions/{subscription_uuid}/refresh-secret": {
      "post": {
        "operationId": "app_subscriptions_api_refresh_subscription_secret",
        "summary": "Refresh webhook subscription secret",
        "parameters": [
          {
            "in": "path",
            "name": "subscription_uuid",
            "schema": {
              "format": "uuid",
              "title": "Subscription Uuid",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretRefreshResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            }
          }
        },
        "description": "Generate a new secret for a webhook subscription. The previous secret remains valid during the grace period to allow for seamless rotation.",
        "tags": [
          "Subscriptions"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/webhooks/events": {
      "get": {
        "operationId": "app_events_api_list_source_events",
        "summary": "List events",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "description": "Page number (default: 1)",
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            },
            "required": false,
            "description": "Page number (default: 1)"
          },
          {
            "in": "query",
            "name": "size",
            "schema": {
              "default": 100,
              "description": "Page size (default: 100, max: 500)",
              "maximum": 500,
              "minimum": 1,
              "title": "Size",
              "type": "integer"
            },
            "required": false,
            "description": "Page size (default: 100, max: 500)"
          },
          {
            "in": "query",
            "name": "event_type",
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WebhookTopic"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event type (e.g., application.status.updated)"
            },
            "required": false,
            "description": "Filter by event type (e.g., application.status.updated)"
          },
          {
            "in": "query",
            "name": "resource_type",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by resource type (application, document)",
              "title": "Resource Type"
            },
            "required": false,
            "description": "Filter by resource type (application, document)"
          },
          {
            "in": "query",
            "name": "resource_id",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by resource ID",
              "title": "Resource Id"
            },
            "required": false,
            "description": "Filter by resource ID"
          },
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter events from this date (ISO 8601 format)",
              "title": "Start Date"
            },
            "required": false,
            "description": "Filter events from this date (ISO 8601 format)"
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter events until this date (ISO 8601 format)",
              "title": "End Date"
            },
            "required": false,
            "description": "Filter events until this date (ISO 8601 format)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceEventListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            }
          }
        },
        "description": "List webhook events for the authenticated partner with filtering and pagination. Events represent the original webhook events received (deduplicated view). Events are sorted by received_at descending (newest first). Maximum retention window is 30 days.",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/webhooks/events/{id}": {
      "get": {
        "operationId": "app_events_api_get_source_event",
        "summary": "Get event details",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "format": "uuid",
              "title": "Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceEventDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            }
          }
        },
        "description": "Get details of a specific event including all delivery attempts. Only events delivered to subscriptions owned by the authenticated partner can be accessed.",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/webhooks/event-delivery-history": {
      "get": {
        "operationId": "app_events_api_list_events",
        "summary": "List webhook delivery history",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "description": "Page number (default: 1)",
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            },
            "required": false,
            "description": "Page number (default: 1)"
          },
          {
            "in": "query",
            "name": "size",
            "schema": {
              "default": 100,
              "description": "Page size (default: 100, max: 500)",
              "maximum": 500,
              "minimum": 1,
              "title": "Size",
              "type": "integer"
            },
            "required": false,
            "description": "Page size (default: 100, max: 500)"
          },
          {
            "in": "query",
            "name": "subscription_id",
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by subscription UUID",
              "title": "Subscription Id"
            },
            "required": false,
            "description": "Filter by subscription UUID"
          },
          {
            "in": "query",
            "name": "event_type",
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/WebhookTopic"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event type (e.g., application.offer.created)"
            },
            "required": false,
            "description": "Filter by event type (e.g., application.offer.created)"
          },
          {
            "in": "query",
            "name": "status_code",
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by HTTP status code (e.g., 200, 404, 500)",
              "title": "Status Code"
            },
            "required": false,
            "description": "Filter by HTTP status code (e.g., 200, 404, 500)"
          },
          {
            "in": "query",
            "name": "success",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by delivery success",
              "title": "Success"
            },
            "required": false,
            "description": "Filter by delivery success"
          },
          {
            "in": "query",
            "name": "resource_type",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by resource type (application, document, offer)",
              "title": "Resource Type"
            },
            "required": false,
            "description": "Filter by resource type (application, document, offer)"
          },
          {
            "in": "query",
            "name": "resource_id",
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by resource ID",
              "title": "Resource Id"
            },
            "required": false,
            "description": "Filter by resource ID"
          },
          {
            "in": "query",
            "name": "source_event_id",
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by source event UUID (SNS MessageId)",
              "title": "Source Event Id"
            },
            "required": false,
            "description": "Filter by source event UUID (SNS MessageId)"
          },
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter events from this date (ISO 8601 format)",
              "title": "Start Date"
            },
            "required": false,
            "description": "Filter events from this date (ISO 8601 format)"
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter events until this date (ISO 8601 format)",
              "title": "End Date"
            },
            "required": false,
            "description": "Filter events until this date (ISO 8601 format)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            }
          }
        },
        "description": "List webhook delivery attempts for the authenticated partner with filtering and pagination. Deliveries are sorted by delivered_at descending (newest first). Maximum retention window is 30 days.",
        "tags": [
          "Webhook delivery"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/webhooks/event-delivery-history/{id}": {
      "get": {
        "operationId": "app_events_api_get_event",
        "summary": "Get webhook delivery details",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "format": "uuid",
              "title": "Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            }
          }
        },
        "description": "Get details of a specific webhook delivery attempt. Only deliveries for subscriptions owned by the authenticated partner can be accessed. The ID corresponds to the 'id' field in the webhook payload received by partners.",
        "tags": [
          "Webhook delivery"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    },
    "/api/v3/webhooks/event-delivery-history/{id}/retry": {
      "post": {
        "operationId": "app_events_api_retry_event",
        "summary": "Manually retry webhook delivery",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "format": "uuid",
              "title": "Id",
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManualRetryResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForbiddenErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            }
          }
        },
        "description": "Manually retry a webhook delivery. Executes synchronously and returns the partner's response. Cannot retry if subscription is paused or disabled. The ID corresponds to the 'id' field in the webhook payload received by partners.",
        "tags": [
          "Webhook delivery"
        ],
        "security": [
          {
            "QuantumAuthMiddleware": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Address": {
        "properties": {
          "street": {
            "description": "The street address of the business.",
            "examples": [
              "22 Acacia Ave"
            ],
            "maxLength": 100,
            "minLength": 2,
            "title": "Street",
            "type": "string"
          },
          "street_2": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The street address of the business.",
            "examples": [
              ""
            ],
            "title": "Street 2"
          },
          "apt_suite_number": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "",
            "examples": [
              ""
            ],
            "title": "Apt Suite Number"
          },
          "city": {
            "description": "The city the business is located in.",
            "examples": [
              "Los Angeles"
            ],
            "maxLength": 100,
            "minLength": 2,
            "title": "City",
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/States",
            "description": "The state the business is located in.",
            "examples": [
              "CA"
            ],
            "maxLength": 2
          },
          "zip_code": {
            "description": "The zip code of the business",
            "examples": [
              "90025"
            ],
            "pattern": "^[0-9]{5}(?:-[0-9]{4})?$",
            "title": "Zip Code",
            "type": "string"
          }
        },
        "required": [
          "street",
          "city",
          "state",
          "zip_code"
        ],
        "title": "Address",
        "type": "object"
      },
      "AggregatorInfo": {
        "description": "Aggregator (Plaid/MX) bank account connection details.",
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/BankAccountAggregatorProvider"
          },
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "primary_account_id": {
            "title": "Primary Account Id",
            "type": "string"
          },
          "transactions": {
            "title": "Transactions",
            "type": "boolean"
          },
          "balances": {
            "title": "Balances",
            "type": "boolean"
          },
          "identities": {
            "title": "Identities",
            "type": "boolean"
          }
        },
        "required": [
          "provider",
          "access_token",
          "primary_account_id",
          "transactions",
          "balances",
          "identities"
        ],
        "title": "AggregatorInfo",
        "type": "object"
      },
      "ApplicationOut": {
        "properties": {
          "id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A unique identifier used for the application and can be used to make updates to the application up to the point of submission.",
            "examples": [
              "550e8400-e29b-41d4-a716-446655440001"
            ],
            "title": "Id"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationStatus"
              },
              {
                "type": "null"
              }
            ],
            "default": "submitted",
            "description": "Status for a submitted loan application",
            "examples": [
              "submitted"
            ]
          },
          "business": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "loan_request": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoanRequestOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "owners": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/OwnerOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owners"
          },
          "additional_questions": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Questions"
              },
              {
                "type": "null"
              }
            ]
          },
          "bank_accounts": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/BankAccount"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bank Accounts"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Id"
          },
          "custom_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional JSON object for partner-defined attributes stored alongside the application. Must not contain sensitive data such as PII. Max 512 KB.",
            "examples": [
              {
                "best_movie": "Star Wars",
                "favorite_color": "Green"
              }
            ],
            "title": "Custom Data"
          },
          "created": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The date and time the Application was created.",
            "examples": [
              "2024-04-11 17:51:42"
            ],
            "title": "Created"
          },
          "modified": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The last modified date and time for the Application.",
            "examples": [
              "2024-06-02 11:23:10"
            ],
            "title": "Modified"
          }
        },
        "title": "ApplicationOut",
        "type": "object"
      },
      "ApplicationStatus": {
        "description": "",
        "enum": [
          "submitted",
          "In Processing",
          "Under Credit Review",
          "Approved",
          "Awaiting Offer Acceptance",
          "Preparing Loan Documents",
          "Pending Closing Information from Customer",
          "Awaiting Document Execution",
          "Awaiting Funding",
          "Booked",
          "Declined",
          "Offer Declined",
          "Withdrawn"
        ],
        "title": "ApplicationStatus",
        "type": "string"
      },
      "BankAccount": {
        "description": "Legacy bank account schema for aggregator accounts.\n\nNote: New code should use BankAccountInput (union type) instead.\nThis is kept for backward compatibility with existing model methods.",
        "properties": {
          "source": {
            "title": "Source",
            "type": "string"
          },
          "aggregator": {
            "$ref": "#/components/schemas/AggregatorInfo"
          }
        },
        "required": [
          "source",
          "aggregator"
        ],
        "title": "BankAccount",
        "type": "object"
      },
      "BankAccountAggregatorProvider": {
        "enum": [
          "plaid",
          "mx"
        ],
        "title": "BankAccountAggregatorProvider",
        "type": "string"
      },
      "BusinessEntityType": {
        "description": "",
        "enum": [
          "limited_liability_company",
          "partnership",
          "sole_proprietor",
          "s_corporation",
          "c_corporation",
          "other"
        ],
        "title": "BusinessEntityType",
        "type": "string"
      },
      "BusinessOut": {
        "properties": {
          "legal_name": {
            "description": "The legal name of the business.",
            "examples": [
              "Acme Inc LLC"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "Legal Name",
            "type": "string"
          },
          "doing_business_as": {
            "description": "The doing business as name used.",
            "examples": [
              "Widgets Are Us"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "Doing Business As",
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "phone_number": {
            "anyOf": [
              {
                "pattern": "^[0-9]{3}-[0-9]{3}-[0-9]{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The phone number of the business.",
            "examples": [
              "650-555-6124"
            ],
            "title": "Phone Number"
          },
          "phone_extension": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "",
            "examples": [
              ""
            ],
            "title": "Phone Extension"
          },
          "entity_type": {
            "$ref": "#/components/schemas/BusinessEntityType",
            "description": "The corporate structure of the business.",
            "examples": [
              "limited_liability_company"
            ],
            "minLength": 1
          },
          "naics_code": {
            "description": "The NAICS code for the business.",
            "examples": [
              "312234"
            ],
            "pattern": "^\\d{6}$",
            "title": "Naics Code",
            "type": "string"
          },
          "start_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When was the business started.",
            "examples": [
              "2008-03-27"
            ],
            "title": "Start Date"
          },
          "non_profit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Is the business a non-profit business.",
            "examples": [
              false
            ],
            "title": "Non Profit"
          },
          "tax_identification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The tax identification for the business.",
            "examples": [
              "123-45-6789"
            ],
            "title": "Tax Identification"
          }
        },
        "required": [
          "legal_name",
          "doing_business_as",
          "address",
          "phone_number",
          "entity_type",
          "naics_code",
          "start_date"
        ],
        "title": "BusinessOut",
        "type": "object"
      },
      "LoanPurpose": {
        "description": "",
        "enum": [
          "business_expansion",
          "cash_crunch",
          "debt_refinancing",
          "equipment_purchase",
          "inventory_purchase",
          "marketing_campaign",
          "meet_payroll",
          "renovations_or_capital_improvements",
          "working_capital",
          "other"
        ],
        "title": "LoanPurpose",
        "type": "string"
      },
      "LoanRequestOut": {
        "properties": {
          "amount": {
            "description": "The loan amount that is being requested.",
            "examples": [
              10000
            ],
            "maximum": 500000,
            "minimum": 10000,
            "title": "Amount",
            "type": "integer"
          },
          "purpose": {
            "$ref": "#/components/schemas/LoanPurpose",
            "description": "The purpose the loan is being requested.",
            "examples": [
              "working_capital"
            ]
          },
          "authorization": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "To process the loan application we need access to the owners credit information.  This needs to be explicitly collected before submitting the loan application.",
            "examples": [
              true
            ],
            "title": "Authorization"
          }
        },
        "required": [
          "amount",
          "purpose",
          "authorization"
        ],
        "title": "LoanRequest",
        "type": "object"
      },
      "OwnerOut": {
        "properties": {
          "first_name": {
            "description": "The first name for the legal name of the owner.",
            "examples": [
              "Wallie"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "First Name",
            "type": "string"
          },
          "middle_name": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "",
            "title": "Middle Name"
          },
          "last_name": {
            "description": "The last name for the legal name of the owner.",
            "examples": [
              "Green"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "Last Name",
            "type": "string"
          },
          "name_suffix": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "",
            "examples": [
              "III"
            ],
            "title": "Name Suffix"
          },
          "job_title": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "",
            "examples": [
              "CEO"
            ],
            "title": "Job Title"
          },
          "email": {
            "description": "A valid email address for the owner where they can be contacted.",
            "examples": [
              "wallie@widgitsinc.com"
            ],
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "phone_number": {
            "description": "A valid phone number for the owner where they can be contacted.",
            "examples": [
              "650-555-2134"
            ],
            "pattern": "^[0-9]{3}-[0-9]{3}-[0-9]{4}$",
            "title": "Phone Number",
            "type": "string"
          },
          "date_of_birth": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "format": "date",
                "type": "string"
              }
            ],
            "description": "The data of birth of the owner.",
            "examples": [
              "1981-03-17"
            ],
            "title": "Date Of Birth"
          },
          "is_applicant": {
            "description": "Is this owner financially response for the loan.",
            "examples": [
              true
            ],
            "title": "Is Applicant",
            "type": "boolean"
          },
          "ownership_percent": {
            "description": "What percentage does this owner have in the company?",
            "examples": [
              100
            ],
            "maximum": 100,
            "minimum": 0,
            "title": "Ownership Percent",
            "type": "integer"
          },
          "ssn": {
            "description": "The tax identification for the owner. Must be either 9 digits or in xxx-xx-xxxx format",
            "examples": [
              "123-45-6789"
            ],
            "maxLength": 11,
            "minLength": 9,
            "title": "Ssn",
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          }
        },
        "required": [
          "first_name",
          "last_name",
          "email",
          "phone_number",
          "date_of_birth",
          "is_applicant",
          "ownership_percent",
          "ssn",
          "address"
        ],
        "title": "Owner",
        "type": "object"
      },
      "Questions": {
        "properties": {
          "outstanding_debt": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Outstanding Debt",
            "examples": [
              10000
            ],
            "title": "Outstanding Debt"
          },
          "annual_sales": {
            "description": "Annual Sales",
            "examples": [
              250000
            ],
            "max": 2147483648,
            "min": 0,
            "title": "Annual Sales",
            "type": "integer"
          },
          "number_of_employees": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 1,
            "description": "Number of Employees",
            "examples": [
              1
            ],
            "title": "Number Of Employees"
          },
          "number_of_customers": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 25,
            "description": "Number of Customers",
            "examples": [
              1000
            ],
            "title": "Number Of Customers"
          },
          "pretax_profit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 100000,
            "description": "Pre-tax Profit",
            "examples": [
              25000
            ],
            "title": "Pretax Profit"
          },
          "owner_income": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 100000,
            "description": "Owner's income",
            "examples": [
              100000
            ],
            "title": "Owner Income"
          }
        },
        "required": [
          "annual_sales"
        ],
        "title": "Questions",
        "type": "object"
      },
      "States": {
        "description": "",
        "enum": [
          "AL",
          "AK",
          "AZ",
          "AR",
          "CA",
          "CO",
          "CT",
          "DE",
          "FL",
          "GA",
          "HI",
          "ID",
          "IL",
          "IN",
          "IA",
          "KS",
          "KY",
          "LA",
          "ME",
          "MD",
          "MA",
          "MI",
          "MN",
          "MS",
          "MO",
          "MT",
          "NE",
          "NV",
          "NH",
          "NJ",
          "NM",
          "NY",
          "NC",
          "ND",
          "OH",
          "OK",
          "OR",
          "PA",
          "RI",
          "SC",
          "SD",
          "TN",
          "TX",
          "UT",
          "VT",
          "VA",
          "WA",
          "WV",
          "WI",
          "WY",
          "DC"
        ],
        "title": "States",
        "type": "string"
      },
      "ErrorDetailSchema": {
        "properties": {
          "field": {
            "example": "application.business.legal_name",
            "title": "Field",
            "type": "string"
          },
          "message": {
            "example": "This field is required.",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "field",
          "message"
        ],
        "title": "ErrorDetailSchema",
        "type": "object"
      },
      "ErrorSchema": {
        "properties": {
          "code": {
            "example": "VALIDATION_ERROR",
            "title": "Code",
            "type": "string"
          },
          "message": {
            "example": "Some fields are missing or invalid.",
            "title": "Message",
            "type": "string"
          },
          "details": {
            "example": [
              {
                "field": "application.business.legal_name",
                "message": "This field is required."
              }
            ],
            "items": {
              "$ref": "#/components/schemas/ErrorDetailSchema"
            },
            "title": "Details",
            "type": "array"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "ErrorSchema",
        "type": "object"
      },
      "ValidationErrorSchema": {
        "description": "Error schema for validation errors (422).",
        "properties": {
          "code": {
            "examples": [
              "VALIDATION_ERROR"
            ],
            "title": "Code",
            "type": "string"
          },
          "message": {
            "examples": [
              "Some fields are missing or invalid."
            ],
            "title": "Message",
            "type": "string"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetailItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "examples": [
              [
                {
                  "field": "url",
                  "message": "This field is required."
                }
              ]
            ],
            "title": "Details"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "ValidationErrorSchema",
        "type": "object"
      },
      "ForbiddenDetailErrorSchema": {
        "properties": {
          "code": {
            "example": "FORBIDDEN",
            "title": "Code",
            "type": "string"
          },
          "message": {
            "example": "You do not have permission to perform this operation.",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "ForbiddenDetailErrorSchema",
        "type": "object"
      },
      "ForbiddenErrorSchema": {
        "description": "Error schema for forbidden errors (403).",
        "properties": {
          "code": {
            "examples": [
              "FORBIDDEN"
            ],
            "title": "Code",
            "type": "string"
          },
          "message": {
            "examples": [
              "You do not have permission to perform this action."
            ],
            "title": "Message",
            "type": "string"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetailItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "ForbiddenErrorSchema",
        "type": "object"
      },
      "MessageSchema": {
        "properties": {
          "message": {
            "example": "Action completed successfully",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "MessageSchema",
        "type": "object"
      },
      "Application": {
        "properties": {
          "business": {
            "$ref": "#/components/schemas/Business"
          },
          "loan_request": {
            "$ref": "#/components/schemas/LoanRequest"
          },
          "owners": {
            "items": {
              "$ref": "#/components/schemas/OwnerIn"
            },
            "minItems": 1,
            "title": "Owners",
            "type": "array"
          },
          "additional_questions": {
            "$ref": "#/components/schemas/Questions"
          },
          "bank_accounts": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/BankAccount"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bank Accounts"
          },
          "reference_id": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the application.",
            "examples": [
              ""
            ],
            "title": "Reference Id"
          },
          "initial_submission_date": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The original submission date from the referring partner. Used for Reg B compliance when the application was initially submitted to another lender before being referred. If not provided, the submission date to Quantum will be used.",
            "examples": [
              "2025-01-15T10:30:00"
            ],
            "title": "Initial Submission Date"
          },
          "custom_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional JSON object for partner-defined attributes stored alongside the application. Must not contain sensitive data such as PII. Max 512 KB.",
            "examples": [
              {
                "best_movie": "Star Wars",
                "favorite_color": "Green"
              }
            ],
            "title": "Custom Data"
          }
        },
        "required": [
          "business",
          "loan_request",
          "owners",
          "additional_questions"
        ],
        "title": "Application",
        "type": "object"
      },
      "Business": {
        "properties": {
          "legal_name": {
            "description": "The legal name of the business.",
            "examples": [
              "Acme Inc LLC"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "Legal Name",
            "type": "string"
          },
          "doing_business_as": {
            "description": "The doing business as name used.",
            "examples": [
              "Widgets Are Us"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "Doing Business As",
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "phone_number": {
            "anyOf": [
              {
                "pattern": "^[0-9]{3}-[0-9]{3}-[0-9]{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The phone number of the business.",
            "examples": [
              "650-555-6124"
            ],
            "title": "Phone Number"
          },
          "phone_extension": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "",
            "examples": [
              ""
            ],
            "title": "Phone Extension"
          },
          "entity_type": {
            "$ref": "#/components/schemas/BusinessEntityType",
            "description": "The corporate structure of the business.",
            "examples": [
              "limited_liability_company"
            ],
            "minLength": 1
          },
          "naics_code": {
            "description": "The NAICS code for the business.",
            "examples": [
              "312234"
            ],
            "pattern": "^\\d{6}$",
            "title": "Naics Code",
            "type": "string"
          },
          "start_date": {
            "description": "When was the business started.",
            "examples": [
              "2008-03-27"
            ],
            "format": "date",
            "title": "Start Date",
            "type": "string"
          },
          "non_profit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Is the business a non-profit business.",
            "examples": [
              false
            ],
            "title": "Non Profit"
          },
          "tax_identification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The tax identification for the business.",
            "examples": [
              "123-45-6789"
            ],
            "title": "Tax Identification"
          }
        },
        "required": [
          "legal_name",
          "doing_business_as",
          "address",
          "phone_number",
          "entity_type",
          "naics_code",
          "start_date"
        ],
        "title": "Business",
        "type": "object"
      },
      "LoanRequest": {
        "properties": {
          "amount": {
            "description": "The loan amount that is being requested.",
            "examples": [
              10000
            ],
            "maximum": 500000,
            "minimum": 10000,
            "title": "Amount",
            "type": "integer"
          },
          "purpose": {
            "$ref": "#/components/schemas/LoanPurpose",
            "description": "The purpose the loan is being requested.",
            "examples": [
              "working_capital"
            ]
          },
          "authorization": {
            "description": "To process the loan application we need access to the owners credit information.  This needs to be explicitly collected before submitting the loan application.",
            "examples": [
              true
            ],
            "title": "Authorization",
            "type": "boolean"
          }
        },
        "required": [
          "amount",
          "purpose",
          "authorization"
        ],
        "title": "LoanRequest",
        "type": "object"
      },
      "OwnerIn": {
        "properties": {
          "first_name": {
            "description": "The first name for the legal name of the owner.",
            "examples": [
              "Wallie"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "First Name",
            "type": "string"
          },
          "middle_name": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "",
            "title": "Middle Name"
          },
          "last_name": {
            "description": "The last name for the legal name of the owner.",
            "examples": [
              "Green"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "Last Name",
            "type": "string"
          },
          "name_suffix": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "",
            "examples": [
              "III"
            ],
            "title": "Name Suffix"
          },
          "job_title": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "",
            "examples": [
              "CEO"
            ],
            "title": "Job Title"
          },
          "email": {
            "description": "A valid email address for the owner where they can be contacted.",
            "examples": [
              "wallie@widgitsinc.com"
            ],
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "phone_number": {
            "description": "A valid phone number for the owner where they can be contacted.",
            "examples": [
              "650-555-2134"
            ],
            "pattern": "^[0-9]{3}-[0-9]{3}-[0-9]{4}$",
            "title": "Phone Number",
            "type": "string"
          },
          "date_of_birth": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "format": "date",
                "type": "string"
              }
            ],
            "description": "The data of birth of the owner.",
            "examples": [
              "1981-03-17"
            ],
            "title": "Date Of Birth"
          },
          "is_applicant": {
            "description": "Is this owner financially response for the loan.",
            "examples": [
              true
            ],
            "title": "Is Applicant",
            "type": "boolean"
          },
          "ownership_percent": {
            "description": "What percentage does this owner have in the company?",
            "examples": [
              100.0
            ],
            "maximum": 100,
            "minimum": 1,
            "title": "Ownership Percent",
            "type": "integer"
          },
          "ssn": {
            "description": "The tax identification for the owner. Must be either 9 digits or in xxx-xx-xxxx format",
            "examples": [
              "123-45-6789"
            ],
            "maxLength": 11,
            "minLength": 9,
            "title": "Ssn",
            "type": "string"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          }
        },
        "required": [
          "first_name",
          "last_name",
          "email",
          "phone_number",
          "date_of_birth",
          "is_applicant",
          "ownership_percent",
          "ssn",
          "address"
        ],
        "title": "Owner",
        "type": "object"
      },
      "PrefillApplicationOut": {
        "description": "Output schema for prefill endpoint.",
        "properties": {
          "id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A unique identifier used for the application and can be used to make updates to the application up to the point of submission.",
            "examples": [
              "550e8400-e29b-41d4-a716-446655440001"
            ],
            "title": "Id"
          },
          "prefill_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "URL for the applicant to continue the prefilled application",
            "examples": [
              "https://quantumlends.com/ui/apply/sp/550e8400-e29b-41d4-a716-446655440001?token=nHzIm8OvrkAD6Lt9NLwHjcxn4jIfUFWFJ52bXKaEwB0"
            ],
            "title": "Prefill Url"
          },
          "prefill_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Token for the prefilled application",
            "examples": [
              "nHzIm8OvrkAD6Lt9NLwHjcxn4jIfUFWFJ52bXKaEwB0"
            ],
            "title": "Prefill Token"
          },
          "owners": {
            "items": {
              "$ref": "#/components/schemas/PrefillOwnerOut"
            },
            "minItems": 1,
            "title": "Owners",
            "type": "array"
          },
          "business": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrefillBusinessOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "loan_request": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrefillLoanRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "created": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The date and time the Application was created.",
            "examples": [
              "2024-04-11 17:51:42"
            ],
            "title": "Created"
          },
          "modified": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The last modified date and time for the Application.",
            "examples": [
              "2024-06-02 11:23:10"
            ],
            "title": "Modified"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the application.",
            "examples": [
              "REF-12345"
            ],
            "title": "Reference Id"
          },
          "custom_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional JSON object for partner-defined attributes stored alongside the application. Must not contain sensitive data such as PII. Max 512 KB.",
            "examples": [
              {
                "best_movie": "Star Wars",
                "favorite_color": "Green"
              }
            ],
            "title": "Custom Data"
          }
        },
        "required": [
          "owners"
        ],
        "title": "PrefillApplicationOut",
        "type": "object"
      },
      "PrefillBusinessOut": {
        "description": "Business schema for prefill response. Tax ID may be masked by Apply Service.",
        "properties": {
          "legal_name": {
            "anyOf": [
              {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The legal name of the business.",
            "examples": [
              "Acme Inc LLC"
            ],
            "title": "Legal Name"
          },
          "doing_business_as": {
            "anyOf": [
              {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The doing business as name used.",
            "examples": [
              "Widgets Are Us"
            ],
            "title": "Doing Business As"
          },
          "entity_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessEntityType"
              },
              {
                "type": "null"
              }
            ],
            "description": "The corporate structure of the business.",
            "examples": [
              "limited_liability_company"
            ]
          },
          "phone_number": {
            "anyOf": [
              {
                "pattern": "^[0-9]{3}-[0-9]{3}-[0-9]{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The phone number of the business.",
            "examples": [
              "650-555-6124"
            ],
            "title": "Phone Number"
          },
          "naics_code": {
            "anyOf": [
              {
                "pattern": "^\\d{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The NAICS code for the business.",
            "examples": [
              "312234"
            ],
            "title": "Naics Code"
          },
          "start_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When was the business started.",
            "examples": [
              "2008-03-27"
            ],
            "title": "Start Date"
          },
          "non_profit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Is the business a non-profit business.",
            "examples": [
              false
            ],
            "title": "Non Profit"
          },
          "tax_identification": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The tax identification for the business. May be masked in prefill responses, e.g. '##-#####67'.",
            "examples": [
              "123-45-6789",
              "##-#####67"
            ],
            "title": "Tax Identification"
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "PrefillBusinessOut",
        "type": "object"
      },
      "PrefillLoanRequest": {
        "description": "Loan request schema for prefill endpoint. All fields are optional.",
        "properties": {
          "amount": {
            "anyOf": [
              {
                "maximum": 500000,
                "minimum": 10000,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The loan amount that is being requested.",
            "examples": [
              10000
            ],
            "title": "Amount"
          },
          "purpose": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoanPurpose"
              },
              {
                "type": "null"
              }
            ],
            "description": "The purpose the loan is being requested.",
            "examples": [
              "working_capital"
            ]
          },
          "authorization": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "To process the loan application we need access to the owners credit information.  This needs to be explicitly collected before submitting the loan application.",
            "examples": [
              true
            ],
            "title": "Authorization"
          }
        },
        "title": "PrefillLoanRequest",
        "type": "object"
      },
      "PrefillOwnerOut": {
        "description": "Owner schema for prefill response. SSN is masked by Apply Service.",
        "properties": {
          "first_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The first name for the legal name of the owner.",
            "examples": [
              "Wallie"
            ],
            "title": "First Name"
          },
          "last_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The last name for the legal name of the owner.",
            "examples": [
              "Green"
            ],
            "title": "Last Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A valid email address for the owner where they can be contacted.",
            "examples": [
              "wallie@widgitsinc.com"
            ],
            "title": "Email"
          },
          "middle_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "examples": [
              "J"
            ],
            "title": "Middle Name"
          },
          "name_suffix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "examples": [
              "III"
            ],
            "title": "Name Suffix"
          },
          "job_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "examples": [
              "CEO"
            ],
            "title": "Job Title"
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A valid phone number for the owner where they can be contacted.",
            "examples": [
              "650-555-1234"
            ],
            "title": "Phone Number"
          },
          "birth_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The data of birth of the owner.",
            "examples": [
              "1980-01-15"
            ],
            "title": "Birth Date"
          },
          "is_applicant": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Is this owner financially response for the loan.",
            "examples": [
              true
            ],
            "title": "Is Applicant"
          },
          "ownership_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "What percentage does this owner have in the company?",
            "examples": [
              100
            ],
            "title": "Ownership Percent"
          },
          "ssn": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Social Security Number (masked in response, e.g. ###-##-##89)",
            "examples": [
              "###-##-6789"
            ],
            "title": "Ssn"
          },
          "income": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Owner's income",
            "examples": [
              100000
            ],
            "title": "Income"
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "PrefillOwnerOut",
        "type": "object"
      },
      "ErrorMessageSchema": {
        "properties": {
          "message": {
            "example": "Unexpected Error Contact Support",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "ErrorMessageSchema",
        "type": "object"
      },
      "PrefillApplication": {
        "description": "Input schema for prefill endpoint. Only owners[0].first_name, last_name, email are required.",
        "properties": {
          "owners": {
            "items": {
              "$ref": "#/components/schemas/PrefillOwner"
            },
            "minItems": 1,
            "title": "Owners",
            "type": "array"
          },
          "business": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrefillBusiness"
              },
              {
                "type": "null"
              }
            ]
          },
          "loan_request": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrefillLoanRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "reference_id": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the application.",
            "title": "Reference Id"
          },
          "custom_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional JSON object for partner-defined attributes stored alongside the application. Must not contain sensitive data such as PII. Max 512 KB.",
            "examples": [
              {
                "best_movie": "Star Wars",
                "favorite_color": "Green"
              }
            ],
            "title": "Custom Data"
          }
        },
        "required": [
          "owners"
        ],
        "title": "PrefillApplication",
        "type": "object"
      },
      "PrefillBusiness": {
        "description": "Business schema for prefill endpoint. All fields are optional.",
        "properties": {
          "legal_name": {
            "anyOf": [
              {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The legal name of the business.",
            "examples": [
              "Acme Inc LLC"
            ],
            "title": "Legal Name"
          },
          "doing_business_as": {
            "anyOf": [
              {
                "maxLength": 100,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The doing business as name used.",
            "examples": [
              "Widgets Are Us"
            ],
            "title": "Doing Business As"
          },
          "entity_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessEntityType"
              },
              {
                "type": "null"
              }
            ],
            "description": "The corporate structure of the business.",
            "examples": [
              "limited_liability_company"
            ]
          },
          "phone_number": {
            "anyOf": [
              {
                "pattern": "^[0-9]{3}-[0-9]{3}-[0-9]{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The phone number of the business.",
            "examples": [
              "650-555-6124"
            ],
            "title": "Phone Number"
          },
          "naics_code": {
            "anyOf": [
              {
                "pattern": "^\\d{6}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The NAICS code for the business.",
            "examples": [
              "312234"
            ],
            "title": "Naics Code"
          },
          "start_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When was the business started.",
            "examples": [
              "2008-03-27"
            ],
            "title": "Start Date"
          },
          "non_profit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Is the business a non-profit business.",
            "examples": [
              false
            ],
            "title": "Non Profit"
          },
          "tax_identification": {
            "anyOf": [
              {
                "pattern": "(^\\d{3}-\\d{2}-\\d{4}$)|(^\\d{9}$)|(^\\d{2}-\\d{7}$)",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The tax identification for the business.",
            "examples": [
              "123-45-6789"
            ],
            "title": "Tax Identification"
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "PrefillBusiness",
        "type": "object"
      },
      "PrefillOwner": {
        "description": "Owner schema for prefill endpoint. Only first_name, last_name, and email are required.",
        "properties": {
          "first_name": {
            "description": "The first name for the legal name of the owner.",
            "examples": [
              "Wallie"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "First Name",
            "type": "string"
          },
          "last_name": {
            "description": "The last name for the legal name of the owner.",
            "examples": [
              "Green"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "Last Name",
            "type": "string"
          },
          "email": {
            "description": "A valid email address for the owner where they can be contacted.",
            "examples": [
              "wallie@widgitsinc.com"
            ],
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "middle_name": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Middle Name"
          },
          "name_suffix": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "examples": [
              "III"
            ],
            "title": "Name Suffix"
          },
          "job_title": {
            "anyOf": [
              {
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "examples": [
              "CEO"
            ],
            "title": "Job Title"
          },
          "phone_number": {
            "anyOf": [
              {
                "pattern": "^[0-9]{3}-[0-9]{3}-[0-9]{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A valid phone number for the owner where they can be contacted.",
            "examples": [
              "650-555-2134"
            ],
            "title": "Phone Number"
          },
          "date_of_birth": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The data of birth of the owner.",
            "examples": [
              "1981-03-17"
            ],
            "title": "Date Of Birth"
          },
          "is_applicant": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Is this owner financially response for the loan.",
            "examples": [
              true
            ],
            "title": "Is Applicant"
          },
          "ownership_percent": {
            "anyOf": [
              {
                "maximum": 100,
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "What percentage does this owner have in the company?",
            "examples": [
              100
            ],
            "title": "Ownership Percent"
          },
          "ssn": {
            "anyOf": [
              {
                "maxLength": 11,
                "minLength": 9,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The tax identification for the owner. Must be either 9 digits or in xxx-xx-xxxx format",
            "examples": [
              "123-45-6789"
            ],
            "title": "Ssn"
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "first_name",
          "last_name",
          "email"
        ],
        "title": "PrefillOwner",
        "type": "object"
      },
      "PrefillTokenOut": {
        "description": "Response schema for GET /{app_id}/prefill.",
        "properties": {
          "id": {
            "description": "UUID of the partial application",
            "examples": [
              "550e8400-e29b-41d4-a716-446655440001"
            ],
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "prefill_url": {
            "description": "URL for the applicant to continue the prefilled application",
            "examples": [
              "https://quantumlends.com/ui/apply/sp/550e8400-e29b-41d4-a716-446655440001?token=nHzIm8OvrkAD6Lt9NLwH"
            ],
            "title": "Prefill Url",
            "type": "string"
          },
          "prefill_token": {
            "description": "Token for the prefilled application",
            "examples": [
              "nHzIm8OvrkAD6Lt9NLwH"
            ],
            "title": "Prefill Token",
            "type": "string"
          }
        },
        "required": [
          "id",
          "prefill_url",
          "prefill_token"
        ],
        "title": "PrefillTokenOut",
        "type": "object"
      },
      "applications__schemas__errors__NotFoundErrorSchema__1": {
        "properties": {
          "code": {
            "example": "NOT_FOUND",
            "title": "Code",
            "type": "string"
          },
          "message": {
            "example": "The requested application was not found.",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "NotFoundErrorSchema",
        "type": "object"
      },
      "applications__schemas__errors__NotFoundErrorSchema__2": {
        "properties": {
          "error": {
            "$ref": "#/components/schemas/applications__schemas__errors__NotFoundErrorSchema__1"
          }
        },
        "required": [
          "error"
        ],
        "title": "NotFoundErrorSchema",
        "type": "object"
      },
      "ApplicationWithDecisionOut": {
        "description": "Extended application schema that includes decision information.\n\nThis schema inherits all fields from ApplicationOut and adds\ndecision as an optional field. If fetching decision information\nfails, this field will be None.",
        "properties": {
          "id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A unique identifier used for the application and can be used to make updates to the application up to the point of submission.",
            "examples": [
              "550e8400-e29b-41d4-a716-446655440001"
            ],
            "title": "Id"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationStatus"
              },
              {
                "type": "null"
              }
            ],
            "default": "submitted",
            "description": "Status for a submitted loan application",
            "examples": [
              "submitted"
            ]
          },
          "business": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "loan_request": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoanRequestOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "owners": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/OwnerOut"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owners"
          },
          "additional_questions": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Questions"
              },
              {
                "type": "null"
              }
            ]
          },
          "bank_accounts": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/BankAccount"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bank Accounts"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Id"
          },
          "custom_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional JSON object for partner-defined attributes stored alongside the application. Must not contain sensitive data such as PII. Max 512 KB.",
            "examples": [
              {
                "best_movie": "Star Wars",
                "favorite_color": "Green"
              }
            ],
            "title": "Custom Data"
          },
          "created": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The date and time the Application was created.",
            "examples": [
              "2024-04-11 17:51:42"
            ],
            "title": "Created"
          },
          "modified": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The last modified date and time for the Application.",
            "examples": [
              "2024-06-02 11:23:10"
            ],
            "title": "Modified"
          },
          "decision": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DecisionOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Decision information for the application (if available)"
          }
        },
        "title": "ApplicationWithDecisionOut",
        "type": "object"
      },
      "BureauName": {
        "description": "Credit bureau that produced the score. Currently only Experian.",
        "enum": [
          "EXPERIAN"
        ],
        "title": "BureauName",
        "type": "string"
      },
      "DecisionOut": {
        "description": "Decision details for the application.",
        "properties": {
          "business_adverse_action_reasons": {
            "description": "List of business-related adverse action reasons",
            "examples": [
              [
                "Value or type of collateral not sufficient",
                "Unable to verify business identity"
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "Business Adverse Action Reasons",
            "type": "array"
          },
          "inadequate_guarantor_reasons": {
            "description": "List of guarantor-related adverse action reasons",
            "examples": [
              [
                "Guarantor's income insufficient for amount of credit requested",
                "Guarantor's income cannot be verified"
              ]
            ],
            "items": {
              "type": "string"
            },
            "title": "Inadequate Guarantor Reasons",
            "type": "array"
          },
          "adverse_action_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Date of adverse action",
            "examples": [
              "2025-06-15"
            ],
            "title": "Adverse Action Date"
          },
          "adverse_action_sent_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Date when adverse action notification was sent",
            "examples": [
              "2025-06-16"
            ],
            "title": "Adverse Action Sent Date"
          },
          "adverse_action_notification_pdf_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Full URL to download the adverse action notification PDF",
            "examples": [
              "https://api.example.com/api/v3/applications/123e4567-e89b-12d3-a456-426614174000/adverse-action-notification"
            ],
            "title": "Adverse Action Notification Pdf Url"
          },
          "fico": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FicoOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Credit-bureau (FICO) data for the application. Available to approved partners (access requires prior approval, e.g. SOC2 financial institutions) on declined applications; null otherwise."
          }
        },
        "required": [
          "business_adverse_action_reasons",
          "inadequate_guarantor_reasons"
        ],
        "title": "DecisionOut",
        "type": "object"
      },
      "FicoFactor": {
        "description": "A single reason code contributing to the score, with its statement.",
        "properties": {
          "reason_code": {
            "examples": [
              "18"
            ],
            "title": "Reason Code",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Human-readable statement for the reason code. Null for unknown codes; the raw reason_code is still surfaced.",
            "examples": [
              "Number of accounts with delinquency"
            ],
            "title": "Description"
          }
        },
        "required": [
          "reason_code"
        ],
        "title": "FicoFactor",
        "type": "object"
      },
      "FicoOut": {
        "description": "Credit-bureau score, range, and contributing factors for a declined\napplication's primary applicant.\n\nAvailable to approved partners (access requires prior approval, e.g. SOC2\nfinancial institutions) on declined applications; ``null`` otherwise.",
        "properties": {
          "bureau": {
            "$ref": "#/components/schemas/BureauName",
            "description": "Credit bureau that produced the score.",
            "examples": [
              "EXPERIAN"
            ]
          },
          "model_version": {
            "description": "Scoring model version.",
            "examples": [
              "FICO V9"
            ],
            "title": "Model Version",
            "type": "string"
          },
          "score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Raw numeric FICO score; null when unavailable.",
            "examples": [
              778
            ],
            "title": "Score"
          },
          "score_range": {
            "$ref": "#/components/schemas/FicoScoreRange",
            "description": "Valid range for the scoring model."
          },
          "pulled_at": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Date the score was pulled from the bureau; null when unavailable.",
            "examples": [
              "2026-05-18"
            ],
            "title": "Pulled At"
          },
          "factors": {
            "description": "Reason codes (0–4) contributing to the score.",
            "items": {
              "$ref": "#/components/schemas/FicoFactor"
            },
            "title": "Factors",
            "type": "array"
          }
        },
        "required": [
          "bureau",
          "model_version",
          "score_range",
          "factors"
        ],
        "title": "FicoOut",
        "type": "object"
      },
      "FicoScoreRange": {
        "description": "The valid range for the FICO model, e.g. 300–850.",
        "properties": {
          "min": {
            "examples": [
              300
            ],
            "title": "Min",
            "type": "integer"
          },
          "max": {
            "examples": [
              850
            ],
            "title": "Max",
            "type": "integer"
          }
        },
        "required": [
          "min",
          "max"
        ],
        "title": "FicoScoreRange",
        "type": "object"
      },
      "ApplicationStatusOut": {
        "description": "Response schema for the application status endpoint.",
        "properties": {
          "id": {
            "description": "A unique identifier used for the application and can be used to make updates to the application up to the point of submission.",
            "examples": [
              "550e8400-e29b-41d4-a716-446655440001"
            ],
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "status": {
            "description": "Status for a submitted loan application",
            "examples": [
              "Submitted"
            ],
            "title": "Status",
            "type": "string"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the application.",
            "examples": [
              "REF-12345"
            ],
            "title": "Reference Id"
          },
          "created": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The date and time the Application was created.",
            "examples": [
              "2024-04-11 17:51:42"
            ],
            "title": "Created"
          },
          "modified": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The last modified date and time for the Application.",
            "examples": [
              "2024-06-02 11:23:10"
            ],
            "title": "Modified"
          }
        },
        "required": [
          "id",
          "status"
        ],
        "title": "ApplicationStatusOut",
        "type": "object"
      },
      "ApplicationListItemOut": {
        "description": "Schema for application items in list response.",
        "properties": {
          "id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A unique identifier used for the application and can be used to make updates to the application up to the point of submission.",
            "examples": [
              "550e8400-e29b-41d4-a716-446655440000"
            ],
            "title": "Id"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Status for a submitted loan application",
            "examples": [
              "Submitted"
            ],
            "title": "Status"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the application was created",
            "examples": [
              "2025-01-10 14:30:00"
            ],
            "title": "Created At"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the application was last updated",
            "examples": [
              "2025-01-10 15:00:00"
            ],
            "title": "Updated At"
          },
          "submitted_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the application was submitted",
            "examples": [
              "2025-01-10 14:35:00"
            ],
            "title": "Submitted At"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Your reference ID for the application",
            "examples": [
              "REF-12345"
            ],
            "title": "Reference Id"
          }
        },
        "title": "ApplicationListItemOut",
        "type": "object"
      },
      "ApplicationListResponse": {
        "description": "Response schema for listing applications with pagination.",
        "properties": {
          "applications": {
            "description": "List of applications",
            "items": {
              "$ref": "#/components/schemas/ApplicationListItemOut"
            },
            "title": "Applications",
            "type": "array"
          },
          "total_items": {
            "description": "Total number of applications matching the filter criteria",
            "examples": [
              100
            ],
            "title": "Total Items",
            "type": "integer"
          },
          "page": {
            "description": "Current page number",
            "examples": [
              1
            ],
            "title": "Page",
            "type": "integer"
          },
          "limit": {
            "description": "Number of items per page",
            "examples": [
              10
            ],
            "title": "Limit",
            "type": "integer"
          }
        },
        "required": [
          "applications",
          "total_items",
          "page",
          "limit"
        ],
        "title": "ApplicationListResponse",
        "type": "object"
      },
      "Document": {
        "properties": {
          "uuid": {
            "description": "UUID of the document",
            "examples": [
              "3fa85f64-5717-4562-b3fc-2960b5d4b1f"
            ],
            "format": "uuid",
            "title": "Uuid",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "examples": [
              "Suntrust_Bank_Statements_for_June.pdf"
            ],
            "title": "Name"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UploadedFileStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The title of the file.",
            "examples": [
              "Suntrust Bank Statements for June"
            ],
            "title": "Title"
          },
          "category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocumentCategory"
              },
              {
                "type": "null"
              }
            ],
            "description": "The categorization of the file."
          },
          "mimetype": {
            "$ref": "#/components/schemas/MimeTypes",
            "description": "MimeTypes Enum"
          },
          "size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "The size of the file received.",
            "examples": [
              200122
            ],
            "title": "Size"
          },
          "created": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The date and time the Document was created.",
            "examples": [
              "2024-04-11 17:51:42"
            ],
            "title": "Created"
          },
          "modified": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "The date and time the Document was last updated.",
            "examples": [
              "2024-06-02 11:23:10"
            ],
            "title": "Modified"
          }
        },
        "required": [
          "uuid",
          "mimetype"
        ],
        "title": "Document",
        "type": "object"
      },
      "DocumentCategory": {
        "description": "<br>The categorization of documentation required for the loan application.\n\n|Value                  |Description                                                 |\n|-----------------------|------------------------------------------------------------|\n|bank_statement         |**Bank Statements** sent for the primary operating account. |\n|driving_licence        |A valid State issued **Driving Licences** for the owner.    |\n|title_of_incorporation |**Title of Incorporation** for the business.                |",
        "enum": [
          "bank_statements",
          "business_tax_return",
          "personal_tax_return",
          "ytd_financials",
          "ye_financials",
          "debt_schedule",
          "photo_id",
          "utility_bill",
          "lease_agreement",
          "business_license",
          "sos_record",
          "lien_release",
          "lien_filing",
          "proof_of_payoff",
          "ssn_card",
          "void_check",
          "insurance_document",
          "mortgage_document",
          "personal_document",
          "formation_documents",
          "unknown"
        ],
        "title": "DocumentCategory",
        "type": "string"
      },
      "DocumentList": {
        "properties": {
          "documents": {
            "items": {
              "$ref": "#/components/schemas/Document"
            },
            "title": "Documents",
            "type": "array"
          }
        },
        "required": [
          "documents"
        ],
        "title": "DocumentList",
        "type": "object"
      },
      "DocumentRejectReason": {
        "description": "Enumeration of valid document rejection reasons.\n\nNote: doc_service returns uppercase values (e.g., \"ILLEGIBLE_OR_BLURRY\").\nConvert using: DocumentRejectReason(value.lower())",
        "enum": [
          "illegible_or_blurry",
          "incomplete",
          "wrong_type_uploaded",
          "expired",
          "invalid_file_format",
          "fraudulent_or_altered",
          "missing_information",
          "other"
        ],
        "title": "DocumentRejectReason",
        "type": "string"
      },
      "MimeTypes": {
        "description": "",
        "enum": [
          "application/pdf",
          "image/jpeg",
          "image/png",
          "image/gif",
          "image/tiff",
          "image/heic",
          "image/heif",
          "text/csv",
          "text/plain"
        ],
        "title": "MimeTypes",
        "type": "string"
      },
      "UploadedFileStates": {
        "enum": [
          "pending",
          "processing",
          "failed",
          "submitted",
          "in_review",
          "accepted",
          "rejected"
        ],
        "title": "UploadedFileStates",
        "type": "string"
      },
      "UploadedFileStatus": {
        "properties": {
          "state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UploadedFileStates"
              },
              {
                "type": "null"
              }
            ],
            "description": "The status of the documents provided.",
            "examples": [
              "rejected"
            ]
          },
          "rejection_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DocumentRejectReason"
              },
              {
                "type": "null"
              }
            ],
            "description": "The reason for document rejection. Only present when state is 'rejected'.",
            "examples": [
              "illegible_or_blurry"
            ]
          },
          "comments": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Additional information explaining the status provided.",
            "examples": [
              "image is illegible"
            ],
            "title": "Comments"
          }
        },
        "title": "UploadedFileStatus",
        "type": "object"
      },
      "FeeBasedLOCOffer": {
        "properties": {
          "id": {
            "description": "Offer ID",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "loan_type": {
            "$ref": "#/components/schemas/LoanType",
            "description": "Type of loan",
            "example": "fee_based_loc"
          },
          "payment_frequency": {
            "description": "Payment frequency",
            "enum": [
              "monthly",
              "semi_monthly"
            ],
            "example": "monthly",
            "title": "Payment Frequency",
            "type": "string"
          },
          "term": {
            "description": "Term in months",
            "example": 36,
            "title": "Term",
            "type": "integer"
          },
          "has_disclosure": {
            "description": "Whether the offer has a commercial financing disclosure PDF",
            "example": true,
            "title": "Has Disclosure",
            "type": "boolean"
          },
          "expires_at": {
            "description": "Offer expiration date",
            "examples": "2025-10-31 11:23:10",
            "title": "Expires At",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/OfferStatus",
            "description": "Offer status",
            "example": "presented"
          },
          "decline_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason the offer was declined, if applicable",
            "example": null,
            "title": "Decline Reason"
          },
          "annual_fee_in_cents": {
            "description": "Annual fee amount in cents",
            "example": 10000,
            "title": "Annual Fee In Cents",
            "type": "integer"
          },
          "commitment_fee_amount_in_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Commitment fee amount in cents",
            "example": 10000,
            "title": "Commitment Fee Amount In Cents"
          },
          "facility_size_in_cents": {
            "description": "Facility size",
            "example": 12500000,
            "title": "Facility Size In Cents",
            "type": "integer"
          },
          "minimum_draw_amount_in_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Minimum draw amount in cents",
            "example": 100000,
            "title": "Minimum Draw Amount In Cents"
          },
          "basis_fee": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Basis fee amount",
            "example": "200.00",
            "title": "Basis Fee"
          }
        },
        "required": [
          "id",
          "loan_type",
          "payment_frequency",
          "term",
          "has_disclosure",
          "expires_at",
          "status",
          "annual_fee_in_cents",
          "facility_size_in_cents",
          "basis_fee"
        ],
        "title": "FeeBasedLOCOffer",
        "type": "object"
      },
      "LoanType": {
        "enum": [
          "fee_based_loc",
          "term_loc",
          "standard_term_loan",
          "revenue_based_advance"
        ],
        "title": "LoanType",
        "type": "string"
      },
      "OfferStatus": {
        "enum": [
          "presented",
          "accepted",
          "rejected"
        ],
        "title": "OfferStatus",
        "type": "string"
      },
      "Offers": {
        "properties": {
          "application_id": {
            "description": "Application ID",
            "example": "550e8400-e29b-41d4-a716-446655440001",
            "format": "uuid",
            "title": "Application Id",
            "type": "string"
          },
          "offers": {
            "description": "List of loan offers",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/FeeBasedLOCOffer"
                },
                {
                  "$ref": "#/components/schemas/TermLOCOffer"
                },
                {
                  "$ref": "#/components/schemas/TermLoanOffer"
                },
                {
                  "$ref": "#/components/schemas/RevenueBasedAdvanceOffer"
                }
              ]
            },
            "title": "Offers",
            "type": "array"
          }
        },
        "required": [
          "application_id",
          "offers"
        ],
        "title": "Offers",
        "type": "object"
      },
      "RevenueBasedAdvanceOffer": {
        "properties": {
          "id": {
            "description": "Offer ID",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "loan_type": {
            "$ref": "#/components/schemas/LoanType",
            "description": "Type of loan",
            "example": "fee_based_loc"
          },
          "payment_frequency": {
            "description": "Payment frequency",
            "enum": [
              "monthly",
              "semi_monthly"
            ],
            "example": "monthly",
            "title": "Payment Frequency",
            "type": "string"
          },
          "term": {
            "description": "Term in months",
            "example": 36,
            "title": "Term",
            "type": "integer"
          },
          "has_disclosure": {
            "description": "Whether the offer has a commercial financing disclosure PDF",
            "example": true,
            "title": "Has Disclosure",
            "type": "boolean"
          },
          "expires_at": {
            "description": "Offer expiration date",
            "examples": "2025-10-31 11:23:10",
            "title": "Expires At",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/OfferStatus",
            "description": "Offer status",
            "example": "presented"
          },
          "decline_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason the offer was declined, if applicable",
            "example": null,
            "title": "Decline Reason"
          },
          "amount_in_cents": {
            "description": "Loan amount",
            "example": 10000000,
            "title": "Amount In Cents",
            "type": "integer"
          },
          "amortized_payment_amount_in_cents": {
            "description": "Amortized payment amount",
            "example": 549189,
            "title": "Amortized Payment Amount In Cents",
            "type": "integer"
          },
          "factor_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Factor rate for the offer",
            "example": "1.10",
            "title": "Factor Rate"
          },
          "revenue_share_amount_in_cents": {
            "description": "Revenue share amount",
            "example": 0,
            "title": "Revenue Share Amount In Cents",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "loan_type",
          "payment_frequency",
          "term",
          "has_disclosure",
          "expires_at",
          "status",
          "amount_in_cents",
          "amortized_payment_amount_in_cents",
          "factor_rate",
          "revenue_share_amount_in_cents"
        ],
        "title": "RevenueBasedAdvanceOffer",
        "type": "object"
      },
      "TermLOCOffer": {
        "properties": {
          "id": {
            "description": "Offer ID",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "loan_type": {
            "$ref": "#/components/schemas/LoanType",
            "description": "Type of loan",
            "example": "fee_based_loc"
          },
          "payment_frequency": {
            "description": "Payment frequency",
            "enum": [
              "monthly",
              "semi_monthly"
            ],
            "example": "monthly",
            "title": "Payment Frequency",
            "type": "string"
          },
          "term": {
            "description": "Term in months",
            "example": 36,
            "title": "Term",
            "type": "integer"
          },
          "has_disclosure": {
            "description": "Whether the offer has a commercial financing disclosure PDF",
            "example": true,
            "title": "Has Disclosure",
            "type": "boolean"
          },
          "expires_at": {
            "description": "Offer expiration date",
            "examples": "2025-10-31 11:23:10",
            "title": "Expires At",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/OfferStatus",
            "description": "Offer status",
            "example": "presented"
          },
          "decline_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason the offer was declined, if applicable",
            "example": null,
            "title": "Decline Reason"
          },
          "annual_fee_in_cents": {
            "description": "Annual fee amount in cents",
            "example": 10000,
            "title": "Annual Fee In Cents",
            "type": "integer"
          },
          "commitment_fee_amount_in_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Commitment fee amount in cents",
            "example": 10000,
            "title": "Commitment Fee Amount In Cents"
          },
          "facility_size_in_cents": {
            "description": "Facility size",
            "example": 12500000,
            "title": "Facility Size In Cents",
            "type": "integer"
          },
          "minimum_draw_amount_in_cents": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Minimum draw amount in cents",
            "example": 100000,
            "title": "Minimum Draw Amount In Cents"
          },
          "interest_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Interest rate",
            "example": "0.05",
            "title": "Interest Rate"
          },
          "draw_fee": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Draw fee amount",
            "example": "15.00",
            "title": "Draw Fee"
          }
        },
        "required": [
          "id",
          "loan_type",
          "payment_frequency",
          "term",
          "has_disclosure",
          "expires_at",
          "status",
          "annual_fee_in_cents",
          "facility_size_in_cents",
          "interest_rate",
          "draw_fee"
        ],
        "title": "TermLOCOffer",
        "type": "object"
      },
      "TermLoanOffer": {
        "properties": {
          "id": {
            "description": "Offer ID",
            "example": "550e8400-e29b-41d4-a716-446655440000",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "loan_type": {
            "$ref": "#/components/schemas/LoanType",
            "description": "Type of loan",
            "example": "fee_based_loc"
          },
          "payment_frequency": {
            "description": "Payment frequency",
            "enum": [
              "monthly",
              "semi_monthly"
            ],
            "example": "monthly",
            "title": "Payment Frequency",
            "type": "string"
          },
          "term": {
            "description": "Term in months",
            "example": 36,
            "title": "Term",
            "type": "integer"
          },
          "has_disclosure": {
            "description": "Whether the offer has a commercial financing disclosure PDF",
            "example": true,
            "title": "Has Disclosure",
            "type": "boolean"
          },
          "expires_at": {
            "description": "Offer expiration date",
            "examples": "2025-10-31 11:23:10",
            "title": "Expires At",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/OfferStatus",
            "description": "Offer status",
            "example": "presented"
          },
          "decline_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason the offer was declined, if applicable",
            "example": null,
            "title": "Decline Reason"
          },
          "amount_in_cents": {
            "description": "Loan amount",
            "example": 1000000,
            "title": "Amount In Cents",
            "type": "integer"
          },
          "amortized_payment_amount_in_cents": {
            "description": "Amortized payment amount",
            "example": 30000,
            "title": "Amortized Payment Amount In Cents",
            "type": "integer"
          },
          "interest_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Interest rate",
            "example": "0.07",
            "title": "Interest Rate"
          },
          "revenue_share_amount_in_cents": {
            "description": "Revenue share amount",
            "example": 0,
            "title": "Revenue Share Amount In Cents",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "loan_type",
          "payment_frequency",
          "term",
          "has_disclosure",
          "expires_at",
          "status",
          "amount_in_cents",
          "amortized_payment_amount_in_cents",
          "interest_rate",
          "revenue_share_amount_in_cents"
        ],
        "title": "TermLoanOffer",
        "type": "object"
      },
      "DeclineOfferReason": {
        "description": "Enum for offer decline reasons.",
        "enum": [
          "Fees were too high",
          "Interest rate was too high",
          "Product didn't meet business needs",
          "Loan terms were too short",
          "Loan amount didn't meet capital needs",
          "Received a better offer from another provider",
          "The process took too long",
          "Other",
          "Transaction Processing error",
          "Unresponsive"
        ],
        "title": "DeclineOfferReason",
        "type": "string"
      },
      "DeclineOfferRequest": {
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/DeclineOfferReason",
            "description": "Reason for declining the offers",
            "examples": [
              "Fees were too high",
              "Other"
            ]
          },
          "reason_other": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom reason text (required when reason is OTHER)",
            "examples": [
              "Found better terms with another lender."
            ],
            "title": "Reason Other"
          }
        },
        "required": [
          "reason"
        ],
        "title": "DeclineOfferRequest",
        "type": "object"
      },
      "ApplicationWithdrawnSucessSchema": {
        "properties": {
          "message": {
            "example": "Application withdrawn successfully",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "ApplicationWithdrawnSucessSchema",
        "type": "object"
      },
      "ApplicationNotWithdrawnErrorSchema": {
        "properties": {
          "message": {
            "example": "The application could not be withdrawn.",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "message"
        ],
        "title": "ApplicationNotWithdrawnErrorSchema",
        "type": "object"
      },
      "WithdrawReason": {
        "description": "Enum for application withdrawal reasons from CaseCenter.",
        "enum": [
          "Received funding already",
          "Not able to provide information",
          "Process took too long",
          "Reverting the application back to first look",
          "Other"
        ],
        "title": "WithdrawReason",
        "type": "string"
      },
      "WithdrawRequest": {
        "properties": {
          "reason": {
            "$ref": "#/components/schemas/WithdrawReason",
            "description": "Reason for withdrawing the application",
            "examples": [
              "Received funding already",
              "Other"
            ]
          },
          "reason_other": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Custom reason text (required when reason is OTHER)",
            "examples": [
              "Found a better rate elsewhere."
            ],
            "title": "Reason Other"
          }
        },
        "required": [
          "reason"
        ],
        "title": "WithdrawRequest",
        "type": "object"
      },
      "AddAdditionalOwnersResponse": {
        "description": "Response schema for adding additional owners.",
        "properties": {
          "message": {
            "description": "Success message",
            "examples": [
              "Additional owners added successfully"
            ],
            "title": "Message",
            "type": "string"
          },
          "owners_added": {
            "description": "Number of owners added",
            "examples": [
              2
            ],
            "title": "Owners Added",
            "type": "integer"
          }
        },
        "required": [
          "message",
          "owners_added"
        ],
        "title": "AddAdditionalOwnersResponse",
        "type": "object"
      },
      "AdditionalOwnerAddress": {
        "description": "Address schema for additional owner.",
        "properties": {
          "street": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Street address line 1.",
            "examples": [
              "123 Main St"
            ],
            "title": "Street"
          },
          "street2": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Street address line 2 (optional).",
            "examples": [
              "Apt 4B"
            ],
            "title": "Street2"
          },
          "city": {
            "anyOf": [
              {
                "maxLength": 100,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "City name.",
            "examples": [
              "San Francisco"
            ],
            "title": "City"
          },
          "state": {
            "anyOf": [
              {
                "pattern": "^[A-Z]{2}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "State code (2 letters).",
            "examples": [
              "CA"
            ],
            "title": "State"
          },
          "zip_code": {
            "anyOf": [
              {
                "pattern": "^\\d{5}(-\\d{4})?$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ZIP code (5 digits or 5+4 format).",
            "examples": [
              "94102",
              "94102-1234"
            ],
            "title": "Zip Code"
          }
        },
        "title": "AdditionalOwnerAddress",
        "type": "object"
      },
      "AdditionalOwnerIn": {
        "description": "Schema for additional owner data for post-submission owner addition.",
        "properties": {
          "first_name": {
            "description": "The first name of the additional owner.",
            "examples": [
              "John"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "First Name",
            "type": "string"
          },
          "last_name": {
            "description": "The last name of the additional owner.",
            "examples": [
              "Doe"
            ],
            "maxLength": 100,
            "minLength": 1,
            "title": "Last Name",
            "type": "string"
          },
          "ownership_percent": {
            "description": "What percentage does this owner have in the company?",
            "examples": [
              25.0
            ],
            "maximum": 100,
            "minimum": 1,
            "title": "Ownership Percent",
            "type": "number"
          },
          "ssn": {
            "anyOf": [
              {
                "pattern": "^\\d{9}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Social Security Number (9 digits, no dashes).",
            "examples": [
              "123456789"
            ],
            "title": "Ssn"
          },
          "authorization_to_pull_credit": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "description": "Whether the owner authorizes pulling their credit report.",
            "examples": [
              true
            ],
            "title": "Authorization To Pull Credit"
          },
          "phone_number": {
            "anyOf": [
              {
                "pattern": "^\\d{3}-\\d{3}-\\d{4}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Phone number for the additional owner.",
            "examples": [
              "650-555-1234"
            ],
            "title": "Phone Number"
          },
          "email": {
            "anyOf": [
              {
                "format": "email",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A valid email address for the additional owner.",
            "examples": [
              "john.doe@example.com"
            ],
            "title": "Email"
          },
          "birth_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Date of birth in YYYY-MM-DD format.",
            "examples": [
              "1980-01-15"
            ],
            "title": "Birth Date"
          },
          "address": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AdditionalOwnerAddress"
              },
              {
                "type": "null"
              }
            ],
            "description": "Address information for the additional owner."
          }
        },
        "required": [
          "first_name",
          "last_name",
          "ownership_percent"
        ],
        "title": "AdditionalOwnerIn",
        "type": "object"
      },
      "AddBankAccountsResponse": {
        "description": "Response after adding bank accounts.",
        "properties": {
          "message": {
            "description": "Status message",
            "examples": [
              "Bank accounts added successfully"
            ],
            "title": "Message",
            "type": "string"
          },
          "aggregator_accounts_added": {
            "description": "Number of aggregator accounts added and queued for processing",
            "examples": [
              1
            ],
            "title": "Aggregator Accounts Added",
            "type": "integer"
          },
          "direct_accounts_added": {
            "description": "Number of direct-from-customer accounts forwarded to Apply Service",
            "examples": [
              1
            ],
            "title": "Direct Accounts Added",
            "type": "integer"
          }
        },
        "required": [
          "message",
          "aggregator_accounts_added",
          "direct_accounts_added"
        ],
        "title": "AddBankAccountsResponse",
        "type": "object"
      },
      "AggregatorBankAccountInput": {
        "description": "Bank account connected via aggregator (Plaid/MX).\n\nUsed for bank statement analysis and transaction data.\nThe source field can be any string describing where the link came from\n(e.g., \"plaid_link\", \"partner_portal\", \"aggregator\").",
        "properties": {
          "source": {
            "description": "Source/origin of the bank account link (e.g., 'plaid_link', 'aggregator')",
            "title": "Source",
            "type": "string"
          },
          "aggregator": {
            "$ref": "#/components/schemas/AggregatorInfo",
            "description": "Aggregator connection details"
          }
        },
        "required": [
          "source",
          "aggregator"
        ],
        "title": "AggregatorBankAccountInput",
        "type": "object"
      },
      "DirectFromCustomerBankAccountInput": {
        "description": "Bank account with details entered directly by the customer.\n\nUsed for disbursement when customer provides account/routing numbers manually.",
        "properties": {
          "source": {
            "const": "direct_from_customer",
            "description": "Source type for direct customer entry",
            "title": "Source",
            "type": "string"
          },
          "direct_from_customer": {
            "$ref": "#/components/schemas/DirectFromCustomerDetails",
            "description": "Bank account details provided directly by the customer"
          }
        },
        "required": [
          "source",
          "direct_from_customer"
        ],
        "title": "DirectFromCustomerBankAccountInput",
        "type": "object"
      },
      "DirectFromCustomerDetails": {
        "description": "Bank account details entered directly by the customer.",
        "properties": {
          "account_number": {
            "description": "Bank account number (4-17 digits)",
            "examples": [
              "1234567890"
            ],
            "maxLength": 17,
            "minLength": 4,
            "pattern": "^\\d{4,17}$",
            "title": "Account Number",
            "type": "string"
          },
          "routing_number": {
            "description": "Bank routing number (9 digits)",
            "examples": [
              "021000021"
            ],
            "pattern": "^\\d{9}$",
            "title": "Routing Number",
            "type": "string"
          }
        },
        "required": [
          "account_number",
          "routing_number"
        ],
        "title": "DirectFromCustomerDetails",
        "type": "object"
      },
      "IngestTransactionsResponse": {
        "description": "Lightweight response — internal downstream IDs are intentionally omitted.\n\nThe ``type`` field is pinned to the known variant tags so the response\ncan never echo an arbitrary client-supplied string. Grows as new\nvariants are added.",
        "properties": {
          "type": {
            "const": "plaid_asset_report",
            "example": "plaid_asset_report",
            "title": "Type",
            "type": "string"
          },
          "message": {
            "example": "Plaid asset report ingested",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "type",
          "message"
        ],
        "title": "IngestTransactionsResponse",
        "type": "object"
      },
      "PlaidAssetAccount": {
        "description": "A single account within a Plaid item.",
        "properties": {
          "account_id": {
            "title": "Account Id",
            "type": "string"
          },
          "mask": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mask"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "official_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Official Name"
          },
          "subtype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subtype"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "balances": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlaidAssetAccountBalances"
              },
              {
                "type": "null"
              }
            ]
          },
          "days_available": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Days Available"
          },
          "historical_balances": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PlaidAssetHistoricalBalance"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Historical Balances"
          },
          "transactions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PlaidAssetTransaction"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transactions"
          },
          "owners": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Owners"
          }
        },
        "required": [
          "account_id"
        ],
        "title": "PlaidAssetAccount",
        "type": "object"
      },
      "PlaidAssetAccountBalances": {
        "description": "Current and available balance snapshot for a Plaid account.",
        "properties": {
          "available": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Available"
          },
          "current": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current"
          },
          "iso_currency_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iso Currency Code"
          },
          "limit": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit"
          },
          "margin_loan_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Margin Loan Amount"
          }
        },
        "title": "PlaidAssetAccountBalances",
        "type": "object"
      },
      "PlaidAssetHistoricalBalance": {
        "description": "A single historical balance data point for an account.",
        "properties": {
          "current": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date"
          },
          "iso_currency_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Iso Currency Code"
          }
        },
        "title": "PlaidAssetHistoricalBalance",
        "type": "object"
      },
      "PlaidAssetItem": {
        "description": "A Plaid item (a connection to a single institution).",
        "properties": {
          "institution_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Institution Id"
          },
          "institution_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Institution Name"
          },
          "item_id": {
            "title": "Item Id",
            "type": "string"
          },
          "date_last_updated": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date Last Updated"
          },
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/PlaidAssetAccount"
            },
            "title": "Accounts",
            "type": "array"
          }
        },
        "required": [
          "item_id",
          "accounts"
        ],
        "title": "PlaidAssetItem",
        "type": "object"
      },
      "PlaidAssetReport": {
        "description": "A Plaid asset report as returned by ``/asset_report/get``.",
        "properties": {
          "asset_report_id": {
            "title": "Asset Report Id",
            "type": "string"
          },
          "client_report_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Report Id"
          },
          "date_generated": {
            "format": "date-time",
            "title": "Date Generated",
            "type": "string"
          },
          "days_requested": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Days Requested"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/PlaidAssetItem"
            },
            "minItems": 1,
            "title": "Items",
            "type": "array"
          },
          "user": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlaidAssetUser"
              },
              {
                "type": "null"
              }
            ]
          },
          "warnings": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Warnings"
          }
        },
        "required": [
          "asset_report_id",
          "date_generated",
          "items"
        ],
        "title": "PlaidAssetReport",
        "type": "object"
      },
      "PlaidAssetReportEnvelope": {
        "description": "Envelope variant for Plaid asset reports.",
        "properties": {
          "type": {
            "const": "plaid_asset_report",
            "title": "Type",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/PlaidAssetReport"
          }
        },
        "required": [
          "type",
          "data"
        ],
        "title": "PlaidAssetReportEnvelope",
        "type": "object"
      },
      "PlaidAssetTransaction": {
        "description": "A single transaction on a Plaid account.",
        "properties": {
          "transaction_id": {
            "title": "Transaction Id",
            "type": "string"
          },
          "account_id": {
            "title": "Account Id",
            "type": "string"
          },
          "amount": {
            "title": "Amount",
            "type": "number"
          },
          "date": {
            "title": "Date",
            "type": "string"
          },
          "original_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Original Description"
          },
          "pending": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pending"
          }
        },
        "required": [
          "transaction_id",
          "account_id",
          "amount",
          "date"
        ],
        "title": "PlaidAssetTransaction",
        "type": "object"
      },
      "PlaidAssetUser": {
        "description": "Optional user details that may accompany a Plaid asset report.",
        "properties": {
          "client_user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client User Id"
          },
          "first_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Name"
          },
          "last_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Name"
          },
          "middle_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Middle Name"
          },
          "ssn": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ssn"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "phone_number": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone Number"
          }
        },
        "title": "PlaidAssetUser",
        "type": "object"
      },
      "TaskStatus": {
        "enum": [
          "open",
          "pending_customer_response",
          "pending_verification",
          "complete",
          "inactive"
        ],
        "title": "TaskStatus",
        "type": "string"
      },
      "ActionType": {
        "enum": [
          "document_upload",
          "identity_provider_link",
          "add_owners"
        ],
        "title": "ActionType",
        "type": "string"
      },
      "AddOwnerActionSchema": {
        "description": "Schema for add owner action (e.g., additional personal guarantors).",
        "properties": {
          "action_id": {
            "description": "Unique identifier for this action",
            "title": "Action Id",
            "type": "string"
          },
          "action_type": {
            "$ref": "#/components/schemas/ActionType",
            "description": "Type of action",
            "examples": [
              "add_owners"
            ]
          },
          "title": {
            "description": "Title of the action",
            "title": "Title",
            "type": "string"
          },
          "prompt": {
            "description": "Instructions for completing this action",
            "title": "Prompt",
            "type": "string"
          },
          "endpoint": {
            "description": "API endpoint to submit additional owners",
            "title": "Endpoint",
            "type": "string"
          },
          "magic_link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Magic link URL for adding owners",
            "title": "Magic Link"
          }
        },
        "required": [
          "action_id",
          "action_type",
          "title",
          "prompt",
          "endpoint"
        ],
        "title": "AddOwnerActionSchema",
        "type": "object"
      },
      "CompletionStrategy": {
        "enum": [
          "any_one"
        ],
        "title": "CompletionStrategy",
        "type": "string"
      },
      "DocumentType": {
        "description": "Document types for upload endpoint validation",
        "enum": [
          "bank_statements",
          "business_tax_return",
          "personal_tax_return",
          "ytd_financials",
          "ye_financials",
          "debt_schedule",
          "photo_id",
          "utility_bill",
          "lease_agreement",
          "business_license",
          "sos_record",
          "lien_release",
          "lien_filing",
          "proof_of_payoff",
          "ssn_card",
          "void_check",
          "insurance_document",
          "mortgage_document",
          "personal_document",
          "formation_documents"
        ],
        "title": "DocumentType",
        "type": "string"
      },
      "DocumentUploadActionSchema": {
        "description": "Schema for document upload action.",
        "properties": {
          "action_id": {
            "description": "Unique identifier for this action",
            "title": "Action Id",
            "type": "string"
          },
          "action_type": {
            "$ref": "#/components/schemas/ActionType",
            "description": "Type of action",
            "examples": [
              "document_upload"
            ]
          },
          "title": {
            "description": "Title of the action",
            "title": "Title",
            "type": "string"
          },
          "prompt": {
            "description": "Instructions for completing this action",
            "title": "Prompt",
            "type": "string"
          },
          "document_types": {
            "description": "List of acceptable document types. Each value matches a multipart form field name accepted by POST /api/v3/applications/{app_id}/documents — use these values directly when constructing the upload request.",
            "items": {
              "$ref": "#/components/schemas/DocumentType"
            },
            "title": "Document Types",
            "type": "array"
          },
          "magic_link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Magic link URL for document upload",
            "title": "Magic Link"
          }
        },
        "required": [
          "action_id",
          "action_type",
          "title",
          "prompt",
          "document_types"
        ],
        "title": "DocumentUploadActionSchema",
        "type": "object"
      },
      "IdentityProviderLinkActionSchema": {
        "description": "Schema for identity provider link action (e.g., Plaid).",
        "properties": {
          "action_id": {
            "description": "Unique identifier for this action",
            "title": "Action Id",
            "type": "string"
          },
          "action_type": {
            "$ref": "#/components/schemas/ActionType",
            "description": "Type of action",
            "examples": [
              "identity_provider_link"
            ]
          },
          "title": {
            "description": "Title of the action",
            "title": "Title",
            "type": "string"
          },
          "description": {
            "description": "Description of what this action does",
            "title": "Description",
            "type": "string"
          },
          "magic_link": {
            "description": "URL to initiate the identity provider flow",
            "title": "Magic Link",
            "type": "string"
          }
        },
        "required": [
          "action_id",
          "action_type",
          "title",
          "description",
          "magic_link"
        ],
        "title": "IdentityProviderLinkActionSchema",
        "type": "object"
      },
      "TaskDetailSchema": {
        "description": "Schema for detailed task information.",
        "properties": {
          "id": {
            "description": "Unique identifier for the task",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "task": {
            "description": "Task identifier (slug from description)",
            "title": "Task",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/TaskStatus",
            "description": "Current status of the task"
          },
          "title": {
            "description": "Human-readable task title",
            "title": "Title",
            "type": "string"
          },
          "description": {
            "description": "Detailed task description",
            "title": "Description",
            "type": "string"
          },
          "completion_strategy": {
            "$ref": "#/components/schemas/CompletionStrategy",
            "description": "Strategy for completing the task (e.g., 'any_one')"
          },
          "magic_link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional magic link for task completion",
            "title": "Magic Link"
          },
          "actions": {
            "description": "Available actions to complete this task",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/DocumentUploadActionSchema"
                },
                {
                  "$ref": "#/components/schemas/IdentityProviderLinkActionSchema"
                },
                {
                  "$ref": "#/components/schemas/AddOwnerActionSchema"
                }
              ]
            },
            "title": "Actions",
            "type": "array"
          },
          "created": {
            "description": "Task creation timestamp",
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "modified": {
            "description": "Task last modified timestamp",
            "format": "date-time",
            "title": "Modified",
            "type": "string"
          }
        },
        "required": [
          "id",
          "task",
          "status",
          "title",
          "description",
          "completion_strategy",
          "actions",
          "created",
          "modified"
        ],
        "title": "TaskDetailSchema",
        "type": "object"
      },
      "TaskSchema": {
        "description": "Schema for task in API v3 response.",
        "properties": {
          "id": {
            "description": "Unique identifier for the task",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "task": {
            "description": "Task identifier (slug from description)",
            "title": "Task",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/TaskStatus",
            "description": "Current status of the task"
          },
          "title": {
            "description": "Human-readable task title",
            "title": "Title",
            "type": "string"
          },
          "description": {
            "description": "Detailed task description",
            "title": "Description",
            "type": "string"
          }
        },
        "required": [
          "id",
          "task",
          "status",
          "title",
          "description"
        ],
        "title": "TaskSchema",
        "type": "object"
      },
      "ContractsResponseSchema": {
        "description": "Response schema for the embedded contracts endpoint.",
        "properties": {
          "signers": {
            "description": "List of signers on the contract with their signing tokens.",
            "items": {
              "$ref": "#/components/schemas/SignerSchema"
            },
            "title": "Signers",
            "type": "array"
          }
        },
        "required": [
          "signers"
        ],
        "title": "ContractsResponseSchema",
        "type": "object"
      },
      "SignerSchema": {
        "properties": {
          "email_address": {
            "description": "Email address of the contract signer.",
            "examples": [
              "applicant@example.com"
            ],
            "title": "Email Address",
            "type": "string"
          },
          "signing_token": {
            "description": "Opaque token to be passed to the Quantum-wrapped embedded signing JS SDK to drive the signing experience for this signer.",
            "examples": [
              "abc123"
            ],
            "title": "Signing Token",
            "type": "string"
          }
        },
        "required": [
          "email_address",
          "signing_token"
        ],
        "title": "SignerSchema",
        "type": "object"
      },
      "DrawRequestOutput": {
        "properties": {
          "id": {
            "description": "Draw request UUID",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "draw_amount_in_cents": {
            "description": "Draw amount in cents",
            "title": "Draw Amount In Cents",
            "type": "integer"
          },
          "draw_fee_in_cents": {
            "description": "Draw fee amount in cents",
            "title": "Draw Fee In Cents",
            "type": "integer"
          },
          "draw_request_fee_basis": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Draw request fee basis percentage",
            "title": "Draw Request Fee Basis"
          },
          "status": {
            "$ref": "#/components/schemas/DrawRequestStatus",
            "description": "Status of draw request"
          },
          "rejected_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DrawRequestRejectedReason"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason for draw request rejection"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the draw request.",
            "title": "Reference Id"
          },
          "created": {
            "description": "Creation timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "modified": {
            "description": "Last update timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Modified",
            "type": "string"
          }
        },
        "required": [
          "id",
          "draw_amount_in_cents",
          "draw_fee_in_cents",
          "status",
          "created",
          "modified"
        ],
        "title": "DrawRequestOutput",
        "type": "object"
      },
      "DrawRequestRejectedReason": {
        "enum": [
          "Customer Cancellation",
          "Internal Cancellation"
        ],
        "title": "DrawRequestRejectedReason",
        "type": "string"
      },
      "DrawRequestStatus": {
        "enum": [
          "submitted",
          "completed",
          "cancelled",
          "on_hold",
          "processed"
        ],
        "title": "DrawRequestStatus",
        "type": "string"
      },
      "QuantumException": {
        "properties": {
          "detail": {
            "description": "Error detail message",
            "title": "Detail",
            "type": "string"
          }
        },
        "required": [
          "detail"
        ],
        "title": "QuantumException",
        "type": "object"
      },
      "DrawRequestInput": {
        "properties": {
          "draw_amount_in_cents": {
            "description": "Draw amount in cents",
            "title": "Draw Amount In Cents",
            "type": "integer"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the draw request.",
            "title": "Reference Id"
          }
        },
        "required": [
          "draw_amount_in_cents"
        ],
        "title": "DrawRequestInput",
        "type": "object"
      },
      "PagedDrawRequest": {
        "properties": {
          "draw_requests": {
            "description": "List of draw requests",
            "items": {
              "$ref": "#/components/schemas/DrawRequestOutput"
            },
            "title": "Draw Requests",
            "type": "array"
          },
          "current_page": {
            "description": "Current page number",
            "title": "Current Page",
            "type": "integer"
          },
          "page_size": {
            "description": "Number of items per page",
            "title": "Page Size",
            "type": "integer"
          },
          "total_pages": {
            "description": "Total number of pages",
            "title": "Total Pages",
            "type": "integer"
          },
          "total_items": {
            "description": "Total number of items",
            "title": "Total Items",
            "type": "integer"
          }
        },
        "required": [
          "draw_requests",
          "current_page",
          "page_size",
          "total_pages",
          "total_items"
        ],
        "title": "PagedDrawRequest",
        "type": "object"
      },
      "PaymentRequestOutput": {
        "properties": {
          "id": {
            "description": "Quantum Payment Request ID",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "payment_amount_in_cents": {
            "description": "Payment amount in cents",
            "title": "Payment Amount In Cents",
            "type": "integer"
          },
          "status": {
            "$ref": "#/components/schemas/PaymentRequestStatus",
            "description": "Status of payment request"
          },
          "request_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PaymentRequestType"
              },
              {
                "type": "null"
              }
            ],
            "description": "Type of payment request"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the payment request.",
            "title": "Reference Id"
          },
          "created": {
            "description": "Creation timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "modified": {
            "description": "Last update timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Modified",
            "type": "string"
          }
        },
        "required": [
          "id",
          "payment_amount_in_cents",
          "status",
          "request_type",
          "reference_id",
          "created",
          "modified"
        ],
        "title": "PaymentRequestOutput",
        "type": "object"
      },
      "PaymentRequestStatus": {
        "enum": [
          "pending",
          "completed",
          "cancelled",
          "on_hold"
        ],
        "title": "PaymentRequestStatus",
        "type": "string"
      },
      "PaymentRequestType": {
        "enum": [
          "payoff_request",
          "past_due_request",
          "payment_request"
        ],
        "title": "PaymentRequestType",
        "type": "string"
      },
      "PaymentRequestInput": {
        "properties": {
          "payment_amount_in_cents": {
            "description": "Payment amount in cents",
            "title": "Payment Amount In Cents",
            "type": "integer"
          },
          "request_type": {
            "$ref": "#/components/schemas/PaymentRequestType",
            "description": "Type of payment request"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the payment request.",
            "title": "Reference Id"
          }
        },
        "required": [
          "payment_amount_in_cents",
          "request_type"
        ],
        "title": "PaymentRequestInput",
        "type": "object"
      },
      "PagedPaymentRequest": {
        "properties": {
          "payment_requests": {
            "description": "List of payment requests",
            "items": {
              "$ref": "#/components/schemas/PaymentRequestOutput"
            },
            "title": "Payment Requests",
            "type": "array"
          },
          "current_page": {
            "description": "Current page number",
            "title": "Current Page",
            "type": "integer"
          },
          "page_size": {
            "description": "Number of items per page",
            "title": "Page Size",
            "type": "integer"
          },
          "total_pages": {
            "description": "Total number of pages",
            "title": "Total Pages",
            "type": "integer"
          },
          "total_items": {
            "description": "Total number of items",
            "title": "Total Items",
            "type": "integer"
          }
        },
        "required": [
          "payment_requests",
          "current_page",
          "page_size",
          "total_pages",
          "total_items"
        ],
        "title": "PagedPaymentRequest",
        "type": "object"
      },
      "BankInfo": {
        "description": "Bank account information for loan.",
        "properties": {
          "account_no": {
            "description": "Last 4 digits of bank account number",
            "title": "Account No",
            "type": "string"
          },
          "routing_no": {
            "description": "Bank routing number",
            "title": "Routing No",
            "type": "string"
          }
        },
        "required": [
          "account_no",
          "routing_no"
        ],
        "title": "BankInfo",
        "type": "object"
      },
      "BusinessData": {
        "properties": {
          "legal_name": {
            "description": "Legal name of the business",
            "title": "Legal Name",
            "type": "string"
          },
          "doing_business_as": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "DBA name of the business",
            "title": "Doing Business As"
          },
          "email": {
            "description": "Business email address",
            "title": "Email",
            "type": "string"
          },
          "phone_number": {
            "description": "Business phone number",
            "title": "Phone Number",
            "type": "string"
          },
          "created": {
            "description": "Creation timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "modified": {
            "description": "Last update timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Modified",
            "type": "string"
          }
        },
        "required": [
          "legal_name",
          "email",
          "phone_number",
          "created",
          "modified"
        ],
        "title": "BusinessData",
        "type": "object"
      },
      "FBLoan": {
        "properties": {
          "id": {
            "description": "Quantum Loan UUID",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/LoanStatus",
            "description": "Current status of the loan"
          },
          "closed_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoanClosedReasons"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason for loan closure"
          },
          "lock_data": {
            "$ref": "#/components/schemas/LoanLockData",
            "description": "Loan lock/unlock information"
          },
          "type": {
            "$ref": "#/components/schemas/LoanProductType",
            "description": "Loan product type - Fee Based Line of Credit"
          },
          "term": {
            "description": "Loan term in months",
            "title": "Term",
            "type": "integer"
          },
          "commitment_fee": {
            "description": "Commitment fee percentage",
            "title": "Commitment Fee",
            "type": "number"
          },
          "payment_frequency": {
            "$ref": "#/components/schemas/LoanPaymentFrequency",
            "description": "Payment frequency for the loan"
          },
          "maturity_date": {
            "description": "Loan maturity date",
            "format": "date",
            "title": "Maturity Date",
            "type": "string"
          },
          "account_name": {
            "description": "Account name for the loan",
            "title": "Account Name",
            "type": "string"
          },
          "open_date": {
            "description": "Date when the loan was opened",
            "format": "date",
            "title": "Open Date",
            "type": "string"
          },
          "account_id": {
            "description": "Loan number NLS",
            "title": "Account Id",
            "type": "string"
          },
          "next_payment_due_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Next payment due date",
            "title": "Next Payment Due Date"
          },
          "business": {
            "$ref": "#/components/schemas/BusinessData",
            "description": "Business information associated with the loan"
          },
          "can_request_bac": {
            "description": "Whether bank account changes can be requested",
            "title": "Can Request Bac",
            "type": "boolean"
          },
          "bank_info": {
            "$ref": "#/components/schemas/BankInfo",
            "description": "Bank account information"
          },
          "total_past_due": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total past due amount in cents",
            "title": "Total Past Due"
          },
          "days_past_due": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of days past due",
            "title": "Days Past Due"
          },
          "principal_balance": {
            "description": "Current principal balance in cents",
            "title": "Principal Balance",
            "type": "integer"
          },
          "next_payment_amount_in_cents": {
            "description": "Next payment amount in cents",
            "title": "Next Payment Amount In Cents",
            "type": "integer"
          },
          "can_draw": {
            "description": "Whether draws can be requested from this loan",
            "title": "Can Draw",
            "type": "boolean"
          },
          "max_facility_limit_cents": {
            "description": "Maximum facility limit in cents",
            "title": "Max Facility Limit Cents",
            "type": "integer"
          },
          "current_facility_limit_cents": {
            "description": "Current facility limit in cents",
            "title": "Current Facility Limit Cents",
            "type": "integer"
          },
          "active_past_due_date_request": {
            "description": "Whether there's an active past due date request",
            "title": "Active Past Due Date Request",
            "type": "boolean"
          },
          "active_total_payoff_request": {
            "description": "Whether there's an active total payoff request",
            "title": "Active Total Payoff Request",
            "type": "boolean"
          },
          "is_chargeoff": {
            "description": "Whether the loan is in chargeoff status",
            "title": "Is Chargeoff",
            "type": "boolean"
          },
          "calculated_max_payoff": {
            "description": "Calculated maximum payoff amount in cents",
            "title": "Calculated Max Payoff",
            "type": "integer"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the account.",
            "title": "Reference Id"
          },
          "created": {
            "description": "Creation timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "modified": {
            "description": "Last update timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Modified",
            "type": "string"
          },
          "fee_basis": {
            "description": "Fee basis percentage for the loan",
            "title": "Fee Basis",
            "type": "number"
          },
          "fee_loc_basis": {
            "description": "Fee basis amount in cents for line of credit",
            "title": "Fee Loc Basis",
            "type": "integer"
          },
          "last_draw_request_fee_basis": {
            "description": "Fee basis percentage from the last draw request",
            "title": "Last Draw Request Fee Basis",
            "type": "number"
          },
          "draw_fee": {
            "description": "Draw fee percentage",
            "title": "Draw Fee",
            "type": "number"
          },
          "minimum_draw": {
            "description": "Minimum draw amount in cents",
            "title": "Minimum Draw",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "status",
          "lock_data",
          "type",
          "term",
          "commitment_fee",
          "payment_frequency",
          "maturity_date",
          "account_name",
          "open_date",
          "account_id",
          "next_payment_due_date",
          "business",
          "can_request_bac",
          "bank_info",
          "total_past_due",
          "days_past_due",
          "principal_balance",
          "next_payment_amount_in_cents",
          "can_draw",
          "max_facility_limit_cents",
          "current_facility_limit_cents",
          "active_past_due_date_request",
          "active_total_payoff_request",
          "is_chargeoff",
          "calculated_max_payoff",
          "created",
          "modified",
          "fee_basis",
          "fee_loc_basis",
          "last_draw_request_fee_basis",
          "draw_fee",
          "minimum_draw"
        ],
        "title": "FBLoan",
        "type": "object"
      },
      "IBLoan": {
        "properties": {
          "id": {
            "description": "Quantum Loan UUID",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/LoanStatus",
            "description": "Current status of the loan"
          },
          "closed_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoanClosedReasons"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason for loan closure"
          },
          "lock_data": {
            "$ref": "#/components/schemas/LoanLockData",
            "description": "Loan lock/unlock information"
          },
          "type": {
            "$ref": "#/components/schemas/LoanProductType",
            "description": "Type of loan product"
          },
          "term": {
            "description": "Loan term in months",
            "title": "Term",
            "type": "integer"
          },
          "commitment_fee": {
            "description": "Commitment fee percentage",
            "title": "Commitment Fee",
            "type": "number"
          },
          "payment_frequency": {
            "$ref": "#/components/schemas/LoanPaymentFrequency",
            "description": "Payment frequency for the loan"
          },
          "maturity_date": {
            "description": "Loan maturity date",
            "format": "date",
            "title": "Maturity Date",
            "type": "string"
          },
          "account_name": {
            "description": "Account name for the loan",
            "title": "Account Name",
            "type": "string"
          },
          "open_date": {
            "description": "Date when the loan was opened",
            "format": "date",
            "title": "Open Date",
            "type": "string"
          },
          "account_id": {
            "description": "Loan number NLS",
            "title": "Account Id",
            "type": "string"
          },
          "next_payment_due_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Next payment due date",
            "title": "Next Payment Due Date"
          },
          "business": {
            "$ref": "#/components/schemas/BusinessData",
            "description": "Business information associated with the loan"
          },
          "can_request_bac": {
            "description": "Whether bank account changes can be requested",
            "title": "Can Request Bac",
            "type": "boolean"
          },
          "bank_info": {
            "$ref": "#/components/schemas/BankInfo",
            "description": "Bank account information"
          },
          "total_past_due": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total past due amount in cents",
            "title": "Total Past Due"
          },
          "days_past_due": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of days past due",
            "title": "Days Past Due"
          },
          "principal_balance": {
            "description": "Current principal balance in cents",
            "title": "Principal Balance",
            "type": "integer"
          },
          "next_payment_amount_in_cents": {
            "description": "Next payment amount in cents",
            "title": "Next Payment Amount In Cents",
            "type": "integer"
          },
          "can_draw": {
            "description": "Whether draws can be requested from this loan",
            "title": "Can Draw",
            "type": "boolean"
          },
          "max_facility_limit_cents": {
            "description": "Maximum facility limit in cents",
            "title": "Max Facility Limit Cents",
            "type": "integer"
          },
          "current_facility_limit_cents": {
            "description": "Current facility limit in cents",
            "title": "Current Facility Limit Cents",
            "type": "integer"
          },
          "active_past_due_date_request": {
            "description": "Whether there's an active past due date request",
            "title": "Active Past Due Date Request",
            "type": "boolean"
          },
          "active_total_payoff_request": {
            "description": "Whether there's an active total payoff request",
            "title": "Active Total Payoff Request",
            "type": "boolean"
          },
          "is_chargeoff": {
            "description": "Whether the loan is in chargeoff status",
            "title": "Is Chargeoff",
            "type": "boolean"
          },
          "calculated_max_payoff": {
            "description": "Calculated maximum payoff amount in cents",
            "title": "Calculated Max Payoff",
            "type": "integer"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the account.",
            "title": "Reference Id"
          },
          "created": {
            "description": "Creation timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "modified": {
            "description": "Last update timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Modified",
            "type": "string"
          },
          "interest_rate": {
            "title": "Interest Rate",
            "type": "number"
          },
          "draw_fee": {
            "title": "Draw Fee",
            "type": "number"
          },
          "minimum_draw": {
            "title": "Minimum Draw",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "status",
          "lock_data",
          "type",
          "term",
          "commitment_fee",
          "payment_frequency",
          "maturity_date",
          "account_name",
          "open_date",
          "account_id",
          "next_payment_due_date",
          "business",
          "can_request_bac",
          "bank_info",
          "total_past_due",
          "days_past_due",
          "principal_balance",
          "next_payment_amount_in_cents",
          "can_draw",
          "max_facility_limit_cents",
          "current_facility_limit_cents",
          "active_past_due_date_request",
          "active_total_payoff_request",
          "is_chargeoff",
          "calculated_max_payoff",
          "created",
          "modified",
          "interest_rate",
          "draw_fee",
          "minimum_draw"
        ],
        "title": "IBLoan",
        "type": "object"
      },
      "LoanClosedReasons": {
        "enum": [
          "Customer Requested",
          "Inactivity",
          "Confirmed Fraud",
          "Refi",
          "Delinquency",
          "LOC Refresh Results",
          "UW Decision"
        ],
        "title": "LoanClosedReasons",
        "type": "string"
      },
      "LoanLockData": {
        "properties": {
          "is_locked": {
            "description": "Whether the loan is currently locked",
            "title": "Is Locked",
            "type": "boolean"
          },
          "locked_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoanLockReasons"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason for loan lock"
          },
          "unlocked_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoanUnlockReasons"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason for loan unlock"
          }
        },
        "required": [
          "is_locked"
        ],
        "title": "LoanLockData",
        "type": "object"
      },
      "LoanLockReasons": {
        "enum": [
          "Delinquency",
          "Suspected Fraud",
          "Inactivity",
          "LOC Refresh Results",
          "Bankruptcy",
          "Deceased Customer",
          "Disabled ACH",
          "Funding Return",
          "Returned Payment"
        ],
        "title": "LoanLockReasons",
        "type": "string"
      },
      "LoanPaymentFrequency": {
        "enum": [
          "Monthly",
          "Semi-Monthly",
          "Weekly",
          "Annually"
        ],
        "title": "LoanPaymentFrequency",
        "type": "string"
      },
      "LoanProductType": {
        "enum": [
          "FEE_BASED_LOC",
          "INTEREST_BASED_LOC",
          "TERM_LOAN"
        ],
        "title": "LoanProductType",
        "type": "string"
      },
      "LoanStatus": {
        "enum": [
          "open",
          "closed",
          "locked"
        ],
        "title": "LoanStatus",
        "type": "string"
      },
      "LoanUnlockReasons": {
        "enum": [
          "Series of on-time payments",
          "Suspected Fraud Resolved",
          "Refresh Pass",
          "Delinquency Resolved",
          "Statements Reviewed",
          "Connected Bank Account"
        ],
        "title": "LoanUnlockReasons",
        "type": "string"
      },
      "TermLoan": {
        "properties": {
          "id": {
            "description": "Quantum Loan UUID",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/LoanStatus",
            "description": "Current status of the loan"
          },
          "closed_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LoanClosedReasons"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reason for loan closure"
          },
          "lock_data": {
            "$ref": "#/components/schemas/LoanLockData",
            "description": "Loan lock/unlock information"
          },
          "type": {
            "$ref": "#/components/schemas/LoanProductType",
            "description": "Type of loan product"
          },
          "term": {
            "description": "Loan term in months",
            "title": "Term",
            "type": "integer"
          },
          "commitment_fee": {
            "description": "Commitment fee percentage",
            "title": "Commitment Fee",
            "type": "number"
          },
          "payment_frequency": {
            "$ref": "#/components/schemas/LoanPaymentFrequency",
            "description": "Payment frequency for the loan"
          },
          "maturity_date": {
            "description": "Loan maturity date",
            "format": "date",
            "title": "Maturity Date",
            "type": "string"
          },
          "account_name": {
            "description": "Account name for the loan",
            "title": "Account Name",
            "type": "string"
          },
          "open_date": {
            "description": "Date when the loan was opened",
            "format": "date",
            "title": "Open Date",
            "type": "string"
          },
          "account_id": {
            "description": "Loan number NLS",
            "title": "Account Id",
            "type": "string"
          },
          "next_payment_due_date": {
            "anyOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Next payment due date",
            "title": "Next Payment Due Date"
          },
          "business": {
            "$ref": "#/components/schemas/BusinessData",
            "description": "Business information associated with the loan"
          },
          "can_request_bac": {
            "description": "Whether bank account changes can be requested",
            "title": "Can Request Bac",
            "type": "boolean"
          },
          "bank_info": {
            "$ref": "#/components/schemas/BankInfo",
            "description": "Bank account information"
          },
          "total_past_due": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Total past due amount in cents",
            "title": "Total Past Due"
          },
          "days_past_due": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of days past due",
            "title": "Days Past Due"
          },
          "principal_balance": {
            "description": "Current principal balance in cents",
            "title": "Principal Balance",
            "type": "integer"
          },
          "next_payment_amount_in_cents": {
            "description": "Next payment amount in cents",
            "title": "Next Payment Amount In Cents",
            "type": "integer"
          },
          "can_draw": {
            "description": "Whether draws can be requested from this loan",
            "title": "Can Draw",
            "type": "boolean"
          },
          "max_facility_limit_cents": {
            "description": "Maximum facility limit in cents",
            "title": "Max Facility Limit Cents",
            "type": "integer"
          },
          "current_facility_limit_cents": {
            "description": "Current facility limit in cents",
            "title": "Current Facility Limit Cents",
            "type": "integer"
          },
          "active_past_due_date_request": {
            "description": "Whether there's an active past due date request",
            "title": "Active Past Due Date Request",
            "type": "boolean"
          },
          "active_total_payoff_request": {
            "description": "Whether there's an active total payoff request",
            "title": "Active Total Payoff Request",
            "type": "boolean"
          },
          "is_chargeoff": {
            "description": "Whether the loan is in chargeoff status",
            "title": "Is Chargeoff",
            "type": "boolean"
          },
          "calculated_max_payoff": {
            "description": "Calculated maximum payoff amount in cents",
            "title": "Calculated Max Payoff",
            "type": "integer"
          },
          "reference_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A reference id that can be used to identify the account.",
            "title": "Reference Id"
          },
          "created": {
            "description": "Creation timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "modified": {
            "description": "Last update timestamp",
            "examples": [
              "2023-01-01 12:00:00"
            ],
            "format": "date-time",
            "title": "Modified",
            "type": "string"
          },
          "interest_rate": {
            "title": "Interest Rate",
            "type": "number"
          }
        },
        "required": [
          "id",
          "status",
          "lock_data",
          "type",
          "term",
          "commitment_fee",
          "payment_frequency",
          "maturity_date",
          "account_name",
          "open_date",
          "account_id",
          "next_payment_due_date",
          "business",
          "can_request_bac",
          "bank_info",
          "total_past_due",
          "days_past_due",
          "principal_balance",
          "next_payment_amount_in_cents",
          "can_draw",
          "max_facility_limit_cents",
          "current_facility_limit_cents",
          "active_past_due_date_request",
          "active_total_payoff_request",
          "is_chargeoff",
          "calculated_max_payoff",
          "created",
          "modified",
          "interest_rate"
        ],
        "title": "TermLoan",
        "type": "object"
      },
      "TransactionType": {
        "enum": [
          "PAYMENT",
          "ADVANCE",
          "UNKNOWN"
        ],
        "title": "TransactionType",
        "type": "string"
      },
      "PagedTransaction": {
        "properties": {
          "transactions": {
            "items": {
              "$ref": "#/components/schemas/Transaction"
            },
            "title": "Transactions",
            "type": "array"
          },
          "current_page": {
            "title": "Current Page",
            "type": "integer"
          },
          "page_size": {
            "title": "Page Size",
            "type": "integer"
          }
        },
        "required": [
          "transactions",
          "current_page",
          "page_size"
        ],
        "title": "PagedTransaction",
        "type": "object"
      },
      "Transaction": {
        "properties": {
          "id": {
            "description": "Transaction UUID",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "payment_date": {
            "description": "Transaction date",
            "format": "date",
            "title": "Payment Date",
            "type": "string"
          },
          "payment_number": {
            "description": "Payment number in the sequence, if applicable",
            "title": "Payment Number",
            "type": "integer"
          },
          "loan_amount": {
            "description": "Loan amount in cents, if applicable",
            "title": "Loan Amount",
            "type": "integer"
          },
          "interest_amount": {
            "description": "Interest amount in cents, if applicable",
            "title": "Interest Amount",
            "type": "integer"
          },
          "principal_amount": {
            "description": "Principal amount in cents, if applicable",
            "title": "Principal Amount",
            "type": "integer"
          },
          "fee_amount": {
            "description": "Fee amount in cents, if applicable",
            "title": "Fee Amount",
            "type": "integer"
          },
          "payment_amount": {
            "description": "Total payment amount in cents",
            "title": "Payment Amount",
            "type": "integer"
          },
          "balance_amount": {
            "description": "Remaining balance in cents",
            "title": "Balance Amount",
            "type": "integer"
          },
          "transaction_type": {
            "$ref": "#/components/schemas/TransactionType",
            "description": "Type of transaction"
          }
        },
        "required": [
          "id",
          "payment_date",
          "payment_number",
          "loan_amount",
          "interest_amount",
          "principal_amount",
          "fee_amount",
          "payment_amount",
          "balance_amount",
          "transaction_type"
        ],
        "title": "Transaction",
        "type": "object"
      },
      "Amortization": {
        "properties": {
          "id": {
            "description": "Amortization UUID",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "payment_date": {
            "description": "Payment due date",
            "format": "date",
            "title": "Payment Date",
            "type": "string"
          },
          "payment_number": {
            "description": "Payment number in the sequence",
            "title": "Payment Number",
            "type": "integer"
          },
          "payment_amount": {
            "description": "Total payment amount in cents",
            "title": "Payment Amount",
            "type": "integer"
          },
          "principal_amount": {
            "description": "Principal amount in cents",
            "title": "Principal Amount",
            "type": "integer"
          },
          "fee_amount": {
            "description": "Fee amount in cents",
            "title": "Fee Amount",
            "type": "integer"
          },
          "balance_amount": {
            "description": "Remaining balance in cents",
            "title": "Balance Amount",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "payment_date",
          "payment_number",
          "payment_amount",
          "principal_amount",
          "fee_amount",
          "balance_amount"
        ],
        "title": "Amortization",
        "type": "object"
      },
      "PagedAmortization": {
        "properties": {
          "transactions": {
            "items": {
              "$ref": "#/components/schemas/Amortization"
            },
            "title": "Transactions",
            "type": "array"
          },
          "current_page": {
            "title": "Current Page",
            "type": "integer"
          },
          "page_size": {
            "title": "Page Size",
            "type": "integer"
          }
        },
        "required": [
          "transactions",
          "current_page",
          "page_size"
        ],
        "title": "PagedAmortization",
        "type": "object"
      },
      "AuthConfigResponse": {
        "description": "Response schema for auth configuration (never includes credential).",
        "properties": {
          "type": {
            "title": "Type",
            "type": "string"
          },
          "token_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Url"
          }
        },
        "required": [
          "type"
        ],
        "title": "AuthConfigResponse",
        "type": "object"
      },
      "WebhookSubscriptionResponse": {
        "description": "Response schema for webhook subscription (includes secret - only for creation).\n\nNote: Externally we expose uuid as 'id' and never expose the internal integer id.\nTimestamps are renamed: created_at -> created.",
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "title": "Events",
            "type": "array"
          },
          "secret": {
            "description": "Webhook secret (only shown once at creation time)",
            "title": "Secret",
            "type": "string"
          },
          "num_retries": {
            "title": "Num Retries",
            "type": "integer"
          },
          "status": {
            "$ref": "#/components/schemas/WebhookSubscriptionStatus"
          },
          "created": {
            "title": "Created",
            "type": "string"
          },
          "auth": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AuthConfigResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "filter": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "description": "Per-event-type delivery filters (mapped from event_filters)",
            "examples": [
              {
                "application.status.updated": {
                  "status": "declined"
                }
              }
            ],
            "title": "Filter",
            "type": "object"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "secret",
          "num_retries",
          "status",
          "created"
        ],
        "title": "WebhookSubscriptionResponse",
        "type": "object"
      },
      "WebhookSubscriptionStatus": {
        "enum": [
          "active",
          "paused",
          "disabled"
        ],
        "title": "WebhookSubscriptionStatus",
        "type": "string"
      },
      "BadRequestErrorResponse": {
        "description": "Wrapped bad request error response (400).",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/BadRequestErrorSchema"
          }
        },
        "required": [
          "error"
        ],
        "title": "BadRequestErrorResponse",
        "type": "object"
      },
      "BadRequestErrorSchema": {
        "description": "Error schema for bad request errors (400).",
        "properties": {
          "code": {
            "examples": [
              "BAD_REQUEST"
            ],
            "title": "Code",
            "type": "string"
          },
          "message": {
            "examples": [
              "Invalid request parameters."
            ],
            "title": "Message",
            "type": "string"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetailItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "BadRequestErrorSchema",
        "type": "object"
      },
      "ErrorDetailItem": {
        "description": "Field-level error detail for validation errors.",
        "properties": {
          "field": {
            "examples": [
              "subscription.url"
            ],
            "title": "Field",
            "type": "string"
          },
          "message": {
            "examples": [
              "This field is required."
            ],
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "field",
          "message"
        ],
        "title": "ErrorDetailItem",
        "type": "object"
      },
      "UnauthorizedErrorResponse": {
        "description": "Wrapped unauthorized error response (401).",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/UnauthorizedErrorSchema"
          }
        },
        "required": [
          "error"
        ],
        "title": "UnauthorizedErrorResponse",
        "type": "object"
      },
      "UnauthorizedErrorSchema": {
        "description": "Error schema for unauthorized errors (401).",
        "properties": {
          "code": {
            "examples": [
              "UNAUTHORIZED"
            ],
            "title": "Code",
            "type": "string"
          },
          "message": {
            "examples": [
              "Authentication credentials were not provided or are invalid."
            ],
            "title": "Message",
            "type": "string"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetailItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "UnauthorizedErrorSchema",
        "type": "object"
      },
      "ForbiddenErrorResponse": {
        "description": "Wrapped forbidden error response (403).",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ForbiddenErrorSchema"
          }
        },
        "required": [
          "error"
        ],
        "title": "ForbiddenErrorResponse",
        "type": "object"
      },
      "ValidationErrorResponse": {
        "description": "Wrapped validation error response (422).",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ValidationErrorSchema"
          }
        },
        "required": [
          "error"
        ],
        "title": "ValidationErrorResponse",
        "type": "object"
      },
      "InternalErrorResponse": {
        "description": "Wrapped internal server error response (500).",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/InternalErrorSchema"
          }
        },
        "required": [
          "error"
        ],
        "title": "InternalErrorResponse",
        "type": "object"
      },
      "InternalErrorSchema": {
        "description": "Error schema for internal server errors (500).",
        "properties": {
          "code": {
            "examples": [
              "INTERNAL_SERVER_ERROR"
            ],
            "title": "Code",
            "type": "string"
          },
          "message": {
            "examples": [
              "An unexpected error occurred."
            ],
            "title": "Message",
            "type": "string"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetailItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "InternalErrorSchema",
        "type": "object"
      },
      "AuthConfigRequest": {
        "description": "Request schema for auth configuration block.",
        "properties": {
          "type": {
            "description": "Auth type: 'hmac_signature' or 'oauth2_client_credentials'",
            "title": "Type",
            "type": "string"
          },
          "token_url": {
            "anyOf": [
              {
                "maxLength": 2048,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "OAuth2 token endpoint URL (required for oauth2_client_credentials)",
            "title": "Token Url"
          },
          "credential": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Basic auth credential for token endpoint (required for oauth2_client_credentials)",
            "title": "Credential"
          }
        },
        "required": [
          "type"
        ],
        "title": "AuthConfigRequest",
        "type": "object"
      },
      "CreateWebhookSubscriptionRequest": {
        "description": "Request schema for creating a webhook subscription.",
        "properties": {
          "url": {
            "description": "HTTPS URL to deliver webhook events to",
            "maxLength": 2048,
            "title": "Url",
            "type": "string"
          },
          "events": {
            "description": "List of event types to subscribe to",
            "items": {
              "$ref": "#/components/schemas/WebhookTopic"
            },
            "minItems": 1,
            "title": "Events",
            "type": "array"
          },
          "num_retries": {
            "default": 3,
            "description": "Maximum number of retry attempts for failed deliveries (0-6)",
            "maximum": 6,
            "minimum": 0,
            "title": "Num Retries",
            "type": "integer"
          },
          "auth": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AuthConfigRequest"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional auth configuration for webhook delivery"
          },
          "filter": {
            "anyOf": [
              {
                "additionalProperties": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional per-event-type delivery filters. Maps an event type to a condition of public field -> value(s): a scalar means equals, a list means 'in', and multiple fields are AND-ed. Event types absent from the map are delivered unfiltered. Each condition must be a non-empty object; a value must be a non-empty string or a non-empty list of non-empty strings (empty values are rejected with 422).",
            "examples": [
              {
                "application.status.updated": {
                  "status": "declined"
                }
              }
            ],
            "title": "Filter"
          }
        },
        "required": [
          "url",
          "events"
        ],
        "title": "CreateWebhookSubscriptionRequest",
        "type": "object"
      },
      "WebhookTopic": {
        "description": "Allowed webhook event topics that partners can subscribe to.",
        "enum": [
          "application.created",
          "application.updated",
          "application.status.updated",
          "application.adverse_action.sent",
          "application.contract.sent",
          "application.contract.signed",
          "application.tasks.updated",
          "application.funding.started",
          "application.offer.created",
          "application.offer.selected",
          "application.offer.declined",
          "application.document.status.updated",
          "application.document.uploaded",
          "application.additional_owner.profile.completed",
          "prefill_application.created",
          "prefill_application.token_expired"
        ],
        "title": "WebhookTopic",
        "type": "string"
      },
      "WebhookSubscriptionListItem": {
        "description": "Response schema for a single webhook subscription in list responses (excludes secret).\n\nNote: Externally we expose uuid as 'id' and never expose the internal integer id.\nTimestamps are renamed: created_at -> created, updated_at -> modified.\nDatetime format: YYYY-MM-DD HH:MM:SS",
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/WebhookTopic"
            },
            "title": "Events",
            "type": "array"
          },
          "num_retries": {
            "title": "Num Retries",
            "type": "integer"
          },
          "status": {
            "$ref": "#/components/schemas/WebhookSubscriptionStatus"
          },
          "created": {
            "description": "Creation timestamp (format: YYYY-MM-DD HH:MM:SS)",
            "title": "Created",
            "type": "string"
          },
          "modified": {
            "description": "Last modification timestamp (format: YYYY-MM-DD HH:MM:SS)",
            "title": "Modified",
            "type": "string"
          },
          "auth": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AuthConfigResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "filter": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "description": "Per-event-type delivery filters (mapped from event_filters)",
            "examples": [
              {
                "application.status.updated": {
                  "status": "declined"
                }
              }
            ],
            "title": "Filter",
            "type": "object"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "num_retries",
          "status",
          "created",
          "modified"
        ],
        "title": "WebhookSubscriptionListItem",
        "type": "object"
      },
      "WebhookSubscriptionListResponse": {
        "description": "Paginated response schema for listing webhook subscriptions.",
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/WebhookSubscriptionListItem"
            },
            "title": "Results",
            "type": "array"
          },
          "current_page": {
            "title": "Current Page",
            "type": "integer"
          },
          "page_size": {
            "title": "Page Size",
            "type": "integer"
          },
          "total_pages": {
            "title": "Total Pages",
            "type": "integer"
          },
          "total_items": {
            "title": "Total Items",
            "type": "integer"
          }
        },
        "required": [
          "results",
          "current_page",
          "page_size",
          "total_pages",
          "total_items"
        ],
        "title": "WebhookSubscriptionListResponse",
        "type": "object"
      },
      "WebhookSubscriptionUpdateResponse": {
        "description": "Response schema for webhook subscription update (excludes secret).\n\nNote: Externally we expose uuid as 'id' and never expose the internal integer id.\nTimestamps are renamed: created_at -> created, updated_at -> modified.",
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "title": "Events",
            "type": "array"
          },
          "num_retries": {
            "title": "Num Retries",
            "type": "integer"
          },
          "status": {
            "$ref": "#/components/schemas/WebhookSubscriptionStatus"
          },
          "created": {
            "title": "Created",
            "type": "string"
          },
          "modified": {
            "title": "Modified",
            "type": "string"
          },
          "auth": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AuthConfigResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "filter": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "description": "Per-event-type delivery filters (mapped from event_filters)",
            "examples": [
              {
                "application.status.updated": {
                  "status": "declined"
                }
              }
            ],
            "title": "Filter",
            "type": "object"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "num_retries",
          "status",
          "created",
          "modified"
        ],
        "title": "WebhookSubscriptionUpdateResponse",
        "type": "object"
      },
      "NotFoundErrorResponse": {
        "description": "Wrapped not found error response (404).",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/NotFoundErrorSchema"
          }
        },
        "required": [
          "error"
        ],
        "title": "NotFoundErrorResponse",
        "type": "object"
      },
      "NotFoundErrorSchema": {
        "description": "Error schema for not found errors (404).",
        "properties": {
          "code": {
            "examples": [
              "NOT_FOUND"
            ],
            "title": "Code",
            "type": "string"
          },
          "message": {
            "examples": [
              "The requested resource was not found."
            ],
            "title": "Message",
            "type": "string"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetailItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "NotFoundErrorSchema",
        "type": "object"
      },
      "UpdateWebhookSubscriptionRequest": {
        "description": "Request schema for updating a webhook subscription (partial update).",
        "properties": {
          "url": {
            "anyOf": [
              {
                "maxLength": 2048,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTPS URL to deliver webhook events to",
            "title": "Url"
          },
          "events": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/WebhookTopic"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "List of event types to subscribe to",
            "title": "Events"
          },
          "num_retries": {
            "anyOf": [
              {
                "maximum": 6,
                "minimum": 0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum number of retry attempts for failed deliveries (0-6)",
            "title": "Num Retries"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WebhookSubscriptionStatus"
              },
              {
                "type": "null"
              }
            ],
            "description": "Subscription status: active, paused, or disabled"
          },
          "auth": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AuthConfigRequest"
              },
              {
                "type": "null"
              }
            ],
            "description": "Auth configuration (set to update, omit to keep unchanged)"
          },
          "filter": {
            "anyOf": [
              {
                "additionalProperties": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional per-event-type delivery filters (set to replace, omit to keep unchanged; pass {} or null to clear). Maps an event type to a condition of public field -> value(s): scalar means equals, list means 'in', multiple fields are AND-ed. Each condition must be a non-empty object; a value must be a non-empty string or a non-empty list of non-empty strings (empty values are rejected with 422).",
            "examples": [
              {
                "application.status.updated": {
                  "status": "declined"
                }
              }
            ],
            "title": "Filter"
          }
        },
        "title": "UpdateWebhookSubscriptionRequest",
        "type": "object"
      },
      "SecretRefreshResponse": {
        "description": "Response schema for secret refresh endpoint.\n\nIncludes the new secret (only shown once) and grace period information.\nNote: Externally we expose uuid as 'id'.",
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "secret": {
            "description": "New webhook secret (only shown once - store it securely)",
            "title": "Secret",
            "type": "string"
          },
          "previous_secret_valid_until": {
            "description": "Timestamp until which the previous secret remains valid",
            "title": "Previous Secret Valid Until",
            "type": "string"
          }
        },
        "required": [
          "id",
          "secret",
          "previous_secret_valid_until"
        ],
        "title": "SecretRefreshResponse",
        "type": "object"
      },
      "SourceEventLinks": {
        "description": "Links for a source event.",
        "properties": {
          "deliveries_url": {
            "description": "URL to get delivery attempts for this source event",
            "title": "Deliveries Url",
            "type": "string"
          }
        },
        "required": [
          "deliveries_url"
        ],
        "title": "SourceEventLinks",
        "type": "object"
      },
      "SourceEventListItem": {
        "description": "Response schema for a single source event in list responses.\n\nRepresents the original webhook event received from SNS.",
        "properties": {
          "id": {
            "description": "Source event UUID (SNS MessageId)",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "received_at": {
            "title": "Received At",
            "type": "string"
          },
          "delivery_count": {
            "description": "Number of your subscriptions this event was delivered to",
            "title": "Delivery Count",
            "type": "integer"
          },
          "links": {
            "$ref": "#/components/schemas/SourceEventLinks"
          }
        },
        "required": [
          "id",
          "event_type",
          "resource_type",
          "resource_id",
          "received_at",
          "delivery_count",
          "links"
        ],
        "title": "SourceEventListItem",
        "type": "object"
      },
      "SourceEventListResponse": {
        "description": "Paginated response schema for listing source events.",
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/SourceEventListItem"
            },
            "title": "Results",
            "type": "array"
          },
          "current_page": {
            "title": "Current Page",
            "type": "integer"
          },
          "page_size": {
            "title": "Page Size",
            "type": "integer"
          },
          "total_pages": {
            "title": "Total Pages",
            "type": "integer"
          },
          "total_items": {
            "title": "Total Items",
            "type": "integer"
          }
        },
        "required": [
          "results",
          "current_page",
          "page_size",
          "total_pages",
          "total_items"
        ],
        "title": "SourceEventListResponse",
        "type": "object"
      },
      "DeliveryAttemptItem": {
        "description": "Schema for a delivery attempt in source event detail.",
        "properties": {
          "id": {
            "description": "Delivery log UUID",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "subscription_id": {
            "format": "uuid",
            "title": "Subscription Id",
            "type": "string"
          },
          "attempt_number": {
            "title": "Attempt Number",
            "type": "integer"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Status"
          },
          "response_time_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Time Ms"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          },
          "delivered_at": {
            "title": "Delivered At",
            "type": "string"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          }
        },
        "required": [
          "id",
          "subscription_id",
          "attempt_number",
          "http_status",
          "response_time_ms",
          "success",
          "delivered_at",
          "error_message"
        ],
        "title": "DeliveryAttemptItem",
        "type": "object"
      },
      "SourceEventDetailResponse": {
        "description": "Response schema for source event detail endpoint.\n\nIncludes list of delivery attempts for this event.",
        "properties": {
          "id": {
            "description": "Source event UUID (SNS MessageId)",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "received_at": {
            "title": "Received At",
            "type": "string"
          },
          "delivery_count": {
            "description": "Number of your subscriptions this event was delivered to",
            "title": "Delivery Count",
            "type": "integer"
          },
          "deliveries": {
            "description": "List of delivery attempts for this event",
            "items": {
              "$ref": "#/components/schemas/DeliveryAttemptItem"
            },
            "title": "Deliveries",
            "type": "array"
          },
          "links": {
            "$ref": "#/components/schemas/SourceEventLinks"
          }
        },
        "required": [
          "id",
          "event_type",
          "resource_type",
          "resource_id",
          "received_at",
          "delivery_count",
          "deliveries",
          "links"
        ],
        "title": "SourceEventDetailResponse",
        "type": "object"
      },
      "WebhookEventListItem": {
        "description": "Response schema for a single webhook delivery event.\n\nRepresents a delivery attempt with full details including\nthe subscription ID and the payload that was sent.",
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "source_event_id": {
            "description": "Original event ID from SNS message (for traceability)",
            "format": "uuid",
            "title": "Source Event Id",
            "type": "string"
          },
          "subscription_id": {
            "format": "uuid",
            "title": "Subscription Id",
            "type": "string"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "attempt_number": {
            "title": "Attempt Number",
            "type": "integer"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Status"
          },
          "response_time_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Time Ms"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          },
          "delivered_at": {
            "title": "Delivered At",
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          }
        },
        "required": [
          "id",
          "source_event_id",
          "subscription_id",
          "event_type",
          "resource_type",
          "resource_id",
          "attempt_number",
          "http_status",
          "response_time_ms",
          "success",
          "delivered_at",
          "payload",
          "error_message"
        ],
        "title": "WebhookEventListItem",
        "type": "object"
      },
      "WebhookEventListResponse": {
        "description": "Paginated response schema for listing webhook events.",
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/WebhookEventListItem"
            },
            "title": "Results",
            "type": "array"
          },
          "current_page": {
            "title": "Current Page",
            "type": "integer"
          },
          "page_size": {
            "title": "Page Size",
            "type": "integer"
          },
          "total_pages": {
            "title": "Total Pages",
            "type": "integer"
          },
          "total_items": {
            "title": "Total Items",
            "type": "integer"
          }
        },
        "required": [
          "results",
          "current_page",
          "page_size",
          "total_pages",
          "total_items"
        ],
        "title": "WebhookEventListResponse",
        "type": "object"
      },
      "WebhookEventDetailResponse": {
        "description": "Response schema for webhook event details.",
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "source_event_id": {
            "description": "Original event ID from SNS message (for traceability)",
            "format": "uuid",
            "title": "Source Event Id",
            "type": "string"
          },
          "subscription_id": {
            "format": "uuid",
            "title": "Subscription Id",
            "type": "string"
          },
          "event_type": {
            "title": "Event Type",
            "type": "string"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "attempt_number": {
            "title": "Attempt Number",
            "type": "integer"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Http Status"
          },
          "response_time_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Time Ms"
          },
          "success": {
            "title": "Success",
            "type": "boolean"
          },
          "delivered_at": {
            "title": "Delivered At",
            "type": "string"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          }
        },
        "required": [
          "id",
          "source_event_id",
          "subscription_id",
          "event_type",
          "resource_type",
          "resource_id",
          "attempt_number",
          "http_status",
          "response_time_ms",
          "success",
          "delivered_at",
          "payload",
          "error_message"
        ],
        "title": "WebhookEventDetailResponse",
        "type": "object"
      },
      "ManualRetryResponse": {
        "description": "Response schema for manual webhook retry endpoint.\n\nReturns complete delivery result including the endpoint's response.",
        "properties": {
          "success": {
            "description": "Whether the webhook was delivered successfully",
            "title": "Success",
            "type": "boolean"
          },
          "id": {
            "description": "UUID of the new delivery log entry",
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "source_event_id": {
            "description": "Original event ID from SNS message (for traceability)",
            "format": "uuid",
            "title": "Source Event Id",
            "type": "string"
          },
          "subscription_id": {
            "format": "uuid",
            "title": "Subscription Id",
            "type": "string"
          },
          "attempt_number": {
            "description": "Attempt number for this retry",
            "title": "Attempt Number",
            "type": "integer"
          },
          "http_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTP status code from webhook endpoint",
            "title": "Http Status"
          },
          "response_time_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Response time in milliseconds",
            "title": "Response Time Ms"
          },
          "delivered_at": {
            "description": "Timestamp of this retry attempt",
            "title": "Delivered At",
            "type": "string"
          },
          "response": {
            "$ref": "#/components/schemas/WebhookResponse",
            "description": "Full response from webhook endpoint"
          },
          "payload": {
            "additionalProperties": true,
            "description": "Webhook payload that was sent",
            "title": "Payload",
            "type": "object"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Error message if delivery failed",
            "title": "Error Message"
          },
          "message": {
            "description": "Human-readable result message",
            "title": "Message",
            "type": "string"
          }
        },
        "required": [
          "success",
          "id",
          "source_event_id",
          "subscription_id",
          "attempt_number",
          "http_status",
          "response_time_ms",
          "delivered_at",
          "response",
          "payload",
          "error_message",
          "message"
        ],
        "title": "ManualRetryResponse",
        "type": "object"
      },
      "WebhookResponse": {
        "description": "Webhook endpoint response details for manual retry.",
        "properties": {
          "status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "HTTP status code from webhook endpoint",
            "title": "Status Code"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Response headers from webhook endpoint",
            "title": "Headers",
            "type": "object"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Response body from webhook endpoint (truncated to 10KB)",
            "title": "Body"
          }
        },
        "required": [
          "status_code",
          "headers",
          "body"
        ],
        "title": "WebhookResponse",
        "type": "object"
      },
      "ConflictErrorResponse": {
        "description": "Wrapped conflict error response (409).",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ConflictErrorSchema"
          }
        },
        "required": [
          "error"
        ],
        "title": "ConflictErrorResponse",
        "type": "object"
      },
      "ConflictErrorSchema": {
        "description": "Error schema for conflict errors (409).",
        "properties": {
          "code": {
            "examples": [
              "CONFLICT"
            ],
            "title": "Code",
            "type": "string"
          },
          "message": {
            "examples": [
              "The request conflicts with the current state of the resource."
            ],
            "title": "Message",
            "type": "string"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetailItem"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "title": "ConflictErrorSchema",
        "type": "object"
      }
    },
    "securitySchemes": {
      "QuantumAuthMiddleware": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": null
}
