Complete reference for all TrustUp API endpoints. See ROADMAP.md for implementation status.
- Development:
http://localhost:3000 - Production:
https://api.trustup.io(to be deployed)
Most endpoints require JWT authentication. Include the access token in the Authorization header:
Authorization: Bearer <access_token>Generate a nonce for wallet signature authentication.
Status: 🔴 Not Implemented (API-01)
Request:
{
"wallet": "GABC...XYZ"
}Response (200 OK):
{
"nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"expiresAt": "2026-02-13T10:05:00.000Z"
}Verify wallet signature and receive JWT tokens.
Status: 🔴 Not Implemented (API-02)
Request:
{
"wallet": "GABC...XYZ",
"signature": "MEUCIQ...",
"nonce": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Response (200 OK):
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 900
}Errors:
400: Invalid signature or nonce404: Nonce not found or expired
Refresh access token using refresh token.
Status: 🔴 Not Implemented
Request:
{
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}Response (200 OK):
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 900
}Get authenticated user's profile.
Status: 🔴 Not Implemented (API-04)
Authentication: Required
Response (200 OK):
{
"success": true,
"data": {
"wallet": "GABC...XYZ",
"name": "Maria Garcia",
"avatar": "https://...",
"preferences": {
"notifications": true,
"theme": "dark",
"language": "en"
},
"createdAt": "2026-01-15T10:00:00.000Z"
},
"message": "User retrieved successfully"
}Update user profile.
Status: 🔴 Not Implemented (API-05)
Authentication: Required
Request:
{
"name": "Maria Rodriguez",
"avatar": "https://...",
"preferences": {
"notifications": false
}
}Response (200 OK):
{
"wallet": "GABC...XYZ",
"name": "Maria Rodriguez",
"avatar": "https://...",
"preferences": {
"notifications": false,
"theme": "dark"
},
"updatedAt": "2026-02-13T10:00:00.000Z"
}List all active merchants.
Status: 🔴 Not Implemented (API-06)
Authentication: Required
Query Parameters:
limit(number, default: 20): Items per pageoffset(number, default: 0): Skip items
Response (200 OK):
{
"merchants": [
{
"id": "merchant-1",
"wallet": "GMER...ABC",
"name": "TechStore",
"logo": "https://...",
"category": "Electronics",
"isActive": true
}
],
"total": 42,
"limit": 20,
"offset": 0
}Get merchant details.
Status: 🔴 Not Implemented (API-07)
Authentication: Required
Response (200 OK):
{
"id": "merchant-1",
"wallet": "GMER...ABC",
"name": "TechStore",
"logo": "https://...",
"description": "Electronics retailer",
"category": "Electronics",
"website": "https://techstore.com",
"isActive": true,
"createdAt": "2026-01-01T00:00:00.000Z"
}Errors:
404: Merchant not found
Get reputation score for a wallet.
Status: 🔴 Not Implemented (API-08)
Authentication: Required
Response (200 OK):
{
"wallet": "GABC...XYZ",
"score": 75,
"tier": "Good",
"interestRate": 8,
"maxCredit": 3000,
"lastUpdated": "2026-02-10T15:30:00.000Z"
}Get authenticated user's reputation.
Status: 🔴 Not Implemented (API-08)
Authentication: Required
Response (200 OK):
{
"wallet": "GABC...XYZ",
"score": 75,
"tier": "Good",
"interestRate": 8,
"maxCredit": 3000,
"history": [
{
"timestamp": "2026-02-10T15:30:00.000Z",
"oldScore": 70,
"newScore": 75,
"reason": "Loan repayment completed"
}
]
}Calculate loan terms without creating it.
Status: 🔴 Not Implemented (API-10)
Authentication: Required
Request:
{
"amount": 500,
"merchant": "merchant-1",
"term": 4
}Response (200 OK):
{
"amount": 500,
"guarantee": 100,
"loanAmount": 400,
"interestRate": 8,
"totalRepayment": 432,
"term": 4,
"schedule": [
{
"paymentNumber": 1,
"amount": 108,
"dueDate": "2026-03-13T00:00:00.000Z"
},
{
"paymentNumber": 2,
"amount": 108,
"dueDate": "2026-04-13T00:00:00.000Z"
},
{
"paymentNumber": 3,
"amount": 108,
"dueDate": "2026-05-13T00:00:00.000Z"
},
{
"paymentNumber": 4,
"amount": 108,
"dueDate": "2026-06-13T00:00:00.000Z"
}
]
}Create a new loan (returns unsigned XDR).
Status: 🔴 Not Implemented (API-11)
Authentication: Required
Request:
{
"amount": 500,
"merchant": "merchant-1",
"guarantee": 100,
"term": 4
}Response (200 OK):
{
"loanId": "loan-123",
"xdr": "AAAAAgAAAAC...",
"description": "Create loan for $500 at TechStore"
}Errors:
400: Invalid amount, insufficient reputation404: Merchant not found
Make a payment on existing loan (returns unsigned XDR).
Status: 🔴 Not Implemented (API-12)
Authentication: Required
Request:
{
"amount": 108
}Response (200 OK):
{
"xdr": "AAAAAgAAAAC...",
"remainingBalance": 324,
"nextPaymentDue": "2026-04-13T00:00:00.000Z",
"description": "Repay $108 on loan loan-123"
}List authenticated user's loans.
Status: 🔴 Not Implemented (API-13)
Authentication: Required
Query Parameters:
status(string, optional): Filter by status (active, completed, defaulted)limit(number, default: 20)offset(number, default: 0)
Response (200 OK):
{
"loans": [
{
"id": "loan-123",
"merchant": {
"id": "merchant-1",
"name": "TechStore"
},
"amount": 500,
"loanAmount": 400,
"guarantee": 100,
"totalRepayment": 432,
"remainingBalance": 324,
"status": "active",
"nextPaymentDue": "2026-03-13T00:00:00.000Z",
"createdAt": "2026-02-13T10:00:00.000Z"
}
],
"total": 5,
"limit": 20,
"offset": 0
}Get loan details.
Status: 🔴 Not Implemented
Authentication: Required
Response (200 OK):
{
"id": "loan-123",
"user": "GABC...XYZ",
"merchant": {
"id": "merchant-1",
"name": "TechStore",
"wallet": "GMER...ABC"
},
"amount": 500,
"loanAmount": 400,
"guarantee": 100,
"interestRate": 8,
"totalRepayment": 432,
"remainingBalance": 324,
"status": "active",
"payments": [
{
"amount": 108,
"timestamp": "2026-02-13T10:00:00.000Z",
"txHash": "abc123..."
}
],
"schedule": [...],
"createdAt": "2026-02-13T10:00:00.000Z"
}Submit signed transaction to Stellar network.
Status: 🔴 Not Implemented (API-14)
Authentication: Required
Request:
{
"xdr": "AAAAAgAAAAC..."
}Response (200 OK):
{
"hash": "abc123...",
"status": "pending",
"submittedAt": "2026-02-13T10:00:00.000Z"
}Errors:
400: Invalid XDR format402: Insufficient funds500: Stellar network error
Get transaction status.
Status: 🔴 Not Implemented (API-15)
Authentication: Required
Response (200 OK):
{
"hash": "abc123...",
"status": "success",
"result": {
"ledger": 12345678,
"timestamp": "2026-02-13T10:00:30.000Z"
},
"submittedAt": "2026-02-13T10:00:00.000Z"
}Possible statuses: pending, success, failed
Get liquidity pool metrics.
Status: 🔴 Not Implemented (API-16)
Authentication: Optional
Response (200 OK):
{
"totalLiquidity": 1000000,
"availableLiquidity": 300000,
"loanedAmount": 700000,
"utilization": 0.7,
"apy": 8.5,
"totalProviders": 42
}Get authenticated user's LP position.
Status: 🔴 Not Implemented (API-17)
Authentication: Required
Response (200 OK):
{
"wallet": "GABC...XYZ",
"shares": 1000,
"shareValue": 1.08,
"currentValue": 1080,
"depositedAmount": 1000,
"gains": 80,
"apy": 8.5,
"depositedAt": "2026-01-13T10:00:00.000Z"
}Deposit funds to liquidity pool (returns unsigned XDR).
Status: 🔴 Not Implemented (API-18)
Authentication: Required
Request:
{
"amount": 1000
}Response (200 OK):
{
"xdr": "AAAAAgAAAAC...",
"amount": 1000,
"expectedShares": 925,
"currentShareValue": 1.08,
"description": "Deposit $1000 to liquidity pool"
}Withdraw funds from liquidity pool (returns unsigned XDR).
Status: 🔴 Not Implemented (API-19)
Authentication: Required
Request:
{
"shares": 500
}Response (200 OK):
{
"xdr": "AAAAAgAAAAC...",
"shares": 500,
"expectedAmount": 540,
"currentShareValue": 1.08,
"description": "Withdraw 500 shares from liquidity pool"
}Errors:
400: Insufficient shares402: Pool has insufficient available liquidity
List user notifications.
Status: 🔴 Not Implemented (API-23)
Authentication: Required
Query Parameters:
unread(boolean, optional): Filter unread notificationslimit(number, default: 20)offset(number, default: 0)
Response (200 OK):
{
"notifications": [
{
"id": "notif-1",
"type": "loan_reminder",
"title": "Payment Due Soon",
"message": "Your loan payment of $108 is due in 3 days",
"isRead": false,
"createdAt": "2026-02-10T10:00:00.000Z",
"data": {
"loanId": "loan-123",
"amount": 108
}
}
],
"total": 15,
"unreadCount": 5,
"limit": 20,
"offset": 0
}Mark notification as read.
Status: 🔴 Not Implemented (API-24)
Authentication: Required
Response (200 OK):
{
"success": true
}Mark all notifications as read.
Status: 🔴 Not Implemented (API-24)
Authentication: Required
Response (200 OK):
{
"success": true,
"updatedCount": 5
}{
"statusCode": 400,
"message": "Validation failed",
"errors": [
{
"field": "amount",
"message": "Amount must be greater than 0"
}
]
}{
"statusCode": 401,
"message": "Invalid or expired token"
}{
"statusCode": 403,
"message": "Insufficient permissions"
}{
"statusCode": 404,
"message": "Resource not found"
}{
"statusCode": 429,
"message": "Rate limit exceeded. Try again in 60 seconds"
}{
"statusCode": 500,
"message": "Internal server error",
"error": "Unexpected error occurred"
}- Authenticated requests: 100 requests per minute
- Public endpoints: 20 requests per minute
Rate limit headers are included in responses:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1644753600Endpoints that return lists support pagination:
Query Parameters:
limit: Items per page (max 100, default 20)offset: Number of items to skip (default 0)
Response includes:
{
"data": [...],
"total": 150,
"limit": 20,
"offset": 40
}- ROADMAP.md - Implementation status
- Response Standards
- Error Handling
Last Updated: 2026-02-13