Quickstart

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:

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

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

Example response:

1{
2 "products": [
3 {
4 "key": "personalLoan",
5 "type": "PERSONAL_LOAN",
6 "name": "Personal Loan",
7 "available": true,
8 "lenders": [
9 {
10 "id": "alpha",
11 "name": "Alpha Finance",
12 "available": true,
13 "highlights": ["Fast eligibility check"],
14 "loanTerms": {
15 "currency": "INR",
16 "amount": {
17 "minimum": 50000,
18 "maximum": 500000
19 }
20 },
21 "checks": [
22 {
23 "key": "CREDIT_REPORT",
24 "name": "Credit report check",
25 "required": true
26 }
27 ],
28 "informationNeeded": {
29 "lenderSpecificRequirementsKnown": false,
30 "required": [
31 {
32 "key": "contactNumber",
33 "label": "Mobile number",
34 "type": "phone",
35 "sendIn": "profile.contactNumber",
36 "sensitive": true
37 },
38 {
39 "key": "creditReportConsent",
40 "label": "Credit report consent",
41 "type": "boolean",
42 "sendIn": "journey.creditReportConsent",
43 "sensitive": false
44 }
45 ],
46 "optional": [],
47 "conditional": []
48 }
49 }
50 ]
51 },
52 {
53 "key": "goldLoan",
54 "type": "GOLD_LOAN",
55 "name": "Gold Loan",
56 "available": false,
57 "unavailableReason": "No lenders are currently available for this product.",
58 "lenders": []
59 }
60 ]
61}

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.

$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:

1{
2 "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"
3}

To print only the URL in a terminal:

$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:

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

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