Integrate your lab system with our marketplace. Use these endpoints to manage your test catalog and orders programmatically.
http://localhost:3000 |
Auth: JWT bearer token (use /api/auth/login or /api/auth/register first) |
Content-Type: application/json
POST /api/auth/register with role: "provider"POST /api/auth/login โ save the tokenAuthorization: Bearer <token> header on every requestGET /api/provider/testsRegister a new provider account. Returns a JWT token and user object.
Body:{
"role": "provider",
"name": "CityCare Diagnostics",
"email": "admin@citycare.com",
"phone": "+919876543210",
"password": "your_password",
"pincode": "110001",
"address": "Connaught Place, New Delhi"
}
Response 200:
{
"user": { "id": 2, "role": "provider", "name": "CityCare Diagnostics", "email": "admin@citycare.com", "client_id": null, "wallet_credits": 0, "commission_pct": 10 },
"token": "eyJhbGciOiJIUzI1NiIs..."
}
Login with email and password. Returns a JWT token valid for 7 days.
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"demo@lab.com","password":"provider123"}'
List all active tests. Supports filtering by query, category, and pincode. Public endpoint.
Query params: q category pincodecurl "http://localhost:3000/api/tests?pincode=110001&category=Biochemistry"
List your own test catalog (active and inactive). Requires provider auth.
curl http://localhost:3000/api/provider/tests \
-H "Authorization: Bearer <token>"
Create a new test in your catalog.
Body:{
"name": "Complete Blood Count",
"category": "Hematology",
"description": "Measures RBC, WBC, platelets...",
"mrp": 350,
"offer_price": 250,
"pincodes": "110001,110002,110003"
}
Update an existing test. Send only the fields you want to change.
curl -X PUT http://localhost:3000/api/provider/tests/5 \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"offer_price": 199, "active": true}'
Permanently remove a test from your catalog.
Upload a catalog in bulk via Excel (.xlsx). For labs without their own system.
Download a template: GET /api/provider/sample-catalog.xlsxcurl -X POST http://localhost:3000/api/provider/tests/bulk-upload \
-H "Authorization: Bearer <token>" \
-F "file=@catalog.xlsx"
Expected Excel columns:
| Column | Required | Example |
|---|---|---|
name | Yes | Complete Blood Count |
category | No | Hematology |
description | No | Measures RBC, WBC... |
mrp | Yes | 350 |
offer_price | No | 250 |
pincodes | No | 110001,110002 |
{ added: 12, skipped: 0, total: 12 }
List all orders for your lab. Use this for polling or as a backup to webhooks.
curl http://localhost:3000/api/provider/orders \
-H "Authorization: Bearer <token>"
Update order status. Allowed values: placed, confirmed, sample_collected, processing, completed, cancelled.
curl -X POST http://localhost:3000/api/provider/orders/123/status \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"status":"sample_collected"}'
Upload the final test report. Once uploaded, the customer gets notified and can download it.
curl -X POST http://localhost:3000/api/provider/orders/123/report \
-H "Authorization: Bearer <token>" \
-F "report=@cbc-report.pdf" \
-F "notes=All values within normal range"
Get all reviews and average rating for a test. Public endpoint.
curl http://localhost:3000/api/tests/5/reviews
Get available appointment slots for a provider. Optional date=YYYY-MM-DD query.
Bulk-add slots to your schedule. Send an array of {date, time, capacity}.
curl -X POST http://localhost:3000/api/provider/slots \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"slots":[
{"date":"2026-06-20","time":"09:00","capacity":5},
{"date":"2026-06-20","time":"10:00","capacity":5}
]}'
GET /api/provider/orders every 60 seconds.
{
"id": 1,
"order_code": "ORDMQD8OWBN193",
"customer_id": 3,
"provider_id": 2,
"test_id": 1,
"status": "placed|confirmed|sample_collected|processing|completed|cancelled",
"amount": 250,
"commission_pct": 10,
"commission_amount": 23,
"credits_used": 20,
"credits_earned": 46,
"scheduled_at": "2026-06-20 09:00:00",
"address": "...",
"pincode": "110001",
"report_file": "report-ORDMQD8OWBN193.pdf",
"created_at": "2026-06-14 03:43:29"
}
{
"id": 1,
"provider_id": 2,
"name": "Complete Blood Count (CBC)",
"category": "Hematology",
"description": "...",
"mrp": 350,
"offer_price": 250,
"pincodes": "110001,110002,110003",
"active": 1
}
For integration help, email api@pathlab.com or open a ticket from your provider dashboard.