Skip to main content
The scenarios endpoint is a powerful, stateless API that enables you to show borrowers real-time pricing options before they even create a loan application. Unlike traditional mortgage calculators that use static rates or lack guideline integration, Pylon’s scenarios endpoint evaluates loan structures against live rates and guidelines at runtime.

Why use scenarios?

Real-time rates

Scenarios use live rates and guidelines at the time of the API call, ensuring borrowers see accurate, current pricing.

No loan required

Show pricing options before creating a loan application, reducing friction in the borrower experience.

All products

Returns all eligible products and scenarios across all takeouts, not just a single product.

Optimized structures

Evaluates thousands of loan structure permutations to find the most optimal options for the borrower.

When to use scenarios

Use the scenarios endpoint when:
  • Borrower knows their out-of-pocket budget: If the borrower knows how much they want to spend out of pocket for the entire transaction, use the optimized purchasePricing endpoint.
  • Comparing traditional vs. optimized structures: Show borrowers how optimized structures compare to traditional down payment amounts (3%, 20%, etc.).
Always use the optimized purchasePricing endpoint for production applications. The purchasePricingNoRestructure endpoint is only recommended for comparison purposes to demonstrate the value of optimized structures.

Basic usage

The scenarios endpoint requires minimal information to return comprehensive pricing options:

Required input fields

Optional input fields

Comparing traditional vs. optimized structures

Some borrowers may be familiar with traditional mortgage structures (3% down, 20% down to avoid PMI, etc.). You can demonstrate the value of optimized structures by comparing them:
1

Get traditional scenarios

Use purchasePricingNoRestructure with a specific down payment amount to see scenarios with unbounded cash to close:
2

Extract cash to close

From the traditional scenario, note the cashToClose value for a specific rate the borrower likes.
3

Run optimized scenarios

Use purchasePricing with outOfPocketMax set to the cash to close from step 2:
4

Compare results

Compare the cost for the same rate between traditional and optimized structures. The optimized structure often provides: - Lower total cost for the same rate - Different loan-to-value ratios (not necessarily 3%, 20%, etc.) - Better overall terms for the borrower

Understanding the response

The scenarios endpoint returns a structured response with products and their eligible scenarios:

Response fields

Each EligibleProductPricing exposes a rateStack of EligibleProductStructure entries with the following fields:

Optimization objectives

The objectiveIntent parameter controls how scenarios are optimized:

MIN_OUT_OF_POCKET

Minimizes the total cash required at closing. Best for borrowers with limited funds.

MIN_PITIA

Minimizes the monthly payment (Principal, Interest, Taxes, Insurance, Association) (PITIA). Best for borrowers focused on monthly affordability.

MIN_DOWN_PAYMENT

Middle ground between MIN_OUT_OF_POCKET and MIN_PITIA: buys down the rate as much as possible given available cash to close but does not exhaust available assets. With maxLTV, yields fixed structures (e.g. 90% LTV).

Best practices

Always use optimized scenarios: For production applications, always use the purchasePricing endpoint with outOfPocketMax rather than purchasePricingNoRestructure. The optimized endpoint evaluates thousands of structure permutations to find the best options for borrowers.
  1. Use borrower’s actual budget: When the borrower knows their out-of-pocket budget, use outOfPocketMax with the optimized endpoint.
  2. Show multiple options: Display scenarios across different rates and products to give borrowers choice.
  3. Explain the value: Help borrowers understand that optimized structures may differ from traditional down payment percentages but often provide better terms.
  4. Handle edge cases: If no scenarios are returned, the borrower may not qualify for any products with the given parameters. Consider adjusting inputs or explaining qualification requirements.
  5. Cache appropriately: While scenarios use live rates, you may want to cache results for a short period (e.g., 5-15 minutes) to reduce API calls during active borrower sessions.

Example: complete integration

Here’s a complete example of fetching and displaying scenarios: