> ## 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.

# Quickstart

> Create a referral in the sandbox and follow it to funding.

The sandbox never contacts real lenders or borrowers. Each [sandbox business](/sandbox) plays out a scripted path within seconds.

<Steps>
  <Step title="Get an access token">
    [Request sandbox credentials](/sandbox#get-access) from [developers@meet-oj.com](mailto:developers@meet-oj.com). Exchange them for a token, which is valid for 15 minutes.

    ```bash theme={null}
    curl https://sandbox.api.meet-oj.com/oauth/token \
      -u "$OJ_CLIENT_ID:$OJ_CLIENT_SECRET" \
      -d grant_type=client_credentials \
      -d scope="referrals:read referrals:write sessions:write webhooks:manage"
    ```
  </Step>

  <Step title="Create a referral">
    Amounts are in cents. Send a unique `Idempotency-Key` with every POST so that retries are safe.

    ```bash theme={null}
    curl https://sandbox.api.meet-oj.com/partner/v0/referrals \
      -H "Authorization: Bearer $OJ_TOKEN" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d @referral.json
    ```

    **referral.json**

    ```json theme={null}
    {
      "external_id": "cust_8843",
      "intent": "work_this_deal",
      "product_hint": "revenue_based_financing",
      "requested_amount": 8500000,
      "use_of_funds": "working_capital",
      "business": {
        "legal_name": "Bluebonnet Auto Care LLC",
        "ein": "00-0000001",
        "entity_type": "llc",
        "formation_date": "2019-04-02",
        "naics": "811111",
        "address": { "line1": "1200 Main St", "city": "Fort Worth", "state": "TX", "postal_code": "76102" },
        "stated_annual_revenue": 92000000
      },
      "contacts": [
        {
          "first_name": "Daniel",
          "last_name": "Reyes",
          "email": "daniel@bluebonnetauto.com",
          "phone": "+18175550142",
          "ownership_pct": 100,
          "is_primary": true
        }
      ],
      "context": {
        "ledger": [
          { "month": "2026-08", "sales_deposits": 7810000, "total_inflows": 8120000, "ending_balance": 1430000, "nsf_count": 0 },
          { "month": "2026-07", "sales_deposits": 7420000, "total_inflows": 7690000, "ending_balance": 1210000, "nsf_count": 0 }
        ]
      },
      "consent": {
        "shared_with_oj_at": "2026-09-20T14:02:11Z",
        "terms_version": "partner-terms-2026-09"
      }
    }
    ```

    **Response · 201**

    ```json theme={null}
    {
      "id": "ref_1MUKLEHH7",
      "object": "referral",
      "external_id": "cust_8843",
      "status": "needs_borrower",
      "status_label": "Received",
      "status_reason": "Authorize a credit check so we can match you with lenders. It won't affect your credit score.",
      "todos": [
        {
          "id": "act_1MUKLEHH70",
          "who": "borrower",
          "kind": "authorize_credit",
          "label": "Authorize a credit check",
          "detail": "A soft check that doesn't affect your score. Lenders run their own check only if you accept an offer.",
          "url": "https://app.meet-oj.com/s/ps_1MUKLEHH70",
          "due_at": "2026-10-03T01:52:31Z"
        }
      ],
      "credit": { "status": "authorization_needed" },
      "created_at": "2026-09-28T01:52:31Z"
    }
    ```
  </Step>

  <Step title="Show progress and to-dos">
    Render `progress` as a track, `status_reason` under it, and each item in `todos` as a row with a button that opens its `url`. The borrower authorizes the credit check on O.J.'s page, so their SSN never touches your servers. The sandbox completes it after 10 seconds.

    Once the check is done, the referral lists the lenders the business matches:

    ```json theme={null}
    {
      "status": "prequalified",
      "status_label": "In review",
      "status_reason": "You match 3 lenders. We're preparing your file for them.",
      "matches": [
        { "lender": "Example Capital", "program": "Term loan", "amount_max": 9500000, "term_months": [24, 60], "speed": "Funds in 2 to 3 days", "state": "matched" },
        { "lender": "Example Bank", "program": "SBA 7(a) loan", "amount_max": 15000000, "term_months": [12, 120], "speed": "4 to 6 weeks", "state": "matched" },
        { "lender": "Example Funding", "program": "Line of credit", "amount_max": 7500000, "term_months": [12, 24], "speed": "Funds in 1 to 2 days", "state": "matched" }
      ]
    }
    ```

    Embed renders the same `matches` for the borrower. If you build your own screen, render the same fields.

    <Frame caption="The intake result in O.J. Embed, rendered from matches.">
      <img src="https://mintcdn.com/o-j-171635ed/RrD04bhPCd2YMi1O/images/matches.png?fit=max&auto=format&n=RrD04bhPCd2YMi1O&q=85&s=8ccb7825fac0cd83309381626232d8cb" alt="Three lenders for Bluebonnet Auto Care: Example Capital term loan up to $95,000, Example Bank SBA 7(a) up to $150,000, Example Funding line of credit up to $75,000" style={{ maxWidth: "360px" }} width="610" height="1282" data-path="images/matches.png" />
    </Frame>
  </Step>

  <Step title="Follow it to funding">
    Follow the referral through submission, offers and funding with [webhooks](/webhooks) or `GET /events?referral_id=…`. In the sandbox, Bluebonnet funds within about a minute.

    ```bash theme={null}
    curl "https://sandbox.api.meet-oj.com/partner/v0/events?referral_id=ref_1MUKLEHH7" \
      -H "Authorization: Bearer $OJ_TOKEN"
    ```

    ```json theme={null}
    {
      "type": "offer.received",
      "referral_id": "ref_1MUKLEHH7",
      "data": {
        "lender": "Example Capital",
        "product": "term_loan",
        "binding": true,
        "items": [
          { "amount": 8000000, "rate": 12.9, "rate_type": "interest", "term_months": 36, "payment_frequency": "monthly", "number_of_payments": 36, "payment_amount": 269169, "total_payback": 9690084 }
        ],
        "conditions": ["funding_account_auth"]
      }
    }
    ```
  </Step>
</Steps>

<Tip>
  If you'd rather not build any screens, create a session with `POST /partner_sessions` and send the borrower to the hosted `url` it returns. See [O.J. Embed](/embed).
</Tip>
