> For the complete documentation index, see [llms.txt](https://api-docs.hengelending.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.hengelending.com/mcp/tool-reference/pricing-locks-and-fees.md). Agents can also search and read this documentation through its [MCP server](https://api-docs.hengelending.com/~gitbook/mcp).

# Pricing, locks and fees

Pricing searches, share links, rate locks, program registration and a loan's fees.

{% hint style="info" %}
Generated from the MCP server's code. Do not edit this page in GitBook: changes are overwritten on the next sync.
{% endhint %}

## add\_loan\_application\_fee

Add a closing cost fee to a Henge loan application in the LOS. Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID. Give the feeTypeId from get\_loan\_fee\_types (the fee type sets the section and payee), the amount, and optionally a description, who pays (default Borrower) and when (default AtClosing). A retried add creates a SECOND fee: the LOS has no way to tell a retry apart, so never repeat a call that may have succeeded; check get\_loan\_application\_fees first. Admin and Processor only. This WRITES TO THE LOAN ORIGINATION SYSTEM and changes the loan's closing costs, cash to close and disclosures. Call it with dryRun true first, show the caller the before and after, and write only after they explicitly confirm. Returns the fee before and after as the LOS holds it, read back after the save, with the section and loan totals before and after. The LOS can accept a save and quietly not keep a field: any such field is listed in notKept, and you must tell the caller.

**Who can call it:** Admin, Processor

**Reads or writes:** writes

| Input                      | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| -------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `feeTypeId`                | string          | REQUIRED. The closingCostFeeTypeId of the fee to add, from get\_loan\_fee\_types on the same loan. The fee type decides the section and payee.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `description`              | string          | The fee's name on the loan. Omit to use the fee type's own description.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `amount`                   | number          | REQUIRED unless payments is given. The fee amount in dollars, e.g. 125.00.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `paidBy`                   | string          | Who pays: Borrower (default), BorrowerFinanced, Seller, Lender, Broker or Other. One of `Borrower`, `Seller`, `BorrowerFinanced`, `Lender`, `Broker`, `Other`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `paymentTiming`            | string          | When it is paid: AtClosing (default) or OutsideOfClosing (paid before closing, POC). One of `Unknown`, `AtClosing`, `OutsideOfClosing`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `payments`                 | array of object | Several payments for the fee, e.g. a Borrower share and a Seller share. When given they replace paidBy and paymentTiming, and amount may be left out (it is their sum) or must equal the sum. The LOS may add a system payment for any part no payment covers. Omit for one payment of the whole amount.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `payments[].paidBy`        | string          | REQUIRED. Who pays this share: Borrower, BorrowerFinanced, Seller, Lender, Broker or Other. One of `Borrower`, `Seller`, `BorrowerFinanced`, `Lender`, `Broker`, `Other`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `payments[].amount`        | number          | REQUIRED. This payment's share of the fee in dollars and cents, above zero, e.g. 400.00.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `payments[].paymentTiming` | string          | When this share is paid: AtClosing (default) or OutsideOfClosing. One of `Unknown`, `AtClosing`, `OutsideOfClosing`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `payeeRole`                | string          | Who the fee is paid to, as a contact role (Beneficiary), e.g. Title, Appraiser, Escrow. Once the loan has a contact with that role the LOS fills the payee's name from it. Omit to use the fee type's payee. One of `Other`, `Appraiser`, `Escrow`, `CreditReport`, `Title`, `MortgageInsurance`, `ListingAgent`, `SellingAgent`, `Builder`, `Underwriter`, `Investor`, `Servicing`, `BuyerAttorney`, `SellerAttorney`, `HomeOwnerInsurance`, `HazardInsurance`, `MarketingLead`, `Seller`, `Surveyor`, `LoanOfficer`, `Bank`, `Lender`, `Processor`, `CallCenterAgent`, `LoanOpener`, `Manager`, `Broker`, `BrokerRep`, `ECOA`, `Realtor`, `Mortgagee`, `HomeOwnerAssociation`, `BuyerAgent`, `ClosingAgent`, `FairHousingLending`, `HomeInspection`, `FloodProvider`, `CreditReportAgency2`, `CreditReportAgency3`, `Shipper`, `BrokerProcessor`, `Trustee`, `Funder`, `PostCloser`, `Insuring`, `CollateralAgent`, `DocDrawer`, `PropertyManagement`, `TitleUnderwriter`, `CreditAuditor`, `DisclosureDesk`, `JuniorProcessor`, `JuniorUnderwriter`, `LegalAuditor`, `LoanOfficerAssistant`, `Purchaser`, `QCCompliance`, `Secondary`, `PestInspection`, `Subservicer`, `ExternalSecondary`, `ExternalPostCloser`, `LoanPurchasePayee`, `AppraisalManagementCompany`, `Referral`, `Notary`, `TaxServicer`, `SupervisoryAppraiser`, `Attorney`, `PropertyInspector`, `CPATaxPreparer`, `LockDesk`, `MortgageServiceOrganization`, `Verifications`, `TaxCollector`, `TaxTranscripts`. |
| `dryRun`                   | boolean         | true to validate and preview the fee, section total and loan total without writing anything. Use it first and show the caller the result.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `externalId`               | string          | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanApplicationId`        | string (uuid)   | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

## break\_investor\_lock

Break a loan's back-end (investor) rate lock in the LOS (the LOS's breakinvestorratelock). THIS WRITES TO THE LIVE LOS: the investor lock status goes back to Not Locked, the lock date is cleared and the price is kept. CONFIRM WITH THE USER BEFORE CALLING, and send the reason they give: it is required and the LOS keeps it on the break event. Identify the loan by its MLM ExternalId (preferred) or internal GUID; it must already be in the LOS. Returns the investor lock as read back from the LOS. Restricted to Admin and Processor. An entry with the reason is written to the loan's activity log.

**Who can call it:** Admin, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `reason`            | string        | Why the lock is broken. Required; the LOS keeps it on the break event.                                                                                                                                                                                                                             |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## break\_rate\_lock

Break a loan's front-end rate lock in the LOS (the LOS's breakratelock). THIS WRITES TO THE LIVE LOS: the lock status goes back to Not Locked and a break event is added to the lock history. CONFIRM WITH THE USER BEFORE CALLING, and send the reason they give: it is required and the LOS keeps it on the break event. Identify the loan by its MLM ExternalId (preferred) or internal GUID; it must already be in the LOS. Returns the lock as read back from the LOS, price grid included. Restricted to Admin and Processor. An entry with the reason is written to the loan's activity log.

**Who can call it:** Admin, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `reason`            | string        | Why the lock is broken. Required; the LOS keeps it on the break event.                                                                                                                                                                                                                             |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## cancel\_rate\_lock\_request

Cancel the pending lock request on a loan's registration - the app's 'Cancel Lock Request'. Take scenarioId from get\_loan\_registration (its status is 'Lock Requested'). This WRITES data and notifies people: the scenario returns to ReadyToLock with every quote unlocked and unarchived, the loan's 'Select Quote to Lock' task goes back to Requested, the loan officer, their ConciergeKey, the processing team and the borrowers are emailed, and a lock-request-update PDF is filed to the loan vault. Only a LockRequested scenario qualifies. Confirm with the user before calling.

**Who can call it:** Admin, ConciergeKey, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input        | Type          | Description                                                             |
| ------------ | ------------- | ----------------------------------------------------------------------- |
| `scenarioId` | string (uuid) | REQUIRED. The pricing scenario id (GUID), from get\_loan\_registration. |

## confirm\_loan\_fee\_matches

Save the fee type the caller confirms for each line of a LodeStar preview, as the company's mapping, so the next estimate matches those lines. Writes nothing to the LOS. Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID; it must be in the LOS. Give the previewId from preview\_loan\_fee\_estimate and, per line, its sourceRef and the closingCostFeeTypeId (from get\_loan\_fee\_types) the caller confirms. Only confirm what the caller has chosen or accepted. Admin and Processor only.

**Who can call it:** Admin, Processor

**Reads or writes:** writes

**Availability:** only where the `lodestar-fee-estimates` release flag is on for the caller.

| Input                 | Type            | Description                                                                                                                                                                                                                                                                                        |
| --------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `previewId`           | string (uuid)   | REQUIRED. The previewId from preview\_loan\_fee\_estimate.                                                                                                                                                                                                                                         |
| `choices`             | array of object | REQUIRED. The lines and the fee type the caller confirms for each.                                                                                                                                                                                                                                 |
| `choices[].sourceRef` | string          | REQUIRED. The preview line's sourceRef.                                                                                                                                                                                                                                                            |
| `choices[].feeTypeId` | string          | REQUIRED. The closingCostFeeTypeId the caller confirms the line is.                                                                                                                                                                                                                                |
| `externalId`          | string          | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId`   | string (uuid)   | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## create\_pricing\_share\_link

Make a short link to live pricing that you can pass on. It holds the search criteria, not prices: a signed-in staff user who opens it lands on Pricing Search with the search run, anyone else gets the simple quote page, priced live under the loan officer, and every opening re-prices. Nothing is saved but the short code. Give it search\_pricing's criteria (borrowerInformation, propertyInformation, loanInformation, qmInformation), or a loanApplicationId or externalId (the criteria are then the loan's pricing request as search\_pricing builds it, plus any loanOverrides; the loan must be priceable, so a missing required input is refused as it is there). The link prices under agentId, a user you may price for; without it, under you when you are an Agent or DualLicensedAgent, else the loan's loan officer when you give a loan, else the call is refused and asks for agentId. Returns shortUrl (the link to send), longUrl, the loan officer's id and name, and a line to pass on with it. Hand the shortUrl on as is.

**Who can call it:** Admin, Processor, DualLicensedAgent, ConciergeKey, Agent

**Reads or writes:** writes

**Availability:** only where the `pricing-share-link` release flag is on for the caller.

| Input                                                                    | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------------------------------------------------ | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `agentId`                                                                | string (uuid)   | Henge user ID (GUID) of the loan officer the link prices under, from search\_users. Optional: without it the link prices under you when you are an Agent or DualLicensedAgent, else under the loan's loan officer.                                                                                                                                                                                                                                                                                                                                               |
| `loanApplicationId`                                                      | string (uuid)   | Henge loan application ID (GUID) whose pricing request is shared. Use this or externalId. With a loan the criteria objects are ignored; pass changes in loanOverrides.                                                                                                                                                                                                                                                                                                                                                                                           |
| `externalId`                                                             | string          | MLM loan ExternalId whose pricing request is shared; preferred over loanApplicationId when both are given.                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanOverrides`                                                          | object          | Only with a loan: criteria that win over the loan's values (for example desiredLockPeriod, loanTerms). Anything left out comes from the loan.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `loanOverrides.loanAmount`                                               | number          | Base loan amount in USD. Overrides the loan's amount.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanOverrides.propertyValue`                                            | number          | Property value in USD, used as appraised value and sales price. Overrides the loan's appraised value / purchase price.                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanOverrides.ficoScore`                                                | integer         | Representative FICO score (300-850). Overrides the loan's credit score.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `loanOverrides.loanType`                                                 | string          | Loan type. Overrides the loan's loan type. One of `Conforming`, `NonConforming`, `FHA`, `VA`, `Conventional`, `HELOC`, `USDARuralHousing`.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanOverrides.loanPurpose`                                              | string          | Loan purpose. Overrides the loan's purpose. One of `Purchase`, `RefiCashout`, `RefiRateTermLimitedCO`, `FHAStreamlineRefi`, `VARateReduction`, `SimpleRefinance`.                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanOverrides.cashOutAmount`                                            | number          | Cash-out amount in USD (refinance).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanOverrides.occupancy`                                                | string          | Occupancy. Overrides the loan's occupancy. One of `InvestmentProperty`, `PrimaryResidence`, `SecondHome`.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanOverrides.propertyType`                                             | string          | Property type. Overrides the loan's property type. One of `SingleFamily`, `Condo`, `ManufacturedDoubleWide`, `Condotel`, `Modular`, `PUD`, `Timeshare`, `ManufacturedSingleWide`, `Coop`, `NonWarrantableCondo`, `Townhouse`, `DetachedCondo`.                                                                                                                                                                                                                                                                                                                   |
| `loanOverrides.numberOfUnits`                                            | string          | Number of dwelling units: OneUnit, TwoUnits, ThreeUnits, FourUnits, or a count of 5 or more such as "6". Overrides the loan's unit count.                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanOverrides.state`                                                    | string          | Property state (two-letter US code). Overrides the subject property's state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanOverrides.zipCode`                                                  | string          | Property ZIP code. Overrides the subject property's ZIP code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `loanOverrides.county`                                                   | string          | Property county. When absent it is looked up from the property state and ZIP code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanOverrides.citizenship`                                              | string          | Borrower citizenship. Overrides the primary borrower's citizenship. One of `USCitizen`, `USCitizenAbroad`, `PermResidentAlien`, `NonPermResidentAlien`, `ForeignNational`.                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanOverrides.debtToIncomeRatio`                                        | number          | DTI percent (25 = 25%). Overrides the loan's qualifying back-end ratio.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `loanOverrides.monthsReserves`                                           | integer         | Months of post-closing reserves.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `loanOverrides.waiveEscrows`                                             | boolean         | Whether escrows are waived. Overrides the loan's escrow waiver.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanOverrides.selfEmployed`                                             | boolean         | Whether a borrower is self-employed. Overrides what the loan's employment says.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanOverrides.firstTimeHomeBuyer`                                       | boolean         | Whether the borrower is a first-time home buyer. Overrides the loan's declarations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanOverrides.interestOnly`                                             | boolean         | Whether to price interest-only products. A loan is priced without them when absent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanOverrides.includeLoCompensationInPricing`                           | string          | Who pays the loan officer's compensation: YesLenderPaid (lender paid, in the price; what a loan is priced with when absent) or NoBuyerPaid (borrower paid, left out of the price). One of `YesLenderPaid`, `NoBuyerPaid`, `NoLenderPaid`.                                                                                                                                                                                                                                                                                                                        |
| `loanOverrides.loanTerms`                                                | array of string | Loan terms to price. Overrides the loan's term.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanOverrides.amortizationTypes`                                        | array of string | Amortization types to price. Overrides the loan's amortization type.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanOverrides.armFixedTerms`                                            | array of string | ARM fixed periods to price when amortizationTypes contains ARM.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanOverrides.productTypes`                                             | array of string | Product categories to include. \[StandardProducts] when absent; non-QM uses \[ExpandedGuidelines].                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanOverrides.desiredLockPeriod`                                        | integer         | Desired lock period in days. Overrides the loan's lock period.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `loanOverrides.desiredPrice`                                             | number          | Desired price (par = 100).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanOverrides.desiredRate`                                              | number          | Target interest rate. 0 returns all eligible rates.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanOverrides.includeGuidelines`                                        | boolean         | If true, include per-product eligibility guidelines.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `borrowerInformation`                                                    | object          | Borrower-side pricing criteria.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `borrowerInformation.citizenship`                                        | string          | Borrower citizenship status. One of `USCitizen`, `USCitizenAbroad`, `PermResidentAlien`, `NonPermResidentAlien`, `ForeignNational`.                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `borrowerInformation.ficoScore`                                          | integer         | Representative FICO score (300-850).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `borrowerInformation.firstTimeHomeBuyer`                                 | boolean         | Set true on purchases to surface FTHB products and reduced MIP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `borrowerInformation.selfEmployed`                                       | boolean         | True if the borrower is self-employed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `borrowerInformation.monthsReserves`                                     | integer         | Months of post-closing reserves.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `borrowerInformation.typeOfVeteran`                                      | string          | Required for VA loans; ignored otherwise. One of `ActiveDuty`, `NationalGuardOrReserves`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `borrowerInformation.vaFirstTimeUse`                                     | boolean         | VA only. First use of VA entitlement (affects funding fee).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `borrowerInformation.waiveEscrows`                                       | boolean         | Whether escrows are waived.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `borrowerInformation.state`                                              | string          | Borrower mailing-address state (two-letter code), distinct from the property state. Optional.                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `borrowerInformation.firstName`                                          | string          | Optional borrower first name; not used for eligibility.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `borrowerInformation.lastName`                                           | string          | Optional borrower last name; not used for eligibility.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `propertyInformation`                                                    | object          | Property-side pricing criteria.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `propertyInformation.propertyValue`                                      | number          | Property value in USD. Used as appraised value and sales price unless overridden.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `propertyInformation.appraisedValue`                                     | number          | Appraised value in USD. Overrides propertyValue for refinance LTV.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `propertyInformation.salesPrice`                                         | number          | Sales price in USD. Overrides propertyValue for purchase LTV.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `propertyInformation.state`                                              | string          | Property state (two-letter US code).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `propertyInformation.county`                                             | string          | Property county (must match the state), without the word 'County'. Omit to have it derived from zipCode.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `propertyInformation.zipCode`                                            | string          | Property ZIP code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `propertyInformation.propertyType`                                       | string          | Property type. One of `SingleFamily`, `Condo`, `ManufacturedDoubleWide`, `Condotel`, `Modular`, `PUD`, `Timeshare`, `ManufacturedSingleWide`, `Coop`, `NonWarrantableCondo`, `Townhouse`, `DetachedCondo`.                                                                                                                                                                                                                                                                                                                                                       |
| `propertyInformation.occupancy`                                          | string          | Occupancy type. One of `InvestmentProperty`, `PrimaryResidence`, `SecondHome`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `propertyInformation.numberOfUnits`                                      | string          | Number of dwelling units: OneUnit, TwoUnits, ThreeUnits, FourUnits, or a count of 5 or more such as "6".                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `propertyInformation.corporateRelocation`                                | boolean         | True if the borrower is being relocated by their employer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `propertyInformation.numberOfStories`                                    | integer         | Number of stories.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `propertyInformation.propertyStreetAddress`                              | string          | Optional street address; not used for eligibility.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `propertyInformation.city`                                               | string          | Optional city; not used for eligibility.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation`                                                        | object          | Loan-side pricing criteria.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `loanInformation.loanType`                                               | string          | Loan type. Drives the product set. One of `Conforming`, `NonConforming`, `FHA`, `VA`, `Conventional`, `HELOC`, `USDARuralHousing`.                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanInformation.loanPurpose`                                            | string          | Loan purpose. One of `Purchase`, `RefiCashout`, `RefiRateTermLimitedCO`, `FHAStreamlineRefi`, `VARateReduction`, `SimpleRefinance`.                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanInformation.loanAmount`                                             | number          | Base loan amount in USD, excluding financed fees and MIP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanInformation.cashOutAmount`                                          | number          | Cash-out amount in USD (refinance).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanInformation.secondLienAmount`                                       | number          | Second lien amount in USD. Affects CLTV.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation.helocDrawnAmount`                                       | number          | HELOC drawn amount in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanInformation.helocLineAmount`                                        | number          | HELOC line (limit) amount in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanInformation.productTypes`                                           | array of string | Product categories to include. Most scenarios use \[StandardProducts]; non-QM uses \[ExpandedGuidelines].                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanInformation.amortizationTypes`                                      | array of string | Amortization types. Conventional typically \[Fixed, ARM]; FHA/VA/USDA typically \[Fixed].                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanInformation.loanTerms`                                              | array of string | Loan terms to include.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanInformation.armFixedTerms`                                          | array of string | REQUIRED when amortizationTypes contains ARM; defaults to \[FiveYear, SevenYear, TenYear]. Ignored otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `loanInformation.desiredRate`                                            | number          | Target interest rate. 0 returns all eligible rates.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanInformation.desiredLockPeriod`                                      | integer         | Desired lock period in days.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanInformation.desiredPrice`                                           | number          | Desired price (par = 100).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanInformation.constructionLoanType`                                   | string          | Construction loan type. One of `NotApplicable`, `Construction`, `ConstructionToPerm`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanInformation.exemptFromVAFundingFee`                                 | boolean         | VA only. True for veterans with a service-connected disability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanInformation.debtToIncomeRatio`                                      | number          | DTI percent (25 = 25%).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `loanInformation.interestOnly`                                           | boolean         | Include interest-only products.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanInformation.propertiesFinanced`                                     | integer         | Number of properties the borrower already finances.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanInformation.lienType`                                               | string          | Lien position. One of `First`, `Second`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation.automatedUnderwritingSystem`                            | string          | AUS to score against. One of `DU`, `LP`, `NotSpecified`, `InvestorAUS`, `ManualTraditional`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanInformation.borrowerPaidMi`                                         | string          | Whether the borrower pays mortgage insurance. One of `Yes`, `No`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanInformation.buydown`                                                | string          | Buydown structure. One of `None`, `ThreeTwoOne`, `TwoOne`, `OneZero`, `OneOne`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanInformation.buydownContributorType`                                 | string          | Who funds the buydown: Lender, Borrower, Seller, Builder or OtherInterestedThirdParty. Optional; only accepted with a buydown other than None. Omit to send nothing.                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.expandedApprovalLevel`                                  | string          | Expanded approval level (FHA). One of `NotApplicable`, `LevelOne`, `LevelTwo`, `LevelThree`, `LevelFour`, `LevelFive`.                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanInformation.prepaymentPenalty`                                      | string          | Prepayment penalty duration (non-QM). One of `None`, `OneYear`, `TwoYear`, `ThreeYear`, `FourYear`, `FiveYear`.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanInformation.includeLoCompensationInPricing`                         | string          | How LO compensation flows into pricing. One of `YesLenderPaid`, `NoBuyerPaid`, `NoLenderPaid`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `loanInformation.assetDepletion`                                         | string          | Asset depletion income method. One of `Yes`, `No`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanInformation.autoDebit`                                              | string          | Automatic payment debit. One of `Yes`, `No`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanInformation.employeeLoan`                                           | string          | Employee / internal loan. One of `Yes`, `No`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `loanInformation.communityAffordableSecond`                              | string          | Community Affordable Second attached. One of `Yes`, `No`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanInformation.calculateTotalLoanAmount`                               | boolean         | Auto-calculate the total loan amount. When false, totalLoanAmountDetails applies.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanInformation.totalLoanAmountDetails`                                 | object          | Optional total-loan override. Only honored when calculateTotalLoanAmount is false.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanInformation.totalLoanAmountDetails.totalLoanAmount`                 | number          | Explicit total loan amount in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanInformation.totalLoanAmountDetails.upfrontPmiMipFfGfPercent`        | number          | Upfront PMI/MIP/FF/GF percent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `loanInformation.totalLoanAmountDetails.upfrontPmiMipFfGfAmount`         | number          | Upfront PMI/MIP/FF/GF amount in USD (alternative to the percent).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanInformation.totalLoanAmountDetails.upfrontPmiMipFfGfPaidinCash`     | number          | Portion paid in cash at closing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `loanInformation.totalLoanAmountDetails.upfrontPmiMipFfGfFinancedAmount` | number          | Portion financed into the loan.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanInformation.expandedGuidelines`                                     | object          | Non-QM / Expanded Guidelines eligibility criteria.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanInformation.expandedGuidelines.incomeVerificationType`              | string          | Income documentation type. One of `FullDoc`, `PersonalBankStmt1Mo`, `PersonalBankStmt6Mos`, `PersonalBankStmt12Mos`, `PersonalBankStmt18Mos`, `PersonalBankStmt24Mos`, `BusinessBankStmt1Mo`, `BusinessBankStmt6Mos`, `BusinessBankStmt12Mos`, `BusinessBankStmt18Mos`, `BusinessBankStmt24Mos`, `OneYearAltDoc`, `AssetRelated`, `InvestorDscr`, `RestrictedStock`, `InvestorNoRatio`, `PersonalBankStmt3Mos`, `BusinessBankStmt3Mos`, `TwoYearAltDoc`, `WrittenVOE`, `Stated`, `OneYear1099`, `TwoYear1099`, `PLOneYear`, `PLTwoYear`, `NoIncomeVerification`. |
| `loanInformation.expandedGuidelines.housingEventType`                    | string          | Recent housing event. None when nothing to disclose. One of `None`, `DeedInLieu`, `Foreclosure`, `Modification`, `ShortSale`, `Forbearance`.                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanInformation.expandedGuidelines.housingEventSeasoning`               | string          | Required when housingEventType != None. One of `NotApplicable`, `Last1To12Months`, `Last13To24Months`, `Last25To36Months`, `Last37To48Months`, `Last49To60Months`, `MoreThanFiveYearsAgo`.                                                                                                                                                                                                                                                                                                                                                                       |
| `loanInformation.expandedGuidelines.bankruptcyType`                      | string          | Bankruptcy chapter, if any. One of `None`, `Chapter7`, `Chapter11`, `Chapter13`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `loanInformation.expandedGuidelines.bankruptcyOutcome`                   | string          | NotApplicable when bankruptcyType is None. One of `NotApplicable`, `Discharged`, `Dismissed`, `OpenOrPending`.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `loanInformation.expandedGuidelines.bankruptcySeasoning`                 | string          | Required when bankruptcyType != None. One of `NotApplicable`, `Last1To12Months`, `Last13To24Months`, `Last25To36Months`, `Last37To48Months`, `Last49To60Months`, `MoreThanFiveYearsAgo`.                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation.expandedGuidelines.debtServiceCoverageRatio`            | number          | DSCR for investor / non-QM products.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.expandedGuidelines.uniqueProperty`                      | boolean         | Unique property flag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanInformation.expandedGuidelines.debtConsolidation`                   | boolean         | Debt consolidation flag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation.expandedGuidelines.mortgageLates30In12Months`           | integer         | 30-day mortgage lates, last 12 months.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanInformation.expandedGuidelines.mortgageLates30In13To24Months`       | integer         | 30-day mortgage lates, months 13-24.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.expandedGuidelines.mortgageLates60In12Months`           | integer         | 60-day mortgage lates, last 12 months.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanInformation.expandedGuidelines.mortgageLates60In13To24Months`       | integer         | 60-day mortgage lates, months 13-24.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.expandedGuidelines.mortgageLates90In12Months`           | integer         | 90-day mortgage lates, last 12 months.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanInformation.expandedGuidelines.mortgageLates90In13To24Months`       | integer         | 90-day mortgage lates, months 13-24.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.expandedGuidelines.mortgageLates120In12Months`          | integer         | 120-day mortgage lates, last 12 months.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `loanInformation.expandedGuidelines.mortgageLates120In13To24Months`      | integer         | 120-day mortgage lates, months 13-24.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanInformation.firstLienAmount`                                        | number          | First-lien amount in USD when lienType=Second (drives CLTV). Leave null otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanInformation.feesIn`                                                 | string          | Yes = closing costs financed into the loan; No = paid at closing. One of `No`, `Yes`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanInformation.reducedMi`                                              | boolean         | True for reduced-MI products (HomeReady, Home Possible).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation.totalMonthlyQualifyingIncome`                           | number          | Total monthly qualifying income in USD across all borrowers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `qmInformation`                                                          | object          | Optional QM points-and-fees breakdown for APOR calculations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `qmInformation.refinancePrepaymentFeeAmount`                             | number          | Refinance prepayment fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `qmInformation.creditInsuranceFeeAmount`                                 | number          | Credit insurance fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `qmInformation.cashIncentiveDiscountAmount`                              | number          | Cash incentive / discount applied at closing in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `qmInformation.escrowTrusteeFeeAmount`                                   | number          | Escrow / trustee fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `qmInformation.propertyAssessmentFeeAmount`                              | number          | Property assessment fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `qmInformation.notaryCreditReportFeeAmount`                              | number          | Notary / credit report fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `qmInformation.documentPreparationFeeAmount`                             | number          | Document preparation fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `qmInformation.titleFeeAmount`                                           | number          | Title fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `qmInformation.borrowerPaidLoCompensation`                               | number          | Borrower-paid LO compensation in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `qmInformation.additionalQmFeesAffectApor`                               | boolean         | If true, additional QM fees count toward the APOR comparison.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `qmInformation.additionalQmFeeAmount`                                    | number          | Additional QM fees in USD beyond the itemized categories.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `qmInformation.financedPmi`                                              | number          | Financed PMI / MIP rolled into the loan, in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

## delete\_loan\_adjustment\_or\_proration

Delete ONE adjustment or proration from a loan in the LOS. THIS DELETES FROM THE LOAN ORIGINATION SYSTEM OF RECORD: read the lists with get\_loan\_adjustments\_and\_prorations, show the caller what will be deleted, and delete only after they explicitly confirm. Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID; the loan must be in the LOS. Send kind (Adjustment or Proration), recordId and reason, which is written to the loan's activity. The record is read first and its values are returned, so the delete can be undone by hand with save\_loan\_adjustment\_or\_proration. The result says deleted only when the record no longer reads back. Admin, Processor and ConciergeKey (a ConciergeKey only on the loans of the loan officers they manage) only.

**Who can call it:** Admin, Processor, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `kind`              | string        | REQUIRED. Which list the record is in: Adjustment or Proration. One of `Adjustment`, `Proration`.                                                                                                                                                                                                  |
| `recordId`          | string        | REQUIRED. The Id of the record to delete, from get\_loan\_adjustments\_and\_prorations.                                                                                                                                                                                                            |
| `reason`            | string        | REQUIRED. Why the record is deleted. It is written to the loan's activity.                                                                                                                                                                                                                         |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## delete\_loan\_application\_fee

Remove a closing cost fee from a Henge loan application in the LOS. Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID, and the fee by its feeId from get\_loan\_application\_fees. Admin and Processor only. This WRITES TO THE LOAN ORIGINATION SYSTEM and changes the loan's closing costs, cash to close and disclosures. Call it with dryRun true first, show the caller the before and after, and write only after they explicitly confirm. Returns the removed fee and the section and loan totals before and after.

**Who can call it:** Admin, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `feeId`             | string        | REQUIRED. The fee's feeId, from its lines in get\_loan\_application\_fees.                                                                                                                                                                                                                         |
| `dryRun`            | boolean       | true to preview the removal and the new totals without writing anything. Use it first and show the caller the result.                                                                                                                                                                              |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_ineligible\_products

List the mortgage products that were INELIGIBLE for a prior search\_pricing call, grouped by product type (e.g. "15 Year Fixed Conforming"). Each product shows only its name and the reason(s) it was rejected (e.g. LTV/DTI/loan-amount/state limits). Only call this when a prior search\_pricing returned no (or very few) eligible products, or when the user explicitly asks which products were ineligible or why — do not call it routinely after a successful search. By default each product type returns at most 50 products; totalProducts reports the full count and truncated flags that more exist — set includeAll=true to return everything (token-intensive). Provide the searchId from that search\_pricing result; if you get a session-expired error, run search\_pricing again for a fresh searchId.

**Who can call it:** Admin, Processor, DualLicensedAgent, ConciergeKey, Agent

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `commissionTier`    | string        | Loan officer commission tier (a commission percentage) that selects which pricing engine account to price under. Allowed: HalfPercent (0.50%), ThreeQuarterPercent (0.75%), OnePercent (1.00%), OneAndThreeQuarterPercent (1.75%). Honored only for Realfinity.AI.Api-originated calls; ignored for other callers. Use the same tier passed to search\_pricing. One of `HalfPercent`, `ThreeQuarterPercent`, `OnePercent`, `OneAndThreeQuarterPercent`. |
| `useAgentObAccount` | boolean       | If true, price under the agent's own pricing engine account (their configured channel and originator) instead of a commission-tier account. Honored only for Realfinity.AI.Api-originated calls; takes precedence over commissionTier. Use the same value passed to search\_pricing.                                                                                                                                                                    |
| `userId`            | string (uuid) | Henge user ID (GUID) that pricing should be routed through (the pricing agent). Obtain it from search\_users, or from a loan application's loan officer via get\_loan\_application. Defaults to the calling user when omitted.                                                                                                                                                                                                                          |
| `searchId`          | string        | REQUIRED. The searchId returned by a prior search\_pricing call. This is a transient pricing engine session token — if expired, call search\_pricing again to get a fresh one.                                                                                                                                                                                                                                                                          |
| `includeAll`        | boolean       | Optional, defaults to false. By default each product type returns at most 50 products (totalProducts still reports the full count, and truncated flags that more exist). Set to true to return ALL ineligible products in every type. WARNING: token-intensive — only use this when the default results are insufficient to explain the ineligibility.                                                                                                  |

## get\_loan\_adjustments\_and\_prorations

Read a loan's adjustments and prorations straight from the LOS, the system of record. Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID; the loan must be in the LOS. Returns adjustments (sAdjustmentList: description, amount, who pays and who is paid by the LOS's party codes, and the borrower and seller amounts the LOS works out) and prorations (sProrationList: description, amount, cash flow code, paid-through date, what each side pays the other and whether the LOS made it itself), each with the Id that save\_loan\_adjustment\_or\_proration and delete\_loan\_adjustment\_or\_proration take. Admin, Processor and ConciergeKey (a ConciergeKey only on the loans of the loan officers they manage) only.

**Who can call it:** Admin, Processor, ConciergeKey

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_application\_fees

Retrieve a Henge loan application's closing costs (the Loan Estimate / Closing Disclosure fees), grouped by TRID section (A origination, B services not shopped, C services shopped, E taxes and government fees, F prepaids, G escrow, H other) and, within each section, by who pays (Borrower, Seller, Lender, Other). Identify the loan by either its MLM ExternalId (preferred when the loan is in MLM) or its internal Henge GUID. Once the loan is in the LOS these are the LOS's fees, which are authoritative; before that they are the newest estimate, and isEstimate is true. Each line has its name, amount, payer, section, MISMO fee type, APR flag, whether it is financed and the payee, and for an LOS fee its feeId and paymentId, which update\_loan\_application\_fee and delete\_loan\_application\_fee take. An amount of null means the source did not send a readable one: say so, never treat it as zero. isCalculated is true for a fee the LOS calculates (prepaids, reserves, per-diem interest, aggregate adjustment): its amount cannot be set directly, and calculatedFrom lists the loan field ids to change instead with set\_loan\_los\_fields, each followed by its lock flag where it has one (send the flag as True with the field); an empty calculatedFrom means the inputs are not mapped yet, so search find\_los\_fields by the fee name. Broker compensation is shown to Admin and Processor only and otherwise left out, totals included. A loan with no fees returns an empty sections list.

**Who can call it:** Admin, Agent, Processor, ConciergeKey, DualLicensedAgent

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_fee\_estimate\_preview

Read the loan's latest STORED LodeStar closing cost estimate as a preview, with the same fields and matches as preview\_loan\_fee\_estimate. THIS MAKES NO LODESTAR CALL AND IS NOT BILLED: use it first, and whenever you need the preview again. Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID. Fails with Not found when no estimate has been requested yet; only then, and only when the caller wants a fresh quote, use preview\_loan\_fee\_estimate. Admin, Agent and Processor.

**Who can call it:** Admin, Agent, Processor

**Reads or writes:** reads only

**Availability:** only where the `lodestar-fee-estimates` release flag is on for the caller.

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_fee\_types

List the fee types a fee can be added from on a Henge loan application: the lending company's LOS fee type setup. Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID; the loan must be in the LOS. Each fee type has its closingCostFeeTypeId (what add\_loan\_application\_fee takes), description, loanEstimateSection (A to H), paidToType (the payee type), mismoType and APR flag. Admin and Processor only.

**Who can call it:** Admin, Processor

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_loan\_registration

Return a loan's program registration (open on every company's loan, not only a TPO's): isTpoLoan, isRegistrationOpen; the current registration if any (scenarioId, election Float or Lock, status Floating or Lock Requested, investor, productName, productId, rate, price, lockPeriod, who registered it and when); the lock as MLM reports it (lockStatus, lockExpirationDate); on a locked loan with a kept rate sheet (behind the lock-ladder release flag) ladder: the rows of the locked lock period, each with quoteId, rate, price, points, principalAndInterest, apr, monthlyMi (monthly mortgage insurance, dollars) and discountDollar / rebateDollar (the buydown cost or rebate credit, dollars), the selected row and the moves after the lock, with the source lock detail withheld and the investor withheld when the caller is not given it, absent when the loan has no kept sheet or the flag is off (to ask for another row use request\_locked\_rate\_row); on a floating loan with a rate watch (behind the rate-monitoring release flag) monitor: how the registered price has moved, with state (Watching, Paused or Ended, kept after the watch ends until the loan's next registration), endReason, startedAt, lastCheckedAt, nextCheckAt, latest (the most recent reading: price, rate, lockPeriod, parRate, outcome Ok, NotOffered or Failed, observedAt), baseline (the registered price, rate and parRate), priceChange (latest minus registered price, in points), priceChangeDollars (loan amount times the change over 100), targetPrice and targetReachedAt, absent when the flag is off or there is no watch (read only: a target price is set in the web app); and canFloat / canRequestLock, with blockedReason when either is false (NotTpo, LockAlreadyRequested, LoanLocked, LockDeskClosed). Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. Read this before register\_loan\_program. To lock, use register\_loan\_program with election Lock; to cancel a pending lock request (status Lock Requested), pass this scenarioId to cancel\_rate\_lock\_request.

**Who can call it:** Admin, CompanyAdmin, Processor, Agent, DualLicensedAgent, ConciergeKey

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## get\_product\_details

Retrieve full rate quotes, lock-period pricing, adjustments summary, and lender fee totals for a specific mortgage product from a prior search\_pricing call. Provide searchId and productId from the search result. The searchId is a transient OptimalBlue session token — if you receive a session-expired error, run search\_pricing again to get a fresh token.

**Who can call it:** Admin, Processor, DualLicensedAgent, ConciergeKey, Agent

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `commissionTier`    | string        | Loan officer commission tier (a commission percentage) that selects which pricing engine account to price under. Allowed: HalfPercent (0.50%), ThreeQuarterPercent (0.75%), OnePercent (1.00%), OneAndThreeQuarterPercent (1.75%). Honored only for Realfinity.AI.Api-originated calls; ignored for other callers. Use the same tier passed to search\_pricing. One of `HalfPercent`, `ThreeQuarterPercent`, `OnePercent`, `OneAndThreeQuarterPercent`. |
| `useAgentObAccount` | boolean       | If true, price under the agent's own pricing engine account (their configured channel and originator) instead of a commission-tier account. Honored only for Realfinity.AI.Api-originated calls; takes precedence over commissionTier. Use the same value passed to search\_pricing.                                                                                                                                                                    |
| `userId`            | string (uuid) | Henge user ID (GUID) that pricing should be routed through (the pricing agent). Obtain it from search\_users, or from a loan application's loan officer via get\_loan\_application. Defaults to the calling user when omitted.                                                                                                                                                                                                                          |
| `searchId`          | string        | REQUIRED. The searchId returned by a prior search\_pricing call. This is a transient pricing engine session token — if expired, call search\_pricing again to get a fresh one.                                                                                                                                                                                                                                                                          |
| `productId`         | string        | REQUIRED. The productId of a specific product returned by search\_pricing.                                                                                                                                                                                                                                                                                                                                                                              |
| `loanAmount`        | number        | REQUIRED. The base loan amount in USD that quotes should be computed against. Usually matches the loanAmount passed to search\_pricing.                                                                                                                                                                                                                                                                                                                 |
| `loanTermInYears`   | integer       | REQUIRED. Loan term in years (e.g. 30, 15, 20). Note: this is a plain number of years, not the OB LoanTerms enum used by search\_pricing.                                                                                                                                                                                                                                                                                                               |

## get\_product\_group\_best\_price

Retrieve the best-price ladder of one product group from a search\_pricing call made with useProductGroupSearch: at each rate, the best price across EVERY eligible product in the group, so different investors can win at different rates (the group's row in the search shows only one winner). Provide the grouped row's searchId and productGroupId. Each quote names its own productId, productName, investor, investorId and productCode; products lists those products' adjustments, par rates, adjustable-rate terms and notes. An adjustable-rate ladder can have two quotes at one rate with different armMargin: they are different loans after the first adjustment, so show the margin. For lender fees, call get\_product\_details with the quote's productId and the same searchId. If the searchId has expired, run search\_pricing again.

**Who can call it:** Admin, Processor, DualLicensedAgent, ConciergeKey, Agent

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                     |
| ------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `searchId`          | string        | REQUIRED. The searchId of the grouped row (the row's own searchId) from a search\_pricing call made with useProductGroupSearch. A transient pricing engine session token: if it has expired, run search\_pricing again.                                         |
| `productGroupId`    | string        | REQUIRED. The productGroupId of the grouped row, for example 1\_127\_133\_149\_0\_0\_0.                                                                                                                                                                         |
| `userId`            | string (uuid) | Henge user ID (GUID) that pricing is routed through (the pricing agent). Use the same one as the search. Defaults to the calling user when omitted.                                                                                                             |
| `loanAmount`        | number        | The base loan amount in USD, usually the search's loan amount. Used for the loan officer's adjusted APR.                                                                                                                                                        |
| `loanTermInYears`   | integer       | Loan term in years (e.g. 30, 15). Used for the loan officer's adjusted APR.                                                                                                                                                                                     |
| `includeGuidelines` | boolean       | If true, the pricing engine includes each product's guidelines. Token-intensive; default false.                                                                                                                                                                 |
| `commissionTier`    | string        | Loan officer commission tier that selects the pricing engine account. Honored only for Realfinity.AI.Api-originated calls. Use the same tier passed to search\_pricing. One of `HalfPercent`, `ThreeQuarterPercent`, `OnePercent`, `OneAndThreeQuarterPercent`. |
| `useAgentObAccount` | boolean       | If true, price under the agent's own pricing engine account instead of a commission-tier account. Honored only for Realfinity.AI.Api-originated calls. Use the same value passed to search\_pricing.                                                            |

## get\_rate\_lock

Read a loan's rate lock as the LOS holds it: status (Locked, Not Locked or Lock Suspended), isLocked, lockDate and lockTime, periodDays, expirationDate, the locked noteRate and price, and history (every lock, extension, relock and break the LOS recorded, newest first, with who made it). isLocked is derived from the status, not from the LOS's sRLckdIsLocked flag. It also carries priceGrid (the front-end grid as the LOS screen names it: basePrice, visible and hidden adjustment totals, the adjustment lines with hidden ones marked, originatorPrice, finalPrice, investorPrice, the internalNote and the originatorCompensation inputs) and investorLock (the back-end investor lock: investor, loan and confirmation numbers, program, rate sheet time, commitment type, lock fee, date, period, expiration and delivery expiration, note rate, base price, total adjustments, final price, projected profit, status, adjustment lines and its own history). When the loan was locked through Henge it also carries ladder: the locked product's rate sheet as it was when the lock was placed (takenAt, the rows of the locked lock period with quoteId, rate, price, points, principalAndInterest, apr, monthlyMi (monthly mortgage insurance, dollars) and discountDollar / rebateDollar (the buydown cost or rebate credit, dollars), the selected row and the moves after the lock); it is absent on a loan with no kept sheet. Identify the loan by its MLM ExternalId (preferred) or its internal Henge GUID. This is the LOS's confirmed lock, not the quote a lock REQUEST was made on; for that use get\_loan\_registration. Restricted to Admin and Processor; borrowers never see lock information.

**Who can call it:** Admin, Processor

**Reads or writes:** reads only

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## import\_lodestar\_fees

Import chosen lines of a LodeStar preview into a Henge loan application's fees in the LOS. THIS WRITES TO THE LOAN ORIGINATION SYSTEM and changes the loan's closing costs, cash to close and disclosures: show the caller the preview and import only the lines they explicitly confirm, each with a CONFIRMED feeTypeId (never an unconfirmed suggestion). Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID; it must be in the LOS. Give the previewId and the lines (sourceRef, feeTypeId, and outcome Replace only where the loan already has a fee of the type and the caller wants it replaced). A line with no feeTypeId, or any other problem with a line, refuses the whole call, naming the lines, and nothing is written. Lines of one fee type become one fee with a payment per payer (a borrower and seller split). A type the loan already has is skipped unless the line says Replace, so a fee is never added twice. Each fee is read back from the LOS: any field it accepted but did not keep is in notKept, and you must tell the caller. A fee the LOS refuses is reported as failed and the others still go through. Admin and Processor only.

**Who can call it:** Admin, Processor

**Reads or writes:** writes

**Availability:** only where the `lodestar-fee-estimates` release flag is on for the caller.

| Input               | Type            | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `previewId`         | string (uuid)   | REQUIRED. The previewId from preview\_loan\_fee\_estimate.                                                                                                                                                                                                                                         |
| `lines`             | array of object | REQUIRED. The preview lines to import, each with its confirmed feeTypeId.                                                                                                                                                                                                                          |
| `lines[].sourceRef` | string          | REQUIRED. The preview line's sourceRef, from preview\_loan\_fee\_estimate.                                                                                                                                                                                                                         |
| `lines[].feeTypeId` | string          | REQUIRED. The CONFIRMED closingCostFeeTypeId for the line: the preview's matched fee type, or the one the caller chose or confirmed from a suggestion. Never pass a suggestion the caller has not confirmed.                                                                                       |
| `lines[].outcome`   | string          | Only when the loan already has a fee of the type: Replace to set that fee's amount and payer to the estimate's, or LeaveAlone to keep it. Omit to add a fee the loan lacks and leave one it has alone. One of `Add`, `Replace`, `LeaveAlone`.                                                      |
| `externalId`        | string          | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid)   | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## preview\_loan\_fee\_estimate

Request a NEW LodeStar closing cost estimate for a Henge loan application and return it as a PREVIEW; nothing is written to the LOS. EVERY CALL IS A NEW QUOTE THAT LODESTAR BILLS: to read an estimate already requested, use get\_loan\_fee\_estimate\_preview (free). Ask the caller before calling this and do not repeat it. Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID. The estimate is built from the loan's property, loan amount, price, purpose and closing date; a loan missing any of them is refused with the fields listed, and a county with several townships needs township. Returns previewId and, per fee, sourceRef, name, amount, section, paidBy, mismoFeeType and a match: status matched (a fee type the company's mapping or its own fee type setup names; use it), suggested (the AI's pick from the company's fee types; NEVER import it until the caller confirms it) or unmatched (the caller must choose a fee type from get\_loan\_fee\_types); and, when the loan already has an LOS fee of the matched type, existing and an outcome (add, or leaveAlone by default). Review it with the caller, confirm any suggestions or choices with confirm\_loan\_fee\_matches, then import with import\_lodestar\_fees. Admin, Agent and Processor.

**Who can call it:** Admin, Agent, Processor

**Reads or writes:** writes

**Availability:** only where the `lodestar-fee-estimates` release flag is on for the caller.

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `township`          | string        | Optional. LodeStar's township, needed only when the property's county has several; the refusal lists them.                                                                                                                                                                                         |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## register\_loan\_program

Register the one program a loan will be underwritten to, and float it or lock it, in one step. This WRITES data. Price the loan first with search\_pricing (pass the loan's id) and pick one product and one quote (rate + lockPeriod from get\_product\_details). The loan is re-priced here and the quote must still be offered, else a Conflict asks you to re-price. The loan's current Floating registration is archived. election Float: saved as Floating and logged on the loan; no email. election Lock: EMAILS THE LOCKDESK with a lock request and files a lock-request PDF to the loan, and it can happen only ONCE per loan: afterwards the loan takes no float or lock (changes need a change of circumstance) unless the Lockdesk cancels the request. Lock needs the lock desk open (13:30 to 23:59 UTC); Float works any time. A lock request is not a lock with the investor, and nothing is written to MLM. BEFORE calling, confirm the product, rate, price, lock period and the election (float or lock) with the user.

**Who can call it:** Admin, CompanyAdmin, Processor, Agent, DualLicensedAgent, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input                                          | Type            | Description                                                                                                                                                                                                                                                                                        |
| ---------------------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `selection`                                    | object          | REQUIRED. The one product to register: productId (preferred) or productName from search\_pricing run with this loan, and a quotes array with exactly ONE entry, the rate and lockPeriod picked from get\_product\_details.                                                                         |
| `selection.productId`                          | string          | PREFERRED. The productId from a search\_pricing result. Provide this or productName.                                                                                                                                                                                                               |
| `selection.productName`                        | string          | Fallback identifier: the exact product name from a search\_pricing result (case-insensitive). Ignored when productId is provided.                                                                                                                                                                  |
| `selection.quotes`                             | array of object | The quotes to save for this product, each a rate + lockPeriod pair picked from the product's quote ladder (get\_product\_details). Omit entirely to select the product as a deal-desk PROGRAM without quotes (Admin/Processor only).                                                               |
| `selection.quotes[].rate`                      | number          | REQUIRED. The note rate of the quote to save, exactly as shown in the product's quote ladder (e.g. 6.625).                                                                                                                                                                                         |
| `selection.quotes[].lockPeriod`                | integer         | REQUIRED. The lock period in days of the quote to save (e.g. 30).                                                                                                                                                                                                                                  |
| `election`                                     | string          | REQUIRED. Float (register the program and float it; no email) or Lock (register it and send the lock request to the Lockdesk; once per loan). One of `Float`, `Lock`.                                                                                                                              |
| `loanOverrides`                                | object          | Optional: the same loanOverrides the quote was priced with in search\_pricing. The loan is re-priced with them and the selected quote must still be offered.                                                                                                                                       |
| `loanOverrides.loanAmount`                     | number          | Base loan amount in USD. Overrides the loan's amount.                                                                                                                                                                                                                                              |
| `loanOverrides.propertyValue`                  | number          | Property value in USD, used as appraised value and sales price. Overrides the loan's appraised value / purchase price.                                                                                                                                                                             |
| `loanOverrides.ficoScore`                      | integer         | Representative FICO score (300-850). Overrides the loan's credit score.                                                                                                                                                                                                                            |
| `loanOverrides.loanType`                       | string          | Loan type. Overrides the loan's loan type. One of `Conforming`, `NonConforming`, `FHA`, `VA`, `Conventional`, `HELOC`, `USDARuralHousing`.                                                                                                                                                         |
| `loanOverrides.loanPurpose`                    | string          | Loan purpose. Overrides the loan's purpose. One of `Purchase`, `RefiCashout`, `RefiRateTermLimitedCO`, `FHAStreamlineRefi`, `VARateReduction`, `SimpleRefinance`.                                                                                                                                  |
| `loanOverrides.cashOutAmount`                  | number          | Cash-out amount in USD (refinance).                                                                                                                                                                                                                                                                |
| `loanOverrides.occupancy`                      | string          | Occupancy. Overrides the loan's occupancy. One of `InvestmentProperty`, `PrimaryResidence`, `SecondHome`.                                                                                                                                                                                          |
| `loanOverrides.propertyType`                   | string          | Property type. Overrides the loan's property type. One of `SingleFamily`, `Condo`, `ManufacturedDoubleWide`, `Condotel`, `Modular`, `PUD`, `Timeshare`, `ManufacturedSingleWide`, `Coop`, `NonWarrantableCondo`, `Townhouse`, `DetachedCondo`.                                                     |
| `loanOverrides.numberOfUnits`                  | string          | Number of dwelling units: OneUnit, TwoUnits, ThreeUnits, FourUnits, or a count of 5 or more such as "6". Overrides the loan's unit count.                                                                                                                                                          |
| `loanOverrides.state`                          | string          | Property state (two-letter US code). Overrides the subject property's state.                                                                                                                                                                                                                       |
| `loanOverrides.zipCode`                        | string          | Property ZIP code. Overrides the subject property's ZIP code.                                                                                                                                                                                                                                      |
| `loanOverrides.county`                         | string          | Property county. When absent it is looked up from the property state and ZIP code.                                                                                                                                                                                                                 |
| `loanOverrides.citizenship`                    | string          | Borrower citizenship. Overrides the primary borrower's citizenship. One of `USCitizen`, `USCitizenAbroad`, `PermResidentAlien`, `NonPermResidentAlien`, `ForeignNational`.                                                                                                                         |
| `loanOverrides.debtToIncomeRatio`              | number          | DTI percent (25 = 25%). Overrides the loan's qualifying back-end ratio.                                                                                                                                                                                                                            |
| `loanOverrides.monthsReserves`                 | integer         | Months of post-closing reserves.                                                                                                                                                                                                                                                                   |
| `loanOverrides.waiveEscrows`                   | boolean         | Whether escrows are waived. Overrides the loan's escrow waiver.                                                                                                                                                                                                                                    |
| `loanOverrides.selfEmployed`                   | boolean         | Whether a borrower is self-employed. Overrides what the loan's employment says.                                                                                                                                                                                                                    |
| `loanOverrides.firstTimeHomeBuyer`             | boolean         | Whether the borrower is a first-time home buyer. Overrides the loan's declarations.                                                                                                                                                                                                                |
| `loanOverrides.interestOnly`                   | boolean         | Whether to price interest-only products. A loan is priced without them when absent.                                                                                                                                                                                                                |
| `loanOverrides.includeLoCompensationInPricing` | string          | Who pays the loan officer's compensation: YesLenderPaid (lender paid, in the price; what a loan is priced with when absent) or NoBuyerPaid (borrower paid, left out of the price). One of `YesLenderPaid`, `NoBuyerPaid`, `NoLenderPaid`.                                                          |
| `loanOverrides.loanTerms`                      | array of string | Loan terms to price. Overrides the loan's term.                                                                                                                                                                                                                                                    |
| `loanOverrides.amortizationTypes`              | array of string | Amortization types to price. Overrides the loan's amortization type.                                                                                                                                                                                                                               |
| `loanOverrides.armFixedTerms`                  | array of string | ARM fixed periods to price when amortizationTypes contains ARM.                                                                                                                                                                                                                                    |
| `loanOverrides.productTypes`                   | array of string | Product categories to include. \[StandardProducts] when absent; non-QM uses \[ExpandedGuidelines].                                                                                                                                                                                                 |
| `loanOverrides.desiredLockPeriod`              | integer         | Desired lock period in days. Overrides the loan's lock period.                                                                                                                                                                                                                                     |
| `loanOverrides.desiredPrice`                   | number          | Desired price (par = 100).                                                                                                                                                                                                                                                                         |
| `loanOverrides.desiredRate`                    | number          | Target interest rate. 0 returns all eligible rates.                                                                                                                                                                                                                                                |
| `loanOverrides.includeGuidelines`              | boolean         | If true, include per-product eligibility guidelines.                                                                                                                                                                                                                                               |
| `notes`                                        | string          | Optional notes saved on the registration.                                                                                                                                                                                                                                                          |
| `externalId`                                   | string          | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId`                            | string (uuid)   | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## save\_loan\_adjustment\_or\_proration

Add or edit one adjustment or proration on a loan in the LOS. THIS WRITES TO THE LOAN ORIGINATION SYSTEM OF RECORD and changes the loan's cash to close: read the lists with get\_loan\_adjustments\_and\_prorations, show the caller the new values, and write only after they explicitly confirm. Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID; the loan must be in the LOS. Send kind (Adjustment or Proration). Without recordId a NEW record is added and a retry adds a second one, so check the list first; with the recordId of an existing record only the fields sent are changed. An adjustment takes description, amount, paidFromParty and paidToParty; a proration takes description, amount, cashflowType and paidThroughDate. A field the list does not take is refused by name, and nothing is written. The amounts the LOS calculates are never written. The write goes through the same checks as set\_loan\_los\_collection\_fields and add\_loan\_los\_collection\_record: the LOS's result is read for each field and the record is read back, and applied is true only when every field is confirmed. If applied is false, tell the caller which fields were not kept and never describe the call as a success. Writes an activity-log line. Admin, Processor and ConciergeKey (a ConciergeKey only on the loans of the loan officers they manage) only.

**Who can call it:** Admin, Processor, ConciergeKey

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `kind`              | string        | REQUIRED. Which list: Adjustment (sAdjustmentList, credits and adjustments between the parties) or Proration (sProrationList, taxes and charges prorated between borrower and seller). One of `Adjustment`, `Proration`.                                                                           |
| `recordId`          | string        | The Id of the record to edit, from get\_loan\_adjustments\_and\_prorations. Omit to ADD a new record: a retry then adds a second one.                                                                                                                                                              |
| `description`       | string        | The record's description as it shows on the loan. REQUIRED when adding.                                                                                                                                                                                                                            |
| `amount`            | number        | The amount in dollars and cents. REQUIRED when adding.                                                                                                                                                                                                                                             |
| `paidFromParty`     | integer       | Adjustment only: the LOS's code of the party who pays. Read an existing adjustment to see the codes the loan uses.                                                                                                                                                                                 |
| `paidToParty`       | integer       | Adjustment only: the LOS's code of the party who is paid.                                                                                                                                                                                                                                          |
| `cashflowType`      | integer       | Proration only: the LOS's cash flow code. Read an existing proration to see the codes the loan uses.                                                                                                                                                                                               |
| `paidThroughDate`   | string        | Proration only: the date the amount is prorated through, as YYYY-MM-DD.                                                                                                                                                                                                                            |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## search\_pricing

Search mortgage pricing and return eligible products with rates and pricing adjustments. INVOKE IMMEDIATELY whenever a user requests mortgage rates, a rate quote, pricing, or asks what products they qualify for; do not ask clarifying questions first. To price an existing loan, pass its loanApplicationId or externalId: the loan is priced from its stored data under its loan officer, the built-in defaults below do NOT apply, the other criteria objects are ignored, and any change (e.g. a different lock period or term) goes in loanOverrides. If the loan lacks a required input (loan amount, property value, number of units, state, zip code, occupancy, loan purpose, loan type, credit score) the call is refused naming each one; ask the user for them and pass them in loanOverrides, never guess. Without a loan, all parameters have built-in defaults (780 FICO, $1.125M loan / $1.5M value, 30-year fixed conventional purchase, FL 33135; county is derived from zipCode when omitted, primary-residence single-family); populate what the user provided and let defaults fill the rest. If you set state, also set zipCode. Loan amount (or property value, which drives LTV) and state/county affect results most. If no eligible products are returned, call get\_ineligible\_products with the same searchId to explain why.

**Who can call it:** Admin, Processor, DualLicensedAgent, ConciergeKey, Agent

**Reads or writes:** reads only

| Input                                                                    | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `loanApplicationId`                                                      | string (uuid)   | Henge loan application ID (GUID) to price from its stored data. Use this or externalId. With a loan, borrowerInformation, propertyInformation, loanInformation, qmInformation, userId and commissionTier are ignored; pass changes in loanOverrides.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `externalId`                                                             | string          | LOS loan id (externalId) of the loan to price from its stored data; preferred over loanApplicationId when both are given.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `loanOverrides`                                                          | object          | Only with a loan: criteria that win over the loan's values (for example desiredLockPeriod, loanTerms, desiredPrice). Anything left out comes from the loan; nothing is defaulted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanOverrides.loanAmount`                                               | number          | Base loan amount in USD. Overrides the loan's amount.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `loanOverrides.propertyValue`                                            | number          | Property value in USD, used as appraised value and sales price. Overrides the loan's appraised value / purchase price.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanOverrides.ficoScore`                                                | integer         | Representative FICO score (300-850). Overrides the loan's credit score.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanOverrides.loanType`                                                 | string          | Loan type. Overrides the loan's loan type. One of `Conforming`, `NonConforming`, `FHA`, `VA`, `Conventional`, `HELOC`, `USDARuralHousing`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanOverrides.loanPurpose`                                              | string          | Loan purpose. Overrides the loan's purpose. One of `Purchase`, `RefiCashout`, `RefiRateTermLimitedCO`, `FHAStreamlineRefi`, `VARateReduction`, `SimpleRefinance`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanOverrides.cashOutAmount`                                            | number          | Cash-out amount in USD (refinance).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanOverrides.occupancy`                                                | string          | Occupancy. Overrides the loan's occupancy. One of `InvestmentProperty`, `PrimaryResidence`, `SecondHome`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `loanOverrides.propertyType`                                             | string          | Property type. Overrides the loan's property type. One of `SingleFamily`, `Condo`, `ManufacturedDoubleWide`, `Condotel`, `Modular`, `PUD`, `Timeshare`, `ManufacturedSingleWide`, `Coop`, `NonWarrantableCondo`, `Townhouse`, `DetachedCondo`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `loanOverrides.numberOfUnits`                                            | string          | Number of dwelling units: OneUnit, TwoUnits, ThreeUnits, FourUnits, or a count of 5 or more such as "6". Overrides the loan's unit count.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `loanOverrides.state`                                                    | string          | Property state (two-letter US code). Overrides the subject property's state.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `loanOverrides.zipCode`                                                  | string          | Property ZIP code. Overrides the subject property's ZIP code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanOverrides.county`                                                   | string          | Property county. When absent it is looked up from the property state and ZIP code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanOverrides.citizenship`                                              | string          | Borrower citizenship. Overrides the primary borrower's citizenship. One of `USCitizen`, `USCitizenAbroad`, `PermResidentAlien`, `NonPermResidentAlien`, `ForeignNational`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanOverrides.debtToIncomeRatio`                                        | number          | DTI percent (25 = 25%). Overrides the loan's qualifying back-end ratio.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanOverrides.monthsReserves`                                           | integer         | Months of post-closing reserves.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanOverrides.waiveEscrows`                                             | boolean         | Whether escrows are waived. Overrides the loan's escrow waiver.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanOverrides.selfEmployed`                                             | boolean         | Whether a borrower is self-employed. Overrides what the loan's employment says.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanOverrides.firstTimeHomeBuyer`                                       | boolean         | Whether the borrower is a first-time home buyer. Overrides the loan's declarations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanOverrides.interestOnly`                                             | boolean         | Whether to price interest-only products. A loan is priced without them when absent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanOverrides.includeLoCompensationInPricing`                           | string          | Who pays the loan officer's compensation: YesLenderPaid (lender paid, in the price; what a loan is priced with when absent) or NoBuyerPaid (borrower paid, left out of the price). One of `YesLenderPaid`, `NoBuyerPaid`, `NoLenderPaid`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `loanOverrides.loanTerms`                                                | array of string | Loan terms to price. Overrides the loan's term.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanOverrides.amortizationTypes`                                        | array of string | Amortization types to price. Overrides the loan's amortization type.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanOverrides.armFixedTerms`                                            | array of string | ARM fixed periods to price when amortizationTypes contains ARM.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanOverrides.productTypes`                                             | array of string | Product categories to include. \[StandardProducts] when absent; non-QM uses \[ExpandedGuidelines].                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanOverrides.desiredLockPeriod`                                        | integer         | Desired lock period in days. Overrides the loan's lock period.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `loanOverrides.desiredPrice`                                             | number          | Desired price (par = 100).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanOverrides.desiredRate`                                              | number          | Target interest rate. 0 returns all eligible rates.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanOverrides.includeGuidelines`                                        | boolean         | If true, include per-product eligibility guidelines.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `useProductGroupSearch`                                                  | boolean         | Optional, default false. True to run the pricing engine's Product Group search: agency (StandardProducts) products come back one row per product group at that group's best price (productGroupId and searchId on each row), non-QM (ExpandedGuidelines) products stay one row per product, and searchMode says which ran (ProductGroup, Full or Mixed). Open a grouped row with get\_product\_group\_best\_price using the row's searchId and productGroupId; open a row without productGroupId with get\_product\_details using the row's searchId. Honoured only while the ob-product-group-search release flag is on for the loan officer's company; otherwise the ordinary search runs and searchMode is absent. Works with a loan (loanApplicationId or externalId) too. |
| `commissionTier`                                                         | string          | LO commission tier selecting the pricing engine account to price under. Honored only for Realfinity.AI.Api callers. Leave null to use the agent's configured account. One of `HalfPercent`, `ThreeQuarterPercent`, `OnePercent`, `OneAndThreeQuarterPercent`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `useAgentObAccount`                                                      | boolean         | If true, price under the agent's own pricing engine account (their configured channel and originator) instead of a commission-tier account. Honored only for Realfinity.AI.Api-originated calls; takes precedence over commissionTier. Fails if the agent has no pricing engine account configured.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `userId`                                                                 | string (uuid)   | Henge user ID (GUID) of the pricing agent, from search\_users or the loan's officer. Defaults to the calling user.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `includeGuidelines`                                                      | boolean         | If true, include per-product eligibility guidelines.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `borrowerInformation`                                                    | object          | Borrower-side pricing criteria.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `borrowerInformation.citizenship`                                        | string          | Borrower citizenship status. One of `USCitizen`, `USCitizenAbroad`, `PermResidentAlien`, `NonPermResidentAlien`, `ForeignNational`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `borrowerInformation.ficoScore`                                          | integer         | Representative FICO score (300-850).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `borrowerInformation.firstTimeHomeBuyer`                                 | boolean         | Set true on purchases to surface FTHB products and reduced MIP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `borrowerInformation.selfEmployed`                                       | boolean         | True if the borrower is self-employed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `borrowerInformation.monthsReserves`                                     | integer         | Months of post-closing reserves.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `borrowerInformation.typeOfVeteran`                                      | string          | Required for VA loans; ignored otherwise. One of `ActiveDuty`, `NationalGuardOrReserves`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `borrowerInformation.vaFirstTimeUse`                                     | boolean         | VA only. First use of VA entitlement (affects funding fee).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `borrowerInformation.waiveEscrows`                                       | boolean         | Whether escrows are waived.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `borrowerInformation.state`                                              | string          | Borrower mailing-address state (two-letter code), distinct from the property state. Optional.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `borrowerInformation.firstName`                                          | string          | Optional borrower first name; not used for eligibility.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `borrowerInformation.lastName`                                           | string          | Optional borrower last name; not used for eligibility.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `propertyInformation`                                                    | object          | Property-side pricing criteria.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `propertyInformation.propertyValue`                                      | number          | Property value in USD. Used as appraised value and sales price unless overridden.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `propertyInformation.appraisedValue`                                     | number          | Appraised value in USD. Overrides propertyValue for refinance LTV.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `propertyInformation.salesPrice`                                         | number          | Sales price in USD. Overrides propertyValue for purchase LTV.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `propertyInformation.state`                                              | string          | Property state (two-letter US code).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `propertyInformation.county`                                             | string          | Property county (must match the state), without the word 'County'. Omit to have it derived from zipCode.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `propertyInformation.zipCode`                                            | string          | Property ZIP code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `propertyInformation.propertyType`                                       | string          | Property type. One of `SingleFamily`, `Condo`, `ManufacturedDoubleWide`, `Condotel`, `Modular`, `PUD`, `Timeshare`, `ManufacturedSingleWide`, `Coop`, `NonWarrantableCondo`, `Townhouse`, `DetachedCondo`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `propertyInformation.occupancy`                                          | string          | Occupancy type. One of `InvestmentProperty`, `PrimaryResidence`, `SecondHome`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `propertyInformation.numberOfUnits`                                      | string          | Number of dwelling units: OneUnit, TwoUnits, ThreeUnits, FourUnits, or a count of 5 or more such as "6".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `propertyInformation.corporateRelocation`                                | boolean         | True if the borrower is being relocated by their employer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `propertyInformation.numberOfStories`                                    | integer         | Number of stories.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `propertyInformation.propertyStreetAddress`                              | string          | Optional street address; not used for eligibility.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `propertyInformation.city`                                               | string          | Optional city; not used for eligibility.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanInformation`                                                        | object          | Loan-side pricing criteria.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `loanInformation.loanType`                                               | string          | Loan type. Drives the product set. One of `Conforming`, `NonConforming`, `FHA`, `VA`, `Conventional`, `HELOC`, `USDARuralHousing`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.loanPurpose`                                            | string          | Loan purpose. One of `Purchase`, `RefiCashout`, `RefiRateTermLimitedCO`, `FHAStreamlineRefi`, `VARateReduction`, `SimpleRefinance`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanInformation.loanAmount`                                             | number          | Base loan amount in USD, excluding financed fees and MIP.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `loanInformation.cashOutAmount`                                          | number          | Cash-out amount in USD (refinance).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanInformation.secondLienAmount`                                       | number          | Second lien amount in USD. Affects CLTV.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanInformation.helocDrawnAmount`                                       | number          | HELOC drawn amount in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanInformation.helocLineAmount`                                        | number          | HELOC line (limit) amount in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanInformation.productTypes`                                           | array of string | Product categories to include. Most scenarios use \[StandardProducts]; non-QM uses \[ExpandedGuidelines].                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `loanInformation.amortizationTypes`                                      | array of string | Amortization types. Conventional typically \[Fixed, ARM]; FHA/VA/USDA typically \[Fixed].                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `loanInformation.loanTerms`                                              | array of string | Loan terms to include.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation.armFixedTerms`                                          | array of string | REQUIRED when amortizationTypes contains ARM; defaults to \[FiveYear, SevenYear, TenYear]. Ignored otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanInformation.desiredRate`                                            | number          | Target interest rate. 0 returns all eligible rates.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanInformation.desiredLockPeriod`                                      | integer         | Desired lock period in days.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `loanInformation.desiredPrice`                                           | number          | Desired price (par = 100).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanInformation.constructionLoanType`                                   | string          | Construction loan type. One of `NotApplicable`, `Construction`, `ConstructionToPerm`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `loanInformation.exemptFromVAFundingFee`                                 | boolean         | VA only. True for veterans with a service-connected disability.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanInformation.debtToIncomeRatio`                                      | number          | DTI percent (25 = 25%).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanInformation.interestOnly`                                           | boolean         | Include interest-only products.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanInformation.propertiesFinanced`                                     | integer         | Number of properties the borrower already finances.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `loanInformation.lienType`                                               | string          | Lien position. One of `First`, `Second`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanInformation.automatedUnderwritingSystem`                            | string          | AUS to score against. One of `DU`, `LP`, `NotSpecified`, `InvestorAUS`, `ManualTraditional`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `loanInformation.borrowerPaidMi`                                         | string          | Whether the borrower pays mortgage insurance. One of `Yes`, `No`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanInformation.buydown`                                                | string          | Buydown structure. One of `None`, `ThreeTwoOne`, `TwoOne`, `OneZero`, `OneOne`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanInformation.buydownContributorType`                                 | string          | Who funds the buydown: Lender, Borrower, Seller, Builder or OtherInterestedThirdParty. Optional; only accepted with a buydown other than None. Omit to send nothing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanInformation.expandedApprovalLevel`                                  | string          | Expanded approval level (FHA). One of `NotApplicable`, `LevelOne`, `LevelTwo`, `LevelThree`, `LevelFour`, `LevelFive`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation.prepaymentPenalty`                                      | string          | Prepayment penalty duration (non-QM). One of `None`, `OneYear`, `TwoYear`, `ThreeYear`, `FourYear`, `FiveYear`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanInformation.includeLoCompensationInPricing`                         | string          | How LO compensation flows into pricing. One of `YesLenderPaid`, `NoBuyerPaid`, `NoLenderPaid`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `loanInformation.assetDepletion`                                         | string          | Asset depletion income method. One of `Yes`, `No`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.autoDebit`                                              | string          | Automatic payment debit. One of `Yes`, `No`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `loanInformation.employeeLoan`                                           | string          | Employee / internal loan. One of `Yes`, `No`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanInformation.communityAffordableSecond`                              | string          | Community Affordable Second attached. One of `Yes`, `No`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `loanInformation.calculateTotalLoanAmount`                               | boolean         | Auto-calculate the total loan amount. When false, totalLoanAmountDetails applies.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanInformation.totalLoanAmountDetails`                                 | object          | Optional total-loan override. Only honored when calculateTotalLoanAmount is false.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.totalLoanAmountDetails.totalLoanAmount`                 | number          | Explicit total loan amount in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.totalLoanAmountDetails.upfrontPmiMipFfGfPercent`        | number          | Upfront PMI/MIP/FF/GF percent.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `loanInformation.totalLoanAmountDetails.upfrontPmiMipFfGfAmount`         | number          | Upfront PMI/MIP/FF/GF amount in USD (alternative to the percent).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `loanInformation.totalLoanAmountDetails.upfrontPmiMipFfGfPaidinCash`     | number          | Portion paid in cash at closing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanInformation.totalLoanAmountDetails.upfrontPmiMipFfGfFinancedAmount` | number          | Portion financed into the loan.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `loanInformation.expandedGuidelines`                                     | object          | Non-QM / Expanded Guidelines eligibility criteria.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.expandedGuidelines.incomeVerificationType`              | string          | Income documentation type. One of `FullDoc`, `PersonalBankStmt1Mo`, `PersonalBankStmt6Mos`, `PersonalBankStmt12Mos`, `PersonalBankStmt18Mos`, `PersonalBankStmt24Mos`, `BusinessBankStmt1Mo`, `BusinessBankStmt6Mos`, `BusinessBankStmt12Mos`, `BusinessBankStmt18Mos`, `BusinessBankStmt24Mos`, `OneYearAltDoc`, `AssetRelated`, `InvestorDscr`, `RestrictedStock`, `InvestorNoRatio`, `PersonalBankStmt3Mos`, `BusinessBankStmt3Mos`, `TwoYearAltDoc`, `WrittenVOE`, `Stated`, `OneYear1099`, `TwoYear1099`, `PLOneYear`, `PLTwoYear`, `NoIncomeVerification`.                                                                                                                                                                                                               |
| `loanInformation.expandedGuidelines.housingEventType`                    | string          | Recent housing event. None when nothing to disclose. One of `None`, `DeedInLieu`, `Foreclosure`, `Modification`, `ShortSale`, `Forbearance`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `loanInformation.expandedGuidelines.housingEventSeasoning`               | string          | Required when housingEventType != None. One of `NotApplicable`, `Last1To12Months`, `Last13To24Months`, `Last25To36Months`, `Last37To48Months`, `Last49To60Months`, `MoreThanFiveYearsAgo`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `loanInformation.expandedGuidelines.bankruptcyType`                      | string          | Bankruptcy chapter, if any. One of `None`, `Chapter7`, `Chapter11`, `Chapter13`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loanInformation.expandedGuidelines.bankruptcyOutcome`                   | string          | NotApplicable when bankruptcyType is None. One of `NotApplicable`, `Discharged`, `Dismissed`, `OpenOrPending`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `loanInformation.expandedGuidelines.bankruptcySeasoning`                 | string          | Required when bankruptcyType != None. One of `NotApplicable`, `Last1To12Months`, `Last13To24Months`, `Last25To36Months`, `Last37To48Months`, `Last49To60Months`, `MoreThanFiveYearsAgo`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanInformation.expandedGuidelines.debtServiceCoverageRatio`            | number          | DSCR for investor / non-QM products.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanInformation.expandedGuidelines.uniqueProperty`                      | boolean         | Unique property flag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `loanInformation.expandedGuidelines.debtConsolidation`                   | boolean         | Debt consolidation flag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanInformation.expandedGuidelines.mortgageLates30In12Months`           | integer         | 30-day mortgage lates, last 12 months.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation.expandedGuidelines.mortgageLates30In13To24Months`       | integer         | 30-day mortgage lates, months 13-24.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanInformation.expandedGuidelines.mortgageLates60In12Months`           | integer         | 60-day mortgage lates, last 12 months.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation.expandedGuidelines.mortgageLates60In13To24Months`       | integer         | 60-day mortgage lates, months 13-24.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanInformation.expandedGuidelines.mortgageLates90In12Months`           | integer         | 90-day mortgage lates, last 12 months.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `loanInformation.expandedGuidelines.mortgageLates90In13To24Months`       | integer         | 90-day mortgage lates, months 13-24.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `loanInformation.expandedGuidelines.mortgageLates120In12Months`          | integer         | 120-day mortgage lates, last 12 months.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `loanInformation.expandedGuidelines.mortgageLates120In13To24Months`      | integer         | 120-day mortgage lates, months 13-24.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `loanInformation.firstLienAmount`                                        | number          | First-lien amount in USD when lienType=Second (drives CLTV). Leave null otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `loanInformation.feesIn`                                                 | string          | Yes = closing costs financed into the loan; No = paid at closing. One of `No`, `Yes`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `loanInformation.reducedMi`                                              | boolean         | True for reduced-MI products (HomeReady, Home Possible).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `loanInformation.totalMonthlyQualifyingIncome`                           | number          | Total monthly qualifying income in USD across all borrowers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `qmInformation`                                                          | object          | Optional QM points-and-fees breakdown for APOR calculations. Leave null to treat all itemized fees as 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `qmInformation.refinancePrepaymentFeeAmount`                             | number          | Refinance prepayment fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `qmInformation.creditInsuranceFeeAmount`                                 | number          | Credit insurance fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `qmInformation.cashIncentiveDiscountAmount`                              | number          | Cash incentive / discount applied at closing in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `qmInformation.escrowTrusteeFeeAmount`                                   | number          | Escrow / trustee fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `qmInformation.propertyAssessmentFeeAmount`                              | number          | Property assessment fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `qmInformation.notaryCreditReportFeeAmount`                              | number          | Notary / credit report fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `qmInformation.documentPreparationFeeAmount`                             | number          | Document preparation fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `qmInformation.titleFeeAmount`                                           | number          | Title fee in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `qmInformation.borrowerPaidLoCompensation`                               | number          | Borrower-paid LO compensation in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `qmInformation.additionalQmFeesAffectApor`                               | boolean         | If true, additional QM fees count toward the APOR comparison.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `qmInformation.additionalQmFeeAmount`                                    | number          | Additional QM fees in USD beyond the itemized categories.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `qmInformation.financedPmi`                                              | number          | Financed PMI / MIP rolled into the loan, in USD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

## set\_investor\_lock

Record a loan's back-end (investor) rate lock from the investor's lock confirmation, and, only when lock is true, lock it: the investor (rolodex id), the investor's loan and confirmation numbers, the lock date and period, the note rate, the base price, the adjustments, the program name, the rate sheet time, the commitment type (BestEfforts, Mandatory, Hedged or Securitized) and the lock fee. THIS WRITES TO THE LIVE LOS, and WITHOUT lock: true NOTHING IS LOCKED: the values are only recorded. CONFIRM EVERY VALUE WITH THE USER BEFORE CALLING, and confirm lock: true separately. Identify the loan by its MLM ExternalId (preferred) or internal GUID; it must already be in the LOS. Send at least one value; a value left out is not touched. Prices are percent of par (100 is par); adjustments REPLACES the existing list (points are the LOS's own: negative raises the price). Saves go in this order: loan fields (the lock date first), adjustments, the price table, and only then, when lock is true, the table record with Lock True. The expiration and the delivery expiration are computed by the LOS as the lock date plus the period, with no weekend roll. Returns the investor lock as read back from the LOS (every field, base price, total adjustments, final price, projected profit, status and history). Restricted to Admin and Processor, never TPO or partner callers. An entry is written to the loan's activity log naming who set what, old to new, with the reason when one was given.

**Who can call it:** Admin, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input                       | Type               | Description                                                                                                                                                                                                                                                                                        |
| --------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `investorId`                | integer            | The investor's rolodex id (the LOS's sInvestorRolodexId). Omit to leave it as it is.                                                                                                                                                                                                               |
| `investorLoanNumber`        | string             | The investor's loan number. Omit to leave it as it is.                                                                                                                                                                                                                                             |
| `confirmationNumber`        | string             | The investor's lock confirmation number. Omit to leave it as it is.                                                                                                                                                                                                                                |
| `lockDate`                  | string (date)      | The investor lock date, as yyyy-MM-dd. Omit to leave it as it is.                                                                                                                                                                                                                                  |
| `periodDays`                | integer            | The investor lock period in days, 1 to 365. The LOS computes the expiration and the delivery expiration as the date plus these days, with no weekend roll. Omit to leave it as it is.                                                                                                              |
| `noteRate`                  | number             | The investor note rate as a percentage, for example 6.5. Omit to leave it as it is.                                                                                                                                                                                                                |
| `basePrice`                 | number             | The investor base price, in percent of par (100 is par), for example 101.994. Omit to leave it as it is.                                                                                                                                                                                           |
| `adjustments`               | array of object    | The investor adjustment lines. THE LIST REPLACES THE EXISTING ONE; send an empty list to clear it, omit it to leave it. Each line has a description and points: a negative value raises the price (-0.250 on 101.994 gives 102.244).                                                               |
| `adjustments[].description` | string             | The line's description, for example a state adjustment.                                                                                                                                                                                                                                            |
| `adjustments[].points`      | number             | The adjustment in points, as the LOS takes it: negative adds to the price (-0.250 raises it by 0.250), positive lowers it.                                                                                                                                                                         |
| `adjustments[].hidden`      | boolean            | True for a hidden lender line the broker never sees. Front-end lock only; ignored by set\_investor\_lock.                                                                                                                                                                                          |
| `programName`               | string             | The investor's program name. Omit to leave it as it is.                                                                                                                                                                                                                                            |
| `rateSheetTime`             | string (date-time) | The rate sheet's effective time, as yyyy-MM-ddTHH:mm (the LOS keeps it as MM/dd/yyyy h:mm tt). Omit to leave it as it is.                                                                                                                                                                          |
| `commitmentType`            | string             | BestEfforts, Mandatory, Hedged or Securitized. Omit to leave it as it is.                                                                                                                                                                                                                          |
| `lockFee`                   | number             | The investor lock fee. Omit to leave it as it is.                                                                                                                                                                                                                                                  |
| `lock`                      | boolean            | True LOCKS THE INVESTOR LOCK, only after the price is written. False or omitted locks nothing.                                                                                                                                                                                                     |
| `lockReason`                | string             | The reason recorded on the lock event when lock is true.                                                                                                                                                                                                                                           |
| `externalId`                | string             | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId`         | string (uuid)      | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## set\_rate\_lock

Record a loan's front-end rate lock: the lock date, the lock period in days and the locked note rate (lockDate, periodDays and noteRate), the price grid (basePrice, adjustments, internalNote), the originator compensation inputs, and, only when lock is true, lock the loan. THIS WRITES TO THE LOS, the live Loan Origination System of record, and WITHOUT lock: true NOTHING IS LOCKED: the values are only recorded. With lock: true the lock has the effects of one made in the LOS itself: the lock-requested pricing scenario is archived, the borrower's lock confirmation goes out and the LOS's locked-LE disclosure flow runs. CONFIRM EVERY VALUE WITH THE USER BEFORE CALLING, and confirm lock: true separately: read the lock date, period, rate, base price, adjustments and note back to them and get a yes. This is NOT register\_loan\_program, which asks the lock desk for a lock on a priced program and never sets these fields; use this tool only when the user is the lock desk recording a lock that has actually been placed. Identify the loan by its MLM ExternalId (preferred) or internal GUID; it must already be in the LOS. Send at least one value; a value left out is not touched. Prices are percent of par (100 is par). adjustments REPLACES every line the loan holds, hidden lender lines included (points are the LOS's own: negative raises the price). Saves go in this order: date, period and rate; internal note and originator compensation; adjustments; the price table (row 0 with the note rate and base price); and last, in a save of its own, the lock. The lock status and the expiration are computed by the LOS and never written. The originator compensation inputs are taken on a locked loan too: the lock stays Locked, no lock event is written, and the locked Final Price changes (seen: 100.494 to 101.994 when lender-paid 1.5% became borrower paid), so read get\_rate\_lock before and after a compensation write. If the LOS has not enabled setting the lock status for this account the values are written and lockOutcome says 'lock not set'; that is not a failed write. The LOS is written first and the loan is read back, so the result is what the LOS holds (priceGrid included), not an echo of the request; if the LOS refuses a write nothing further is sent and the error carries its reason. Restricted to Admin and Processor. An entry is written to the loan's activity log naming who set what, old to new.

**Who can call it:** Admin, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input                                   | Type            | Description                                                                                                                                                                                                                                                                                                                                      |
| --------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `lockDate`                              | string (date)   | The lock date, as yyyy-MM-dd. Omit to leave it as it is.                                                                                                                                                                                                                                                                                         |
| `periodDays`                            | integer         | The lock period in days, 1 to 365 (typically 15, 30, 45 or 60). Omit to leave it as it is.                                                                                                                                                                                                                                                       |
| `noteRate`                              | number          | The locked note rate as a percentage, for example 6.625. Above 0 and at most 25. Omit to leave it as it is.                                                                                                                                                                                                                                      |
| `basePrice`                             | number          | The base price of the price grid, in percent of par (100 is par), for example 101.994. Written as the note rate and base price of row 0 of the grid, after the adjustments. Omit to leave it as it is.                                                                                                                                           |
| `adjustments`                           | array of object | The adjustment lines, visible and hidden. THE LIST REPLACES EVERY LINE THE LOAN HOLDS, hidden lender lines included; send an empty list to clear them all, omit it to leave them. Each line has a description and points, in the LOS's own sense: a negative value raises the price (-0.250 on 101.994 gives 102.244), a positive one lowers it. |
| `adjustments[].description`             | string          | The line's description, for example a state adjustment.                                                                                                                                                                                                                                                                                          |
| `adjustments[].points`                  | number          | The adjustment in points, as the LOS takes it: negative adds to the price (-0.250 raises it by 0.250), positive lowers it.                                                                                                                                                                                                                       |
| `adjustments[].hidden`                  | boolean         | True for a hidden lender line the broker never sees. Front-end lock only; ignored by set\_investor\_lock.                                                                                                                                                                                                                                        |
| `internalNote`                          | string          | The lock screen's Internal Notes. Omit to leave it as it is.                                                                                                                                                                                                                                                                                     |
| `lock`                                  | boolean         | True LOCKS THE LOAN, after the price is written: the LOS sets the lock status to Locked, in a save of its own. False or omitted locks nothing: without lock true the values are only recorded. If the LOS has not enabled setting the lock status for this account the values are written and the result says the lock was not set.              |
| `originatorCompensationPaidBy`          | string          | Who pays the originator compensation: Borrower or Lender. Omit to leave it as it is.                                                                                                                                                                                                                                                             |
| `originatorCompensationPercent`         | number          | The originator compensation percent. Omit to leave it as it is.                                                                                                                                                                                                                                                                                  |
| `originatorCompensationMinAmount`       | number          | The originator compensation minimum amount in USD. Omit to leave it as it is.                                                                                                                                                                                                                                                                    |
| `originatorCompensationFixedAmount`     | number          | The fixed originator compensation amount in USD. Omit to leave it as it is.                                                                                                                                                                                                                                                                      |
| `originatorCompensationBase`            | string          | What the compensation percent is taken of: LoanAmount or TotalLoanAmount. Omit to leave it as it is.                                                                                                                                                                                                                                             |
| `originatorCompensationLenderFeeOption` | string          | IncludedInLenderFees or InAdditionToLenderFees. Omit to leave it as it is.                                                                                                                                                                                                                                                                       |
| `externalId`                            | string          | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored.                                               |
| `loanApplicationId`                     | string (uuid)   | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                                                                       |

## set\_rate\_lock\_position

Move a locked loan's selected rate to another row of the locked product's rate sheet, as it was when the lock was placed (the ladder of get\_rate\_lock). THIS WRITES TO THE LOS, the live Loan Origination System of record: the row's rate becomes the loan's note rate, with the lock date and lock period unchanged. CONFIRM THE ROW WITH THE USER BEFORE CALLING: read back the current and the new rate and price and get a yes. Identify the loan by its MLM ExternalId (preferred) or internal GUID, and send quoteId, taken from ladder.rows of get\_rate\_lock. The row must be in the kept rate sheet and have the locked lock period, and not be the selected one; otherwise the error says why. The LOS is written first; the move (who, when, from and to rate and price) is then added to ladder.moves and logged to the loan's activity. The price, adjustments and final price are not written to the LOS. Restricted to Admin and Processor.

**Who can call it:** Admin, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

**Availability:** only where the `lock-ladder` release flag is on for the caller.

| Input               | Type          | Description                                                                                                                                                                                                                                                                                        |
| ------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `quoteId`           | string        | The quoteId of the row to select, from ladder.rows of get\_rate\_lock. The row must have the locked lock period.                                                                                                                                                                                   |
| `externalId`        | string        | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored. |
| `loanApplicationId` | string (uuid) | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                         |

## update\_loan\_application\_fee

Edit a closing cost fee on a Henge loan application in the LOS. Identify the loan by its MLM ExternalId (preferred) or internal Henge GUID, and the fee by its feeId from get\_loan\_application\_fees. Send only what changes: description, amount, and for one payment (paymentId, optional when the fee has one payment) who pays and when. The amount can be set only on a flat fee; a fee the LOS calculates (isCalculated in get\_loan\_application\_fees: prepaids, reserves, per-diem interest, aggregate adjustment) is refused, and the refusal names the loan fields it is calculated from, to change with set\_loan\_los\_fields (with each field's lock flag). The section, payee and shop flags cannot be changed: the LOS ignores them. Admin and Processor only. This WRITES TO THE LOAN ORIGINATION SYSTEM and changes the loan's closing costs, cash to close and disclosures. Call it with dryRun true first, show the caller the before and after, and write only after they explicitly confirm. Returns the fee before and after as the LOS holds it, read back after the save, with the section and loan totals before and after. The LOS can accept a save and quietly not keep a field: any such field is listed in notKept, and you must tell the caller.

**Who can call it:** Admin, Processor

**Reads or writes:** writes; can delete, cost money or reach someone outside, so a client should ask first

| Input                         | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----------------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `feeId`                       | string          | REQUIRED. The fee's feeId, from its lines in get\_loan\_application\_fees.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `description`                 | string          | New name for the fee. Omit to leave it as it is.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `amount`                      | number          | New amount in dollars. Only a flat fee takes one: a fee the LOS calculates (prepaid interest, percentage fees) is refused. Omit to leave it as it is.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `paymentId`                   | string          | The payment that paidBy and paymentTiming change: paymentId on the fee's line. May be omitted when the fee has a single payment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `paidBy`                      | string          | New payer for the payment: Borrower, BorrowerFinanced, Seller, Lender, Broker or Other. Omit to leave it as it is. One of `Borrower`, `Seller`, `BorrowerFinanced`, `Lender`, `Broker`, `Other`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `paymentTiming`               | string          | When the payment is made: AtClosing or OutsideOfClosing (POC). Omit to leave it as it is. One of `Unknown`, `AtClosing`, `OutsideOfClosing`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `addPayments`                 | array of object | New payments to add to the fee, e.g. a Seller payment beside the Borrower's. The LOS keeps a system payment for whatever no payment covers, so the earlier payer's share shrinks by what is added. Omit to add none.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `addPayments[].paidBy`        | string          | REQUIRED. Who pays this share: Borrower, BorrowerFinanced, Seller, Lender, Broker or Other. One of `Borrower`, `Seller`, `BorrowerFinanced`, `Lender`, `Broker`, `Other`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `addPayments[].amount`        | number          | REQUIRED. This payment's share of the fee in dollars and cents, above zero, e.g. 400.00.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `addPayments[].paymentTiming` | string          | When this share is paid: AtClosing (default) or OutsideOfClosing. One of `Unknown`, `AtClosing`, `OutsideOfClosing`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `payeeRole`                   | string          | Change who the fee is paid to, as a contact role (Beneficiary), e.g. Title, Appraiser, Escrow. Omit to leave it as it is. One of `Other`, `Appraiser`, `Escrow`, `CreditReport`, `Title`, `MortgageInsurance`, `ListingAgent`, `SellingAgent`, `Builder`, `Underwriter`, `Investor`, `Servicing`, `BuyerAttorney`, `SellerAttorney`, `HomeOwnerInsurance`, `HazardInsurance`, `MarketingLead`, `Seller`, `Surveyor`, `LoanOfficer`, `Bank`, `Lender`, `Processor`, `CallCenterAgent`, `LoanOpener`, `Manager`, `Broker`, `BrokerRep`, `ECOA`, `Realtor`, `Mortgagee`, `HomeOwnerAssociation`, `BuyerAgent`, `ClosingAgent`, `FairHousingLending`, `HomeInspection`, `FloodProvider`, `CreditReportAgency2`, `CreditReportAgency3`, `Shipper`, `BrokerProcessor`, `Trustee`, `Funder`, `PostCloser`, `Insuring`, `CollateralAgent`, `DocDrawer`, `PropertyManagement`, `TitleUnderwriter`, `CreditAuditor`, `DisclosureDesk`, `JuniorProcessor`, `JuniorUnderwriter`, `LegalAuditor`, `LoanOfficerAssistant`, `Purchaser`, `QCCompliance`, `Secondary`, `PestInspection`, `Subservicer`, `ExternalSecondary`, `ExternalPostCloser`, `LoanPurchasePayee`, `AppraisalManagementCompany`, `Referral`, `Notary`, `TaxServicer`, `SupervisoryAppraiser`, `Attorney`, `PropertyInspector`, `CPATaxPreparer`, `LockDesk`, `MortgageServiceOrganization`, `Verifications`, `TaxCollector`, `TaxTranscripts`. |
| `dryRun`                      | boolean         | true to validate and preview the change without writing anything. Use it first and show the caller the result.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `externalId`                  | string          | PREFERRED when available. The MLM ExternalId of the loan (string, up to 108 chars). Use this whenever the loan already exists in MLM — it is the stable identifier humans see in MLM UIs and is what webhooks surface. If both ids are supplied, externalId wins and loanApplicationId is ignored.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `loanApplicationId`           | string (uuid)   | Fallback identifier: the Henge internal loan application ID (GUID). Use this only when no externalId is known — typically because the loan has not yet been pushed to MLM.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://api-docs.hengelending.com/mcp/tool-reference/pricing-locks-and-fees.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
