> ## Documentation Index
> Fetch the complete documentation index at: https://developers.meet-oj.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Core concepts

> The objects you work with.

The borrower applies inside your product. O.J. runs the application and the lender process. The API returns everything the borrower should see, in the words they should see it. Embed renders exactly those fields; if you build your own screens, render the same ones.

| Concept          | What it is                                                                                          |
| ---------------- | --------------------------------------------------------------------------------------------------- |
| **Referral**     | One business applying for financing. Every other resource belongs to a referral.                    |
| **Progress**     | Five steps the borrower sees: Received, Documents, In review, Offer, Funded.                        |
| **To-dos**       | What the borrower (or your team) needs to do, one row each, with a button label and a hosted `url`. |
| **Matches**      | The lenders the business matches, named, with estimated limits. Estimates, not offers.              |
| **Credit check** | A soft pull on the owner, authorized on O.J.'s screen. It doesn't affect their score.               |
| **Offer**        | Terms a lender will fund. The borrower accepts and verifies a funding account.                      |
| **Payout**       | Your share of the commission on a funded loan. For your team only; never shown to the borrower.     |

## Progress and status

Render `progress.steps` as a track and `status_reason` as the sentence under it. `status_label` is the current step's name. Use `status` for logic.

| `status`                                     | Step shown                                          |
| -------------------------------------------- | --------------------------------------------------- |
| `received`                                   | Received                                            |
| `needs_borrower`                             | Documents, or Received while the credit check waits |
| `prequalified`, `submitted`, `needs_partner` | In review                                           |
| `offer`                                      | Offer                                               |
| `funded`                                     | Funded                                              |
| `declined`, `closed`                         | The track is replaced by `status_reason`            |

## To-dos

Render each item in `todos` as a row with a button that opens its `url`. The borrower completes it on an O.J. page, or in place if you use Embed. `next_action` is the first item, for integrations that show one button.

| `kind`             | What the borrower does                                                       |
| ------------------ | ---------------------------------------------------------------------------- |
| `authorize_credit` | Authorizes the soft credit check and enters their SSN on O.J.'s screen       |
| `connect_bank`     | Connects their bank through Plaid, for statements or for the funding account |
| `upload_documents` | Uploads documents, such as bank statements, if they don't connect a bank     |
| `accept_offer`     | Reviews, accepts and signs an offer                                          |

## Credit check

O.J. runs a soft pull on the primary owner to match on credit. The owner authorizes it and enters their SSN on O.J.'s screen, so neither passes through your servers. It doesn't affect their score. Lenders run their own check only if the borrower accepts an offer.

The referral's `credit.status` says where the check stands. O.J. never shares the score, or anything derived from it, with partners.

## Bank connection

Borrowers can connect their bank through Plaid instead of uploading statements. After they accept an offer, they verify the account the lender pays into. If they already connected a bank, they choose an account from it without logging in again. A voided check is the fallback.

## Messages

With the borrower's consent, O.J. keeps them posted by text while lenders review the file, and answers questions like "Any word?". Every message lands on the referral's conversation (`GET /referrals/{id}/conversation`), so what O.J. texted and what your product shows always agree. Your policy decides which channels O.J. may use, or routes messages through your own channel instead.

<Frame caption="O.J. texting the borrower while lenders review, then sending the offer.">
  <img src="https://mintcdn.com/o-j-171635ed/RrD04bhPCd2YMi1O/images/borrower-texts.png?fit=max&auto=format&n=RrD04bhPCd2YMi1O&q=85&s=cf37b7953b830c8517f8b7901f92df22" alt="Text thread: O.J. tells Daniel his file is with three lenders, answers 'Any word?', then sends an $80,000 offer from Example Capital" style={{ maxWidth: "360px" }} width="800" height="1600" data-path="images/borrower-texts.png" />
</Frame>

## When a referral ends without funding

| Case                                             | `status`              | What the borrower sees                                                            |
| ------------------------------------------------ | --------------------- | --------------------------------------------------------------------------------- |
| A lender reviewed the file and didn't approve it | `declined`            | The lender's name, and that the lender will send a notice explaining its decision |
| No lender matched, so nothing was submitted      | `closed` (`no_match`) | "We couldn't match this request with a lender right now."                         |

O.J. doesn't approve or decline credit. `outcome` carries the reason code and the sentence to show.

## Payouts

`estimated` → `pending` → `received` → `held` → `scheduled` → `paid`, or `reversed` if a lender claws back the commission. `GET /payouts` is your statement. Payout destinations are set during onboarding and cannot be changed through the API.
