Developer Documentation
Comprehensive guides and API reference for integrating with TURC.SH treasury automation platform.
Platform Overview
TURC.SH provides a comprehensive API suite for treasury automation, risk management, and regulatory compliance. Our platform is designed for financial institutions, corporations, and fintech companies requiring enterprise-grade treasury operations.
Key Features
- Treasury Operations: Automated liquidity management, investment optimization, and cash flow forecasting
- Risk Management: Real-time risk monitoring, stress testing, and compliance validation
- Regulatory Compliance: Automated reporting for SEC, CFTC, FINRA, and international regulators
- Multi-Party Coordination: Seamless integration with counterparties, custodians, and service providers
- Real-Time Processing: Sub-second response times for critical treasury operations
API Architecture
Our RESTful APIs follow industry best practices with JSON data formats, OAuth 2.0 authentication, and comprehensive error handling. All endpoints support HTTPS with TLS 1.3 encryption.
Quick Start Guide
-
Get API Credentials
Contact our sales team to obtain your API key and secret. Sandbox credentials are provided for testing. -
Authentication
Use OAuth 2.0 client credentials flow to obtain an access token for API requests. -
Make Your First Request
Start with a simple GET request to retrieve your treasury positions. -
Explore Advanced Features
Implement webhooks, automated workflows, and real-time risk monitoring.
Authentication
TURC.SH uses OAuth 2.0 with the client credentials grant type for API authentication. All requests must include a valid access token in the Authorization header.
Obtaining an Access Token
POST /oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials
&client_id=your_client_id
&client_secret=your_client_secret
&scope=treasury:read treasury:write risk:read compliance:write
Using the Access Token
GET /api/v1/treasury/positions
Authorization: Bearer your_access_token
Content-Type: application/json
Security Best Practices
Store API credentials securely and rotate them regularly. Access tokens expire after 1 hour and must be refreshed. Never expose credentials in client-side code.
Treasury API Reference
The Treasury API provides access to portfolio positions, market data, and investment operations.
Get Treasury Positions
GET /api/v1/treasury/positions
Response:
{
"positions": [
{
"security_id": "US912828XG97",
"security_name": "US Treasury 2.625% 2025-02-15",
"cusip": "912828XG9",
"quantity": 10000000,
"market_value": 9985420.50,
"accrued_interest": 14583.33,
"yield_to_maturity": 4.125,
"duration": 1.85,
"last_updated": "2025-01-15T14:30:00Z"
}
],
"total_market_value": 127450830.25,
"cash_balance": 2549169.75,
"portfolio_duration": 2.34
}
Execute Treasury Transaction
POST /api/v1/treasury/transactions
Request:
{
"transaction_type": "purchase",
"security_id": "US912828XG97",
"quantity": 5000000,
"price": 99.854,
"settlement_date": "2025-01-17",
"approval_workflow": true
}
Response:
{
"transaction_id": "txn_7f8a9b2c1d3e4f5g",
"status": "pending_approval",
"estimated_settlement_amount": 4992700.00,
"approval_required_by": "2025-01-16T16:00:00Z"
}
Treasury API Endpoints
| Endpoint | Method | Description |
|---|---|---|
| /treasury/positions | GET | Retrieve current portfolio positions |
| /treasury/transactions | POST | Execute treasury transactions |
| /treasury/cash-flows | GET | Forecast future cash flows |
| /treasury/analytics | GET | Portfolio analytics and performance metrics |
Risk Management API
Monitor and manage portfolio risk with real-time metrics, stress testing, and automated alerts.
Get Risk Metrics
GET /api/v1/risk/metrics
Response:
{
"portfolio_metrics": {
"value_at_risk_95": 125000.00,
"expected_shortfall": 178500.00,
"portfolio_duration": 2.34,
"credit_risk_exposure": 0.00,
"concentration_risk": 0.18
},
"compliance_status": {
"overall_status": "compliant",
"duration_limit": {
"current": 2.34,
"limit": 3.00,
"status": "compliant"
},
"concentration_limit": {
"current": 0.18,
"limit": 0.25,
"status": "compliant"
}
},
"last_updated": "2025-01-15T14:30:15Z"
}
Run Stress Test
POST /api/v1/risk/stress-test
Request:
{
"scenario": "interest_rate_shock",
"parameters": {
"rate_change_bps": 200,
"parallel_shift": true,
"effective_date": "2025-01-16"
}
}
Response:
{
"stress_test_id": "st_9k2m5n8p1q4r",
"scenario_pnl": -2450000.00,
"stressed_duration": 2.89,
"impact_by_security": [
{
"security_id": "US912828XG97",
"current_value": 9985420.50,
"stressed_value": 9750380.25,
"pnl": -235040.25
}
]
}
JavaScript SDK
The TURC.SH JavaScript SDK provides a convenient wrapper for our REST APIs with built-in authentication and error handling.
Installation
npm install @turc/treasury-sdk
Basic Usage
import { TurcClient } from '@turc/treasury-sdk';
const client = new TurcClient({
clientId: 'your_client_id',
clientSecret: 'your_client_secret',
environment: 'sandbox' // or 'production'
});
// Get treasury positions
const positions = await client.treasury.getPositions();
// Execute a transaction
const transaction = await client.treasury.executeTransaction({
transactionType: 'purchase',
securityId: 'US912828XG97',
quantity: 5000000,
price: 99.854
});
// Monitor risk metrics
const riskMetrics = await client.risk.getMetrics();
console.log('VaR 95%:', riskMetrics.portfolioMetrics.valueAtRisk95);
TypeScript Support
The JavaScript SDK includes comprehensive TypeScript definitions for type safety and enhanced developer experience.
Support & Resources
Getting Help
- Developer Support: Email us at dev-support@turc.sh
- Technical Documentation: Browse our comprehensive guides and tutorials
- Community Forum: Connect with other developers and share best practices
- Status Page: Monitor API uptime and system status
Service Level Agreements
| Service Tier | Uptime SLA | Response Time | Support Level |
|---|---|---|---|
| Sandbox | 99.0% | < 500ms | Community |
| Production | 99.9% | < 100ms | 24/7 Enterprise |
| Enterprise | 99.95% | < 50ms | Dedicated Support |
Rate Limits
API requests are limited to 1000 requests per minute for standard endpoints and 100 requests per minute for transaction endpoints. Contact us for higher limits.