Borrower API
Complete API documentation for Lendasat Borrower integration
Version: 0.8.11
Specification: OAS 3.1
Base URL: https://apiborrow.lendasat.com
The Lendasat Borrower API allows you to programmatically interact with the platform to:
- Register as a new user
- Manage personal API keys
- Query available loan offers
- Create contract requests
- Manage open contracts
Authentication
All API requests require authentication using an API key passed in the request header:
x-api-key: your-api-key-hereHow to Get an API Key as a Regular Borrower
For the time being, you will need to contact Lendasat support to request an API key.
Steps:
- Register at https://borrow.lendasat.com
- Email support@lendasat.com to request an API key
- Use the provided API key in all API requests
How to Create Borrower API Accounts
Lendasat partners can create borrower API accounts to integrate Lendasat directly into their own products.
Partner Integration Steps
1. Register as a Partner
Register as a regular user at https://borrow.lendasat.com
2. Request Master API Key
Contact Lendasat support to generate a master API key for your organization (e.g., las-BTC21)
3. Create Borrower API Accounts
Use your master API key to create new borrower accounts programmatically:
curl -X POST "https://apiborrow.lendasat.com/api/create-api-account" \
-H "Content-Type: application/json" \
-H "x-api-key: las-BTC21" \
-d '{
"name": "Satoshi Nakamoto",
"email": "satoshi@gmx.com",
"timezone": "America/New_York"
}' | jq .Response:
{
"id": "818316da-6cad-41d6-ac82-6a4d1ec91d3b",
"name": "Satoshi Nakamoto",
"email": "satoshi@gmx.com",
"timezone": "America/New_York",
"api_key": "ldst-acc-1d906625-064b-4c61-bb3a-41d497421e3f"
}The returned api_key can be used to interact with Lendasat's API as a regular borrower.
Example Usage of Borrower API Key
Once you have a borrower API key, you can use it to create contract requests:
curl -X POST "https://apiborrow.lendasat.com/api/contracts" \
-H "Content-Type: application/json" \
-H "x-api-key: ldst-acc-1d906625-064b-4c61-bb3a-41d497421e3f" \
-d '{
"loan_id": "9c89f12b-3f1a-4320-bf68-be3ce0820dd2",
"loan_amount": 100,
"duration_days": 7
}' | jq .API Endpoints
The Borrower API provides the following endpoint groups:
Detailed endpoint documentation will be added as individual pages. Check back soon or contact support for the complete API specification.
Account Management
- Create API accounts (partner feature)
- Manage API keys
- User registration
Loan Offers
- Query available offers
- Filter by amount, duration, and terms
- Get offer details
Contract Management
- Create contract requests
- Get contract status
- Manage collateral
- Handle repayments
- Request extensions
Notifications
- Webhook configuration
- Event subscriptions
- Margin call alerts
Request Format
All POST/PUT requests must use Content-Type: application/json.
Example Request:
{
"loan_id": "9c89f12b-3f1a-4320-bf68-be3ce0820dd2",
"loan_amount": 100,
"duration_days": 7,
"collateral_address": "bc1q...",
"repayment_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}Response Format
All responses are returned in JSON format.
Success Response:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending",
"loan_amount": 100,
"created_at": "2024-01-15T10:30:00Z"
}Error Response:
{
"error": "Invalid loan amount",
"code": "INVALID_AMOUNT",
"details": "Loan amount must be between $10 and $10,000"
}Error Handling
Common HTTP Status Codes:
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request (invalid parameters) |
| 401 | Unauthorized (invalid/missing key) |
| 404 | Not Found |
| 429 | Too Many Requests (rate limited) |
| 500 | Internal Server Error |
Best Practices
- Secure API Keys - Never expose API keys in client-side code or public repositories
- Rate Limiting - Implement exponential backoff for rate limit responses
- Idempotency - Use unique request IDs to prevent duplicate contract creation
- Error Handling - Always check response status codes and handle errors gracefully
- Webhook Validation - Verify webhook signatures to ensure authenticity
Development vs Production
Development:
- Base URL: Contact support for development endpoint
- Test API keys available
- No real funds involved
Production:
- Base URL:
https://apiborrow.lendasat.com - Production API keys required
- Real Bitcoin and stablecoins
Support & Resources
- Support Email: support@lendasat.com
- OpenAPI Spec: Download JSON
- Platform Docs: Borrowing Guide
- Contract Terms: Contract Details
Next Steps
- Explore individual endpoint documentation (coming soon)
- Lender API Overview
- Contract State Management