Overview
This guide provides a comprehensive walkthrough for implementing the Stable Sea Terminal API in production. It covers the complete order flow from authentication to settlement, including security, monitoring, error handling, and best practices. Each step includes curl and Python SDK examples — use the tabs to switch between them.SDK Quickstart
Install and use the Python SDK
Authentication
API key auth (curl & SDK)
Step-by-Step Integration
Follow these steps to implement the complete order flow from organization creation to settlement:Authentication
All API requests require Bearer token authentication. Your API key serves as the bearer token.
Replace
YOUR_API_KEY with your actual API key. Store this securely and never expose it in client-side code.Create Organization
Create an organization entity to associate with your orders and payment instruments.Response:
Create External Payment Instruments
Set up both payin and payout payment methods for your organization.Create Payin Payment Instrument (USDC Solana Address):Create Payout Payment Instrument (COP Bank Account):USDC Solana Address Response:COP Bank Account Response:
Check Liquidity Providers
Get available liquidity providers with their trading pairs and operating hours.Response:
Get Current Exchange Rate (Optional)
Optionally fetch current exchange rates to display to end users. This is useful for showing indicative rates before creating formal quotes.Response:
Exchange rates are indicative and may change frequently. For guaranteed rates, use the quote endpoint to lock in a rate for order execution.
Create Offerings
Generate available payment corridors and rates for your organization.Response:
Offerings contain indicative rates and fees. Final rates are locked when creating quotes.
Monitor Order Status
Track your order through the complete settlement lifecycle.Order Status Progression:
STEP_1_AWAITING_FUNDING- Waiting for payin fundsSTEP_2_FILLING_FX- Executing foreign exchangeSTEP_3_SETTLING_PAYOUT- Processing payout settlementSTEP_4_COMPLETED- Order successfully completed
Poll the order status endpoint periodically to monitor order progress. Consider implementing exponential backoff between polling requests.
Production Considerations
API Key Security
- Store API keys in environment variables, not code
- Use different keys for sandbox and production
- Rotate keys regularly for security
- Use secret management services (AWS Secrets Manager, HashiCorp Vault)
- Always use HTTPS/TLS 1.3 for API communications
- Implement proper access controls and audit logging
Error Handling
Monitoring
- Track order success rates and settlement times
- Monitor API response times and error rates
- Set up alerts for high error rates or slow responses
- Log all API interactions with correlation IDs
- Use structured logging with JSON format
- Monitor quote-to-order conversion rates
- Track performance by payment method and currency pair
- Set up dashboards for real-time order flow visibility

