Quick Start
ClearGrid Credentials
Get API Credentials
Contact ClearGrid support to receive your lender credentials (email + password).
Login to Get Token
curl -X POST https://core-dev.cleargrid.ae/api/v1/auth/{lender}/login \ -H "Content-Type: application/json" \ -d '{ "email": "[email protected]", "password": "securepassword" }'
Response
{ "lenderPublicId": "1234-5678", "token": "eyJhbGciOiJIUz...", "refreshToken": "eyJhbGciOiJIUz..." }
Make Your First Account Request
curl -X POST https://job-dev.cleargrid.ae/api/v1/lenders/{lenderPublicId}/accounts \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "accounts": [ { "status": 1, "accountId": "acc123", "subAccountId": "sub1", "firstName": "John", "lastName": "Doe", "principal": 1000, "loanType": 3 } ] }'
Authentication
1. Lender Login
Endpoint
POST {base_url}/auth/{lender}/login
Body
{
"email": "[email protected]",
"password": "securepassword"
}
Response
{
"lenderPublicId": "<lender_uuid>",
"token": "<access_token>",
"refreshToken": "<refresh_token>"
}
2. Refresh Token
Endpoint
POST {base_url}/auth/{lender}/refresh-token
Body
{
"refreshToken": "<refresh_token>"
}
Response
{
"token": "<access_token>"
}
Response Codes
Code
Meaning
Example Response
200
✅ Success – request accepted and processing started
{ "code": 200, "message": "success" }
400
❌ Bad Request – validation errors in input
{ "code": 400, "errors": [{ "accountId": "acc123", "errors": ["Invalid date format"] }] }
401
🔒 Unauthorized – missing or invalid token
{ "error": "Unauthorized" }
500
⚠️ Server Error – unexpected system error
{ "error": "Something went wrong. Please try again later." }
Last updated