> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.credit.aarthiklabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.credit.aarthiklabs.com/_mcp/server.

# Quickstart

> Create your first Hosted Experience URL and open it for a borrower.

This quickstart shows the smallest production-shaped Hosted Experience integration:

* keep the Aarthik Labs API key on your back-end
* create an `embedURL` for a borrower
* return only `embedURL` to your front-end
* open the URL in an approved surface

## Prerequisites

Before you start, make sure you have:

* a platform base URL from Aarthik Labs
* a platform API key for the tenant or application
* at least one enabled credit product for the API key scope
* an approved front-end domain if you plan to render the journey inside an `iframe`

Use environment variables on your back-end:

```bash
PLATFORM_BASE_URL="https://credit.aarthiklabs.com"
PLATFORM_API_KEY="sk_live_xxx"
```

## Step 1: Read Lender Product Catalogue

Use this call when your app needs to decide which products and lenders to show.

```bash
curl --request GET "${PLATFORM_BASE_URL}/api/lab/features" \
  --header "Authorization: Bearer ${PLATFORM_API_KEY}"
```

Example response:

```json
{
  "products": [
    {
      "key": "personalLoan",
      "type": "PERSONAL_LOAN",
      "name": "Personal Loan",
      "available": true,
      "lenders": [
        {
          "id": "alpha",
          "name": "Alpha Finance",
          "available": true,
          "highlights": ["Fast eligibility check"],
          "loanTerms": {
            "currency": "INR",
            "amount": {
              "minimum": 50000,
              "maximum": 500000
            }
          },
          "checks": [
            {
              "key": "CREDIT_REPORT",
              "name": "Credit report check",
              "required": true
            }
          ],
          "informationNeeded": {
            "lenderSpecificRequirementsKnown": false,
            "required": [
              {
                "key": "contactNumber",
                "label": "Mobile number",
                "type": "phone",
                "sendIn": "profile.contactNumber",
                "sensitive": true
              },
              {
                "key": "creditReportConsent",
                "label": "Credit report consent",
                "type": "boolean",
                "sendIn": "journey.creditReportConsent",
                "sensitive": false
              }
            ],
            "optional": [],
            "conditional": []
          }
        }
      ]
    },
    {
      "key": "goldLoan",
      "type": "GOLD_LOAN",
      "name": "Gold Loan",
      "available": false,
      "unavailableReason": "No lenders are currently available for this product.",
      "lenders": []
    }
  ]
}
```

Show only the products where `available` is `true`. Use the lender-level `checks` and `informationNeeded` sections to decide what to collect before you call `POST /api/lab/sessions`, and use each field's `sendIn` path when building that payload.

## Step 2: Create An Embeddable URL

Create the URL from your back-end. Send a stable `borrowerProviderID`, an explicit `journeyType`, and the borrower's contact number.

```bash
curl --request POST "${PLATFORM_BASE_URL}/api/lab/sessions" \
  --header "Authorization: Bearer ${PLATFORM_API_KEY}" \
  --header "Content-Type: application/json" \
  --data-raw '{
    "borrowerProviderID": "BORROWER-123",
    "journeyType": "PERSONAL_LOAN",
    "profile": {
      "contactNumber": "9876543210"
    }
  }'
```

Example response:

```json
{
  "embedURL": "https://credit.aarthiklabs.com/lab/embed?tenant_id=tenant_123&application_id=app_123&borrower_provider_id=BORROWER-123&journey_type=PERSONAL_LOAN#bt_live_personal_minimal"
}
```

To print only the URL in a terminal:

```bash
curl --silent --request POST "${PLATFORM_BASE_URL}/api/lab/sessions" \
  --header "Authorization: Bearer ${PLATFORM_API_KEY}" \
  --header "Content-Type: application/json" \
  --data-raw '{
    "borrowerProviderID": "BORROWER-123",
    "journeyType": "PERSONAL_LOAN",
    "profile": {
      "contactNumber": "9876543210"
    }
  }' | jq -r '.embedURL'
```

## Step 3: Open The URL

Return only `embedURL` from your back-end to your front-end. Then open it in the borrower-facing surface.

For a web `iframe`:

```tsx
<iframe
  src={embedURL}
  title="Credit Journey"
  allow="camera; microphone; clipboard-read; clipboard-write"
  style={{ width: "100%", height: "80vh", border: 0 }}
/>
```

The URL contains a short-lived bootstrap token in the URL fragment. Open it immediately after creating it. If a borrower returns later, call your back-end again and create a fresh URL for the same `borrowerProviderID`.

## What To Build Next

After the first URL works, build these pieces around it:

* a back-end route that validates your app user before calling Aarthik Labs
* a product picker that uses `GET /api/lab/features`
* lender-aware data collection that follows each field's `sendIn` path
* a front-end loading and retry state
* minimal and extended pre-fill payloads for Personal Loan and Gold Loan
* production checks for domain allowlisting, API key rotation, and borrower identity stability