Overview
The Mercata Backend API provides DeFi functionality including token management, lending, swapping, and rewards.
Base URL
https://<node-host>/apiAuthentication
All endpoints require OAuth 2.0 Bearer token authentication unless marked as public.
Authorization: Bearer <access_token>Swagger Interactive Docs
For full swagger documentation of the backend API, with an interactive Try it Out interface, please visit https://app.testnet.strato.nexus/api/docs/ or visit /api/docs on your preferred node.
API Reference
Overview
/user
User management
/tokens
Token operations (v1)
/tokens/v2
Token operations (v2)
/vouchers
Voucher balance
/config
Platform configuration
/oracle
Price oracle
/swap/*
Token swapping
/lending
Lending protocol
/events
Event queries
/bridge
Cross-chain bridge
/cdp
Collateralized Debt Positions
/rewards
Rewards distribution
/protocol-fees
Protocol fee management
/docs
Swagger documentation
/health
Health check
Modules
Token management and operations.
GET
/tokens
List all tokens
GET
/tokens/:address
Get token details
POST
/tokens/create
Create new token
POST
/tokens/transfer
Transfer tokens
POST
/tokens/approve
Approve spending
GET
/tokens/v2/balances
Get user balances (v2)
GET
/vouchers/balance
Get voucher balance
DeFi lending protocol operations.
GET
/lending/pools
List lending pools
GET
/lending/pools/:id
Get pool details
POST
/lending/deposit
Deposit collateral
POST
/lending/withdraw
Withdraw collateral
POST
/lending/borrow
Borrow assets
POST
/lending/repay
Repay loan
GET
/lending/positions
Get user positions
GET
/lending/health
Get health factor
Liquidity pool and AMM operations.
GET
/swap/pools
List liquidity pools
GET
/swap/pools/:id
Get pool details
POST
/swap/addLiquidity
Add liquidity
POST
/swap/removeLiquidity
Remove liquidity
GET
/swap/quote
Get swap quote
POST
/swap/execute
Execute swap
Cross-chain asset transfer.
GET
/bridge/supported
List supported chains
GET
/bridge/status/:id
Get transfer status
POST
/bridge/initiate
Start bridge transfer
POST
/bridge/claim
Claim bridged assets
Collateralized Debt Positions.
GET
/cdp/vaults
List user vaults
GET
/cdp/vaults/:id
Get vault details
POST
/cdp/open
Open new vault
POST
/cdp/deposit
Deposit collateral
POST
/cdp/withdraw
Withdraw collateral
POST
/cdp/borrow
Generate debt
POST
/cdp/repay
Repay debt
POST
/cdp/close
Close vault
Rewards and incentive distribution.
GET
/rewards/pools
List reward pools
GET
/rewards/pending
Get pending rewards
POST
/rewards/stake
Stake tokens
POST
/rewards/unstake
Unstake tokens
POST
/rewards/claim
Claim rewards
Platform administration (admin only).
GET
/config
Get platform config
POST
/config
Update platform config
GET
/protocol-fees
Get fee configuration
POST
/protocol-fees/collect
Collect protocol fees
Price feed operations.
GET
/oracle/prices
Get all prices
GET
/oracle/price/:token
Get token price
POST
/oracle/update
Update price (admin)
Events
Event and history queries.
GET
/events
Query events
GET
/events/:type
Get events by type
Common Patterns
Pagination
limit
number
20
Items per page
offset
number
0
Skip items
Filtering
Sorting
Response Format
Success Response
Error Response
Common Error Codes
UNAUTHORIZED
401
Missing or invalid token
FORBIDDEN
403
Insufficient permissions
NOT_FOUND
404
Resource not found
VALIDATION_ERROR
400
Invalid request parameters
INSUFFICIENT_BALANCE
400
Not enough tokens
STRATO_ERROR
500
Blockchain transaction failed
CIRRUS_ERROR
500
Database query failed
Health Check
Response:
Swagger Documentation
Interactive API documentation is available at:
OpenAPI spec available at:
Related Documentation
Last updated