@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
250 lines • 59.6 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* API v4
* Swagger documentation for API v4
*
* The version of the OpenAPI document: 4.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import { V4LendersCreateLenderBodyDtoToJSON, V4LendersCreateLenderResponseDtoFromJSON, V4LendersDeleteLenderResponseDtoFromJSON, V4LendersGetLenderColumnsResponseDtoFromJSON, V4LendersGetLenderResponseDtoFromJSON, V4LendersGetLendersInViewResponseDtoFromJSON, V4LendersGetLendersResponseDtoFromJSON, V4LendersUpdateLenderBodyDtoToJSON, V4LendersUpdateLenderResponseDtoFromJSON, } from '../models/index';
/**
*
*/
export class LendersAPIV4Api extends runtime.BaseAPI {
/**
* # POST /v4/lenders ## Overview Creates a new lender with the provided information. This endpoint allows you to add new lending institutions to your organization with their loan terms, fees, and lending criteria. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Body The request body should contain lender information to create the new lender. ### Required Fields | Field | Type | Description | |-------|------|-------------| | `name` | string | Lender company name (must be unique within organization) | ### Optional Fields | Field | Type | Description | |-------|------|-------------| | `bridgeLoanLoanToPurchasePrice` | number | Bridge loan to purchase price ratio (decimal, e.g., 0.8 for 80%) | | `bridgeLoanLoanToRefinanceCost` | number | Bridge loan to refinance cost ratio (decimal) | | `bridgeLoanInterestRate` | number | Bridge loan annual interest rate (decimal, e.g., 0.12 for 12%) | | `longTermRateAndTermInterestRate` | number | Long-term rate and term interest rate (decimal) | | `longTermCashOutInterestRate` | number | Long-term cash-out interest rate (decimal) | | `longTermRateAndTermLoanToValue` | number | Long-term rate and term LTV ratio (decimal) | | `longTermCashOutLoanToValue` | number | Long-term cash-out LTV ratio (decimal) | | `bridgeLoanLoanToCost` | number | Bridge loan to total cost ratio (decimal) | | `bridgeLoanLoanToAsIs` | number | Bridge loan to as-is value ratio (decimal) | | `bridgeLoanLoanToArv` | number | Bridge loan to ARV ratio (decimal) | | `originationPoints` | number | Origination points percentage (decimal) | | `loanProcessingFee` | number | Loan processing fee in dollars | ### Validation Rules - **Name**: Required, non-empty string, must be unique within organization - **Rates and Ratios**: Must be valid decimal numbers between 0 and 1 (for percentages) - **Fees**: Must be non-negative numbers - **Organization Scoping**: Lender is automatically associated with user\'s organization ## Request Example ```json { \"name\": \"XYZ Capital\", \"bridgeLoanLoanToPurchasePrice\": 0.8, \"bridgeLoanInterestRate\": 0.12, \"longTermRateAndTermInterestRate\": 0.07, \"originationPoints\": 2.0, \"loanProcessingFee\": 1500 } ``` ## Response Structure Returns the newly created lender\'s ID and confirmation. ## Use Cases This endpoint is ideal for: - **Lender Onboarding**: Add new lending partners to the system - **Market Expansion**: Include additional financing sources - **Competitive Analysis**: Add competitors for loan term comparison - **Deal Sourcing**: Expand available financing options for properties - **Integration**: Sync lenders from external CRM or loan systems - **Market Research**: Track lending terms across multiple institutions ## Business Rules - **Name Uniqueness**: Lender names must be unique within the organization - **Default Values**: Unspecified loan terms default to null and can be updated later - **Organization Association**: Lenders are automatically scoped to the user\'s organization - **Data Validation**: All loan terms are validated for reasonable ranges - **Audit Trail**: Lender creation is logged for compliance and tracking ## Loan Terms Setup ### Initial Configuration You can provide basic loan terms during creation or update them later: - **Bridge Loan Terms**: Short-term financing parameters - **Long-term Terms**: Permanent financing parameters - **Fee Structure**: Associated lending fees and costs ### Progressive Setup - **Minimal Creation**: Create with just a name and add terms progressively - **Complete Setup**: Provide all loan terms during initial creation - **Flexible Updates**: Update any terms after creation using PATCH endpoint ## Error Handling Common validation errors include: - **Duplicate Name**: Lender name already exists in the organization - **Invalid Rates**: Rates or ratios outside acceptable ranges - **Missing Required Fields**: Name not provided - **Invalid Data Types**: Non-numeric values for loan terms
* Create a new lender
*/
async v4LendersControllerCreateLenderV4Raw(requestParameters, initOverrides) {
if (requestParameters['v4LendersCreateLenderBodyDto'] == null) {
throw new runtime.RequiredError('v4LendersCreateLenderBodyDto', 'Required parameter "v4LendersCreateLenderBodyDto" was null or undefined when calling v4LendersControllerCreateLenderV4().');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/lenders`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: V4LendersCreateLenderBodyDtoToJSON(requestParameters['v4LendersCreateLenderBodyDto']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LendersCreateLenderResponseDtoFromJSON(jsonValue));
}
/**
* # POST /v4/lenders ## Overview Creates a new lender with the provided information. This endpoint allows you to add new lending institutions to your organization with their loan terms, fees, and lending criteria. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Body The request body should contain lender information to create the new lender. ### Required Fields | Field | Type | Description | |-------|------|-------------| | `name` | string | Lender company name (must be unique within organization) | ### Optional Fields | Field | Type | Description | |-------|------|-------------| | `bridgeLoanLoanToPurchasePrice` | number | Bridge loan to purchase price ratio (decimal, e.g., 0.8 for 80%) | | `bridgeLoanLoanToRefinanceCost` | number | Bridge loan to refinance cost ratio (decimal) | | `bridgeLoanInterestRate` | number | Bridge loan annual interest rate (decimal, e.g., 0.12 for 12%) | | `longTermRateAndTermInterestRate` | number | Long-term rate and term interest rate (decimal) | | `longTermCashOutInterestRate` | number | Long-term cash-out interest rate (decimal) | | `longTermRateAndTermLoanToValue` | number | Long-term rate and term LTV ratio (decimal) | | `longTermCashOutLoanToValue` | number | Long-term cash-out LTV ratio (decimal) | | `bridgeLoanLoanToCost` | number | Bridge loan to total cost ratio (decimal) | | `bridgeLoanLoanToAsIs` | number | Bridge loan to as-is value ratio (decimal) | | `bridgeLoanLoanToArv` | number | Bridge loan to ARV ratio (decimal) | | `originationPoints` | number | Origination points percentage (decimal) | | `loanProcessingFee` | number | Loan processing fee in dollars | ### Validation Rules - **Name**: Required, non-empty string, must be unique within organization - **Rates and Ratios**: Must be valid decimal numbers between 0 and 1 (for percentages) - **Fees**: Must be non-negative numbers - **Organization Scoping**: Lender is automatically associated with user\'s organization ## Request Example ```json { \"name\": \"XYZ Capital\", \"bridgeLoanLoanToPurchasePrice\": 0.8, \"bridgeLoanInterestRate\": 0.12, \"longTermRateAndTermInterestRate\": 0.07, \"originationPoints\": 2.0, \"loanProcessingFee\": 1500 } ``` ## Response Structure Returns the newly created lender\'s ID and confirmation. ## Use Cases This endpoint is ideal for: - **Lender Onboarding**: Add new lending partners to the system - **Market Expansion**: Include additional financing sources - **Competitive Analysis**: Add competitors for loan term comparison - **Deal Sourcing**: Expand available financing options for properties - **Integration**: Sync lenders from external CRM or loan systems - **Market Research**: Track lending terms across multiple institutions ## Business Rules - **Name Uniqueness**: Lender names must be unique within the organization - **Default Values**: Unspecified loan terms default to null and can be updated later - **Organization Association**: Lenders are automatically scoped to the user\'s organization - **Data Validation**: All loan terms are validated for reasonable ranges - **Audit Trail**: Lender creation is logged for compliance and tracking ## Loan Terms Setup ### Initial Configuration You can provide basic loan terms during creation or update them later: - **Bridge Loan Terms**: Short-term financing parameters - **Long-term Terms**: Permanent financing parameters - **Fee Structure**: Associated lending fees and costs ### Progressive Setup - **Minimal Creation**: Create with just a name and add terms progressively - **Complete Setup**: Provide all loan terms during initial creation - **Flexible Updates**: Update any terms after creation using PATCH endpoint ## Error Handling Common validation errors include: - **Duplicate Name**: Lender name already exists in the organization - **Invalid Rates**: Rates or ratios outside acceptable ranges - **Missing Required Fields**: Name not provided - **Invalid Data Types**: Non-numeric values for loan terms
* Create a new lender
*/
async v4LendersControllerCreateLenderV4(requestParameters, initOverrides) {
const response = await this.v4LendersControllerCreateLenderV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # DELETE /v4/lenders/{lenderId} ## Overview Deletes an existing lender from the system. This is a permanent operation that removes the lender and handles all associated data relationships appropriately. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `lenderId` | number | Yes | The unique identifier of the lender to delete | ## Access Control - **Organization Scope**: Lender must belong to the authenticated user\'s organization - **Lender Validation**: Invalid or non-existent lender IDs will return a 404 error - **Data Privacy**: Only lenders within the user\'s organization can be deleted ## Deletion Behavior The deletion operation: - **Permanent Removal**: Lender is permanently deleted from the system - **Cascade Handling**: Associated relationships and references are handled appropriately - **Immediate Effect**: Deletion is applied immediately - **Audit Trail**: Deletion is logged for audit and compliance purposes - **Data Integrity**: System ensures referential integrity during deletion ## Response Structure Returns confirmation that the lender was successfully deleted. ## Use Cases This endpoint is ideal for: - **Lender Cleanup**: Remove outdated or inactive lenders - **Data Management**: Maintain clean lender databases - **Market Changes**: Remove lenders that are no longer available - **Compliance**: Delete lenders upon business relationship termination - **System Maintenance**: Clean up test or duplicate lender data - **Portfolio Management**: Remove lenders not aligned with business strategy ## Important Considerations Before deleting a lender, consider: - **Active References**: Check if lender is referenced by active properties or deals - **Historical Data**: Consider impact on historical deal records - **Backup Requirements**: Ensure proper backup if recovery might be needed - **Compliance**: Follow data retention and deletion policies - **User Notification**: Consider notifying relevant users of the deletion - **Alternative Actions**: Consider deactivating instead of deleting for data preservation ## Referential Impact Lender deletion may affect: - **Property Deals**: Properties with this lender assignment - **Historical Records**: Past deals and analysis using this lender - **Reports**: Historical reports that included this lender - **Comparisons**: Lender comparison tables and analysis - **Integration**: External systems that reference this lender ## Data Relationships The system handles these relationships during deletion: - **Property References**: Properties referencing this lender are updated - **Deal History**: Historical deal records are preserved with archived lender data - **User Preferences**: User preferences referencing this lender are updated - **Views and Filters**: Saved views that filter by this lender are updated - **Reports**: Report configurations are updated to handle missing lender ## Error Handling Common errors include: - **Lender Not Found**: Lender ID does not exist or belongs to different organization - **Permission Denied**: User lacks permission to delete lenders - **Referential Constraints**: Lender cannot be deleted due to active references - **System Errors**: Database or system issues preventing deletion - **Business Rules**: Business logic preventing deletion (e.g., active deals) ## Recovery - **No API Recovery**: Deleted lenders cannot be restored through the API - **Backup Systems**: Recovery may be possible through system backups - **Audit Logs**: Deletion events are recorded for audit purposes - **Data Archival**: Consider data archival policies for compliance - **Recreation**: Deleted lenders can be recreated with POST /v4/lenders
* Delete a specific lender by lenderId
*/
async v4LendersControllerDeleteLenderV4Raw(requestParameters, initOverrides) {
if (requestParameters['lenderId'] == null) {
throw new runtime.RequiredError('lenderId', 'Required parameter "lenderId" was null or undefined when calling v4LendersControllerDeleteLenderV4().');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/lenders/{lenderId}`;
urlPath = urlPath.replace(`{${"lenderId"}}`, encodeURIComponent(String(requestParameters['lenderId'])));
const response = await this.request({
path: urlPath,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LendersDeleteLenderResponseDtoFromJSON(jsonValue));
}
/**
* # DELETE /v4/lenders/{lenderId} ## Overview Deletes an existing lender from the system. This is a permanent operation that removes the lender and handles all associated data relationships appropriately. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `lenderId` | number | Yes | The unique identifier of the lender to delete | ## Access Control - **Organization Scope**: Lender must belong to the authenticated user\'s organization - **Lender Validation**: Invalid or non-existent lender IDs will return a 404 error - **Data Privacy**: Only lenders within the user\'s organization can be deleted ## Deletion Behavior The deletion operation: - **Permanent Removal**: Lender is permanently deleted from the system - **Cascade Handling**: Associated relationships and references are handled appropriately - **Immediate Effect**: Deletion is applied immediately - **Audit Trail**: Deletion is logged for audit and compliance purposes - **Data Integrity**: System ensures referential integrity during deletion ## Response Structure Returns confirmation that the lender was successfully deleted. ## Use Cases This endpoint is ideal for: - **Lender Cleanup**: Remove outdated or inactive lenders - **Data Management**: Maintain clean lender databases - **Market Changes**: Remove lenders that are no longer available - **Compliance**: Delete lenders upon business relationship termination - **System Maintenance**: Clean up test or duplicate lender data - **Portfolio Management**: Remove lenders not aligned with business strategy ## Important Considerations Before deleting a lender, consider: - **Active References**: Check if lender is referenced by active properties or deals - **Historical Data**: Consider impact on historical deal records - **Backup Requirements**: Ensure proper backup if recovery might be needed - **Compliance**: Follow data retention and deletion policies - **User Notification**: Consider notifying relevant users of the deletion - **Alternative Actions**: Consider deactivating instead of deleting for data preservation ## Referential Impact Lender deletion may affect: - **Property Deals**: Properties with this lender assignment - **Historical Records**: Past deals and analysis using this lender - **Reports**: Historical reports that included this lender - **Comparisons**: Lender comparison tables and analysis - **Integration**: External systems that reference this lender ## Data Relationships The system handles these relationships during deletion: - **Property References**: Properties referencing this lender are updated - **Deal History**: Historical deal records are preserved with archived lender data - **User Preferences**: User preferences referencing this lender are updated - **Views and Filters**: Saved views that filter by this lender are updated - **Reports**: Report configurations are updated to handle missing lender ## Error Handling Common errors include: - **Lender Not Found**: Lender ID does not exist or belongs to different organization - **Permission Denied**: User lacks permission to delete lenders - **Referential Constraints**: Lender cannot be deleted due to active references - **System Errors**: Database or system issues preventing deletion - **Business Rules**: Business logic preventing deletion (e.g., active deals) ## Recovery - **No API Recovery**: Deleted lenders cannot be restored through the API - **Backup Systems**: Recovery may be possible through system backups - **Audit Logs**: Deletion events are recorded for audit purposes - **Data Archival**: Consider data archival policies for compliance - **Recreation**: Deleted lenders can be recreated with POST /v4/lenders
* Delete a specific lender by lenderId
*/
async v4LendersControllerDeleteLenderV4(requestParameters, initOverrides) {
const response = await this.v4LendersControllerDeleteLenderV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/lenders/{lenderId}/{columns} ## Overview Retrieves specific columns for a lender identified by its unique ID. This endpoint allows selective data retrieval, returning only the requested fields for the specified lender. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `lenderId` | number | Yes | The unique identifier of the lender | | `columns` | string | Yes | Comma-separated list of column names to retrieve | ## Column Selection Specify desired columns as a comma-separated string: - **Basic Info**: `lid,name,organizationId` - **Bridge Loan Terms**: `bridgeLoanInterestRate,bridgeLoanLoanToPurchasePrice,bridgeLoanLoanToCost` - **Long-term Terms**: `longTermRateAndTermInterestRate,longTermCashOutInterestRate` - **Fees**: `originationPoints,loanProcessingFee` - **Custom Selection**: Any combination of available columns ## Available Columns ### Basic Information - `lid`: Lender ID - `name`: Lender name - `organizationId`: Organization ID ### Bridge Loan Terms - `bridgeLoanLoanToPurchasePrice`: Purchase price ratio - `bridgeLoanLoanToRefinanceCost`: Refinance cost ratio - `bridgeLoanInterestRate`: Bridge loan interest rate - `bridgeLoanLoanToCost`: Total cost ratio - `bridgeLoanLoanToAsIs`: As-is value ratio - `bridgeLoanLoanToArv`: After-repair value ratio ### Long-term Loan Terms - `longTermRateAndTermInterestRate`: Rate and term interest rate - `longTermCashOutInterestRate`: Cash-out interest rate - `longTermRateAndTermLoanToValue`: Rate and term LTV ratio - `longTermCashOutLoanToValue`: Cash-out LTV ratio ### Fees and Costs - `originationPoints`: Origination points percentage - `loanProcessingFee`: Processing fee amount ## Access Control - **Organization Scope**: Lender must belong to the user\'s organization - **Column Validation**: Invalid column names are ignored - **Data Privacy**: Only authorized columns are returned ## Use Cases This endpoint is ideal for: - **Performance Optimization**: Retrieve only needed data to reduce bandwidth - **Specific Comparisons**: Get particular fields for lender comparison tables - **Integration**: Extract specific data points for external systems - **Custom Views**: Build interfaces with selective data display - **Mobile Optimization**: Minimize data transfer for mobile applications - **API Efficiency**: Reduce response size for better performance ## Performance Benefits - **Reduced Data Transfer**: Only requested columns are returned - **Faster Processing**: Less data processing on both server and client - **Network Efficiency**: Smaller response payloads - **Selective Queries**: Database queries target only required fields - **Cache Optimization**: Smaller responses improve caching efficiency
* Get specific columns of a lender by lenderId
*/
async v4LendersControllerGetLenderColumnsV4Raw(requestParameters, initOverrides) {
if (requestParameters['columns'] == null) {
throw new runtime.RequiredError('columns', 'Required parameter "columns" was null or undefined when calling v4LendersControllerGetLenderColumnsV4().');
}
if (requestParameters['lenderId'] == null) {
throw new runtime.RequiredError('lenderId', 'Required parameter "lenderId" was null or undefined when calling v4LendersControllerGetLenderColumnsV4().');
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/lenders/{lenderId}/{columns}`;
urlPath = urlPath.replace(`{${"columns"}}`, encodeURIComponent(String(requestParameters['columns'])));
urlPath = urlPath.replace(`{${"lenderId"}}`, encodeURIComponent(String(requestParameters['lenderId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LendersGetLenderColumnsResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/lenders/{lenderId}/{columns} ## Overview Retrieves specific columns for a lender identified by its unique ID. This endpoint allows selective data retrieval, returning only the requested fields for the specified lender. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `lenderId` | number | Yes | The unique identifier of the lender | | `columns` | string | Yes | Comma-separated list of column names to retrieve | ## Column Selection Specify desired columns as a comma-separated string: - **Basic Info**: `lid,name,organizationId` - **Bridge Loan Terms**: `bridgeLoanInterestRate,bridgeLoanLoanToPurchasePrice,bridgeLoanLoanToCost` - **Long-term Terms**: `longTermRateAndTermInterestRate,longTermCashOutInterestRate` - **Fees**: `originationPoints,loanProcessingFee` - **Custom Selection**: Any combination of available columns ## Available Columns ### Basic Information - `lid`: Lender ID - `name`: Lender name - `organizationId`: Organization ID ### Bridge Loan Terms - `bridgeLoanLoanToPurchasePrice`: Purchase price ratio - `bridgeLoanLoanToRefinanceCost`: Refinance cost ratio - `bridgeLoanInterestRate`: Bridge loan interest rate - `bridgeLoanLoanToCost`: Total cost ratio - `bridgeLoanLoanToAsIs`: As-is value ratio - `bridgeLoanLoanToArv`: After-repair value ratio ### Long-term Loan Terms - `longTermRateAndTermInterestRate`: Rate and term interest rate - `longTermCashOutInterestRate`: Cash-out interest rate - `longTermRateAndTermLoanToValue`: Rate and term LTV ratio - `longTermCashOutLoanToValue`: Cash-out LTV ratio ### Fees and Costs - `originationPoints`: Origination points percentage - `loanProcessingFee`: Processing fee amount ## Access Control - **Organization Scope**: Lender must belong to the user\'s organization - **Column Validation**: Invalid column names are ignored - **Data Privacy**: Only authorized columns are returned ## Use Cases This endpoint is ideal for: - **Performance Optimization**: Retrieve only needed data to reduce bandwidth - **Specific Comparisons**: Get particular fields for lender comparison tables - **Integration**: Extract specific data points for external systems - **Custom Views**: Build interfaces with selective data display - **Mobile Optimization**: Minimize data transfer for mobile applications - **API Efficiency**: Reduce response size for better performance ## Performance Benefits - **Reduced Data Transfer**: Only requested columns are returned - **Faster Processing**: Less data processing on both server and client - **Network Efficiency**: Smaller response payloads - **Selective Queries**: Database queries target only required fields - **Cache Optimization**: Smaller responses improve caching efficiency
* Get specific columns of a lender by lenderId
*/
async v4LendersControllerGetLenderColumnsV4(requestParameters, initOverrides) {
const response = await this.v4LendersControllerGetLenderColumnsV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/lenders/{lenderId} ## Overview Retrieves detailed information for a specific lender by its unique identifier. This endpoint returns complete lender data including all loan terms, fees, and lending criteria. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `lenderId` | number | Yes | The unique identifier of the lender to retrieve | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply column selection and formatting | ## Access Control - **Organization Scope**: Lender must belong to the authenticated user\'s organization - **Lender Validation**: Invalid or non-existent lender IDs will return a 404 error - **Data Privacy**: Only lenders within the user\'s organization are accessible ## Response Structure Returns a complete lender object with all available fields and loan terms. ## Use Cases This endpoint is ideal for: - **Lender Detail Views**: Display complete lender information in detail pages - **Loan Analysis**: Access all loan terms for detailed financial analysis - **Lender Comparison**: Retrieve specific lenders for side-by-side comparison - **Deal Evaluation**: Get lender details when evaluating financing options - **Integration Workflows**: Access complete lender data for external system sync - **Underwriting**: Use lender terms in property underwriting calculations ## Loan Terms Access The response includes comprehensive loan terms: - **Bridge Loan Parameters**: Short-term financing terms and ratios - **Long-term Loan Parameters**: Permanent financing terms and ratios - **Fee Structure**: All associated fees and points - **Risk Parameters**: Loan-to-value and loan-to-cost ratios - **Interest Rates**: Current rates for different loan products ## Performance Considerations - **Single Record Fetch**: Optimized for retrieving individual lenders - **Complete Data**: Returns all available lender fields and terms - **Real-time Data**: Always returns current lender information - **Organization Filtering**: Automatic organization scoping ensures security
* Get a specific lender by lenderId
*/
async v4LendersControllerGetLenderV4Raw(requestParameters, initOverrides) {
if (requestParameters['lenderId'] == null) {
throw new runtime.RequiredError('lenderId', 'Required parameter "lenderId" was null or undefined when calling v4LendersControllerGetLenderV4().');
}
const queryParameters = {};
if (requestParameters['viewId'] != null) {
queryParameters['viewId'] = requestParameters['viewId'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/lenders/{lenderId}`;
urlPath = urlPath.replace(`{${"lenderId"}}`, encodeURIComponent(String(requestParameters['lenderId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LendersGetLenderResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/lenders/{lenderId} ## Overview Retrieves detailed information for a specific lender by its unique identifier. This endpoint returns complete lender data including all loan terms, fees, and lending criteria. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `lenderId` | number | Yes | The unique identifier of the lender to retrieve | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply column selection and formatting | ## Access Control - **Organization Scope**: Lender must belong to the authenticated user\'s organization - **Lender Validation**: Invalid or non-existent lender IDs will return a 404 error - **Data Privacy**: Only lenders within the user\'s organization are accessible ## Response Structure Returns a complete lender object with all available fields and loan terms. ## Use Cases This endpoint is ideal for: - **Lender Detail Views**: Display complete lender information in detail pages - **Loan Analysis**: Access all loan terms for detailed financial analysis - **Lender Comparison**: Retrieve specific lenders for side-by-side comparison - **Deal Evaluation**: Get lender details when evaluating financing options - **Integration Workflows**: Access complete lender data for external system sync - **Underwriting**: Use lender terms in property underwriting calculations ## Loan Terms Access The response includes comprehensive loan terms: - **Bridge Loan Parameters**: Short-term financing terms and ratios - **Long-term Loan Parameters**: Permanent financing terms and ratios - **Fee Structure**: All associated fees and points - **Risk Parameters**: Loan-to-value and loan-to-cost ratios - **Interest Rates**: Current rates for different loan products ## Performance Considerations - **Single Record Fetch**: Optimized for retrieving individual lenders - **Complete Data**: Returns all available lender fields and terms - **Real-time Data**: Always returns current lender information - **Organization Filtering**: Automatic organization scoping ensures security
* Get a specific lender by lenderId
*/
async v4LendersControllerGetLenderV4(requestParameters, initOverrides) {
const response = await this.v4LendersControllerGetLenderV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/lenders/viewId/{viewId} ## Overview Retrieves lenders filtered by a specific view configuration. This endpoint applies view-defined filters, sorts, and column selections to provide a customized dataset of lenders. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | Yes | The unique identifier of the view to apply | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of lenders to return (default: 20, max: 100) | | `offset` | number | No | Number of lenders to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of lenders without the actual data | ## View Application The specified view configuration is applied automatically: - **Filters**: All view filters are applied to narrow the lender dataset - **Sorts**: View sort criteria determine the order of returned lenders - **Columns**: View column selection determines which fields are returned - **Relationships**: Related data inclusion based on view configuration ## Access Control - **Organization Scope**: Lenders are filtered by the user\'s organization - **View Ownership**: View must belong to the requesting user - **Data Privacy**: Only organization lenders are accessible through views ## Response Structure Returns lenders that match the specified view configuration. ## Use Cases This endpoint is ideal for: - **Custom Dashboards**: Display lenders according to predefined views - **Filtered Reports**: Generate reports with specific lender criteria - **Saved Searches**: Retrieve lenders using saved filter combinations - **User Preferences**: Apply user-defined lender viewing preferences - **Specialized Views**: Access lenders for specific loan types or criteria ## View Consistency - **Reproducible Results**: Same view ID produces consistent results - **Filter Persistence**: View filters remain constant across requests - **Sort Stability**: View sorting provides predictable ordering - **Column Consistency**: Same columns returned for each request ## Performance Benefits - **Optimized Queries**: View-specific optimizations improve performance - **Cached Configurations**: View settings are cached for faster execution - **Reduced Overhead**: Only requested columns are processed and returned - **Efficient Filtering**: Database-level filtering reduces data transfer
* Get lenders with a specific viewId
*/
async v4LendersControllerGetLendersInViewV4Raw(requestParameters, initOverrides) {
if (requestParameters['viewId'] == null) {
throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4LendersControllerGetLendersInViewV4().');
}
const queryParameters = {};
if (requestParameters['limit'] != null) {
queryParameters['limit'] = requestParameters['limit'];
}
if (requestParameters['offset'] != null) {
queryParameters['offset'] = requestParameters['offset'];
}
if (requestParameters['countOnly'] != null) {
queryParameters['countOnly'] = requestParameters['countOnly'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/lenders/viewId/{viewId}`;
urlPath = urlPath.replace(`{${"viewId"}}`, encodeURIComponent(String(requestParameters['viewId'])));
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LendersGetLendersInViewResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/lenders/viewId/{viewId} ## Overview Retrieves lenders filtered by a specific view configuration. This endpoint applies view-defined filters, sorts, and column selections to provide a customized dataset of lenders. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | Yes | The unique identifier of the view to apply | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of lenders to return (default: 20, max: 100) | | `offset` | number | No | Number of lenders to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of lenders without the actual data | ## View Application The specified view configuration is applied automatically: - **Filters**: All view filters are applied to narrow the lender dataset - **Sorts**: View sort criteria determine the order of returned lenders - **Columns**: View column selection determines which fields are returned - **Relationships**: Related data inclusion based on view configuration ## Access Control - **Organization Scope**: Lenders are filtered by the user\'s organization - **View Ownership**: View must belong to the requesting user - **Data Privacy**: Only organization lenders are accessible through views ## Response Structure Returns lenders that match the specified view configuration. ## Use Cases This endpoint is ideal for: - **Custom Dashboards**: Display lenders according to predefined views - **Filtered Reports**: Generate reports with specific lender criteria - **Saved Searches**: Retrieve lenders using saved filter combinations - **User Preferences**: Apply user-defined lender viewing preferences - **Specialized Views**: Access lenders for specific loan types or criteria ## View Consistency - **Reproducible Results**: Same view ID produces consistent results - **Filter Persistence**: View filters remain constant across requests - **Sort Stability**: View sorting provides predictable ordering - **Column Consistency**: Same columns returned for each request ## Performance Benefits - **Optimized Queries**: View-specific optimizations improve performance - **Cached Configurations**: View settings are cached for faster execution - **Reduced Overhead**: Only requested columns are processed and returned - **Efficient Filtering**: Database-level filtering reduces data transfer
* Get lenders with a specific viewId
*/
async v4LendersControllerGetLendersInViewV4(requestParameters, initOverrides) {
const response = await this.v4LendersControllerGetLendersInViewV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # GET /v4/lenders ## Overview Retrieves a list of lenders with optional filtering, sorting, and pagination capabilities. This endpoint provides access to lender information including loan terms, fees, and other lending criteria. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply filters and column selection | | `limit` | number | No | Maximum number of lenders to return (default: 20, max: 100) | | `offset` | number | No | Number of lenders to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of lenders without the actual data | ## Access Control - **Organization Scope**: Lenders are filtered by the user\'s organization - **Data Privacy**: Only lenders within the organization are accessible - **Permission**: User must have lender read permissions ## View Integration When a `viewId` is provided: - **Filters**: All view filters are applied to narrow the lender dataset - **Sorts**: View sort criteria determine the order of returned lenders - **Columns**: View column selection determines which fields are returned - **Consistent Results**: Same view produces consistent response structure ## Response Structure Returns a paginated list of lenders matching the specified criteria. ## Use Cases This endpoint is ideal for: - **Lender Management**: Building lender listing interfaces and dashboards - **Loan Comparison**: Comparing different lenders and their terms - **Integration**: Syncing lender data with external systems - **Reporting**: Generating lender analytics and reports - **Selection**: Choosing appropriate lenders for specific properties or deals ## Pagination - **Default Limit**: 20 lenders per request - **Maximum Limit**: 100 lenders per request - **Offset-based**: Use offset for pagination through large datasets - **Count**: Total count provided for pagination calculations ## Performance Considerations - **Optimized Queries**: Database queries are optimized for organization filtering - **View Caching**: View configurations are cached for improved performance - **Index Usage**: Queries utilize database indexes for fast retrieval - **Response Size**: Use limit parameter to control response size
* Get lenders with optional viewId
*/
async v4LendersControllerGetLendersV4Raw(requestParameters, initOverrides) {
const queryParameters = {};
if (requestParameters['viewId'] != null) {
queryParameters['viewId'] = requestParameters['viewId'];
}
if (requestParameters['limit'] != null) {
queryParameters['limit'] = requestParameters['limit'];
}
if (requestParameters['offset'] != null) {
queryParameters['offset'] = requestParameters['offset'];
}
if (requestParameters['countOnly'] != null) {
queryParameters['countOnly'] = requestParameters['countOnly'];
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication
}
let urlPath = `/v4/lenders`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => V4LendersGetLendersResponseDtoFromJSON(jsonValue));
}
/**
* # GET /v4/lenders ## Overview Retrieves a list of lenders with optional filtering, sorting, and pagination capabilities. This endpoint provides access to lender information including loan terms, fees, and other lending criteria. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply filters and column selection | | `limit` | number | No | Maximum number of lenders to return (default: 20, max: 100) | | `offset` | number | No | Number of lenders to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of lenders without the actual data | ## Access Control - **Organization Scope**: Lenders are filtered by the user\'s organization - **Data Privacy**: Only lenders within the organization are accessible - **Permission**: User must have lender read permissions ## View Integration When a `viewId` is provided: - **Filters**: All view filters are applied to narrow the lender dataset - **Sorts**: View sort criteria determine the order of returned lenders - **Columns**: View column selection determines which fields are returned - **Consistent Results**: Same view produces consistent response structure ## Response Structure Returns a paginated list of lenders matching the specified criteria. ## Use Cases This endpoint is ideal for: - **Lender Management**: Building lender listing interfaces and dashboards - **Loan Comparison**: Comparing different lenders and their terms - **Integration**: Syncing lender data with external systems - **Reporting**: Generating lender analytics and reports - **Selection**: Choosing appropriate lenders for specific properties or deals ## Pagination - **Default Limit**: 20 lenders per request - **Maximum Limit**: 100 lenders per request - **Offset-based**: Use offset for pagination through large datasets - **Count**: Total count provided for pagination calculations ## Performance Considerations - **Optimized Queries**: Database queries are optimized for organization filtering - **View Caching**: View configurations are cached for improved performance - **Index Usage**: Queries utilize database indexes for fast retrieval - **Response Size**: Use limit parameter to control response size
* Get lenders with optional viewId
*/
async v4LendersControllerGetLendersV4(requestParameters = {}, initOverrides) {
const response = await this.v4LendersControllerGetLendersV4Raw(requestParameters, initOverrides);
return await response.value();
}
/**
* # PATCH /v4/lenders/{lenderId} ## Overview Updates an existing lender with the provided information. This endpoint allows partial updates, meaning you only need to include the fields you want to change. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `lenderId` | number | Yes | The unique identifier of the lender to update | ## Request Body The request body should contain only the fields you want to update. All fields are optional for updates. ### Updateable Fields | Field | Type | Description | |-------|------|-------------| | `name` | string | Lender company name (must be unique within organization) | | `bridgeLoanLoanToPurchasePrice` | number | Bridge loan to purchase price ratio (decimal) | | `bridgeLoanLoanToRefinanceCost` | number | Bridge loan to refinance cost ratio (decimal) | | `bridgeLoanInterestRate` | number | Bridge loan annual interest rate (decimal) | | `longTermRateAndTermInterestRate` | number | Long-term rate and term interest rate (decimal) | | `longTermCashOutInterestRate` | number | Long-term cash-out interest rate (decimal) | | `longTermRateAndTermLoanToValue` | number | Long-term rate and term LTV ratio (decimal) | | `longTermCashOutLoanToValue` | number | Long-term cash-out LTV ratio (decimal) | | `bridgeLoanLoanToCost` | number | Bridge loan to total cost ratio (decimal) | | `bridgeLoanLoanToAsIs` | number | Bridge loan to as-is value ratio (decimal) | | `bridgeLoanLoanToArv` | number | Bridge loan to ARV ratio (decimal) | | `originationPoints` | number | Origination points percentage (decimal) | | `loanProcessingFee` | number | Loan processing fee in