Comprehensive API testing for MSME lending verification platform
97.9% Pass Rate (47/48)cd /path/to/truthstack3.0
uvicorn app.main:app --host 0.0.0.0 --port 8100 --reload
cd /path/to/truthstack-test-suite
python -c "from app import app; app.run(debug=True, port=5001)"
Open: http://localhost:5001
python tests/run_all_tests.py
| Suite | Epic | Description |
|---|---|---|
| test_00_lender_onboarding | E00 | Lender registration |
| test_01_authentication | E00 | OAuth2 tokens |
| test_02_applications | E01/E14 | Application CRUD |
| test_03_documents | E01 | Document upload |
| test_04_connections | E05 | GST/AA/MCA connections |
| test_05_readiness | E01 | ACK/NACK checks |
| test_06_submit | E01 | Application submission |
| test_07_health | - | Health probes |
| test_08_verification | E03-E08 | RATF verification |
| test_09_execution | E09 | RRP generation |
| test_15_psb_platform | E15 | PSB Xchange |
| test_16_invoice_screening | E16 | Duplicate screening |
| test_17_consortium | E17 | Fraud consortium |
| test_18_scf_products | E18 | SCF products |
| test_19_batch_operations | E19 | Batch verification |
| test_20_analytics | E20 | Platform analytics |
# Run only authentication tests
python tests/run_all_tests.py --suite auth
# Run PSB Platform tests
python tests/run_all_tests.py --suite psb-platform
# Available suites:
# onboarding, auth, apps, docs, gst, readiness, submit,
# health, verify, execution, psb-platform, invoice-screening,
# consortium, scf-products, batch-operations, analytics
The test suite uses OAuth2 Client Credentials flow:
curl -X POST http://localhost:8100/api/v3/lenders \
-H "Content-Type: application/json" \
-d '{"legal_name": "Test Finance Pvt Ltd", "lender_type": "nbfc", ...}'
curl -X POST http://localhost:8100/api/v3/auth/keys \
-H "Content-Type: application/json" \
-d '{"lender_id": "<lender_id>"}'
curl -X POST http://localhost:8100/api/v3/auth/token \
-d "grant_type=client_credentials" \
-d "client_id=<client_id>" \
-d "client_secret=<client_secret>"
curl -X GET http://localhost:8100/api/v3/applications \
-H "Authorization: Bearer <access_token>"
| Endpoint | Method | Description |
|---|---|---|
/api/v3/lenders | POST | Register lender |
/api/v3/auth/keys | POST | Generate API credentials |
/api/v3/auth/token | POST | Get access token |
/api/v3/applications | POST/GET | Create/list applications |
/api/v3/verify | POST | Run verification |
/api/v3/rrp/{id} | GET | Get verification report |
/api/v3/verify/batch | POST | Batch verification |
/health | GET | Health check |