Implementation Guide
This guide walks you through integrating the Strails API from initial setup to processing your first transaction.Prerequisites
Before you begin, ensure you have:- API Key - Received via secure onboarding email from Strails
- Development Environment - Staging endpoint for testing
- Webhook Endpoint - (Optional but recommended) HTTPS endpoint to receive notifications
- Test Data - Valid Nigerian BVN for testing user onboarding
New to Strails? Contact support@stablesrail.io to start the onboarding process and receive your API credentials.
Step 1: Test Your API Connection
Start by verifying your API key works correctly.Get Your Fintech Wallet
Success! If you see your wallet addresses, your API key is working correctly.
Step 2: Configure Webhook (Recommended)
Set up your webhook endpoint to receive real-time notifications about transaction status.Set Webhook URL
Webhook Handler Example (Node.js)
Step 3: Onboard Your First User
3.1 Onboard User with BVN Verification
3.2 Check Onboarding Status
BVN Verification Time: Typically completes in 2-5 seconds. If status is still
pending_verification, wait a few seconds and retry.Step 4: Fund a User Wallet
4.1 Initiate Onramp (Funding Request)
The/cngnonramp endpoint creates a wallet, generates a virtual bank account, and initiates the funding process.
What happens next: A virtual bank account is generated (active for 30 minutes). Use the
requestId to retrieve account details via /getvirtualaccount.4.2 Get Virtual Account Details (Optional)
Retrieve the bank account details to display to your user:- User pays ₦5,075 to the generated virtual account
- System receives deposit → mints cNGN to user’s wallet
- Auto-swap cNGN → USDC/T via Aerodrome DEX (if
autoSwap: true) - Display cNGN → USDC/T quote on onramp status
- Execute quote returned
- Webhook notification sent on completion
- USDC arrives in user’s wallet
4.3 Check Transaction Status
Step 5: Process User Withdrawal (Offramp)
5.1 Get Supported Banks
5.2 Initiate Offramp to User’s Bank Account
5.3 Check Offramp Status
Step 6: FX Trading (Fintech-to-Fintech)
6.1 Create Orderbook Entry
6.2 Get FX Quote
6.3 Execute Trade
Common Integration Patterns
Pattern 1: Simple Wallet Funding
Pattern 2: Wallet Funding with Auto-Swap
Pattern 3: Fintech Liquidity Management
Testing Tips
Use the Postman Collection
- Download the Postman Collection
- Import into Postman
- Set environment variables:
BASE_URL:https://beta.stablesrail.io/v1API_KEY: Your API key
- Run the collection to test all endpoints
Test with Small Amounts
Start with small amounts (₦100-500) to validate your integration before processing larger transactions.Monitor Webhook Logs
Use tools like webhook.site or ngrok to test webhooks locally during development.Troubleshooting
Authentication Errors
Error:401 Unauthorized or 403 Forbidden
Solutions:
- Verify API key is correct
- Check header name is
x-api-key(lowercase) - Ensure your IP is in the allowlist (if enabled)
Rate Limit Errors
Error:429 Too Many Requests
Solutions:
- Implement exponential backoff
- Review rate limits
- Contact support for higher limits
BVN Verification Fails
Error:BVN verification failed
Solutions:
- Verify BVN is 11 digits
- Check user details match BVN exactly
Transaction Stuck in Pending
Problem: Transaction status remainspending for >10 minutes
Solutions:
- Check transaction status via
/cngnonrampstatus - Trigger manual recovery:
GET /v1/manualstatusrecovery?requestId=YOUR_REQUEST_ID - Contact support if issue persists
Webhook Not Receiving Events
Solutions:- Verify webhook URL is accessible (HTTPS required)
- Check webhook signature validation logic
- Test webhook with webhook.site
- Review webhook documentation
Security Best Practices
- Never expose API keys - Use environment variables, never commit to git
- Validate webhook signatures - Always verify HMAC signatures
- Use HTTPS - All API calls and webhooks must use HTTPS
- Implement IP allowlisting - Restrict API access to known IPs
- Store requestIds - Log all
requestIdvalues for transaction tracking - Handle idempotency - Check for duplicate webhook events using
requestId
Next Steps
Now that you’ve completed the basic integration:- Configure Fee Management - Set custom fees for your users
- Enable Advanced Features - Set up auto-swap and sweep-to-offramp
- Production Launch Checklist:
- Configure production webhook URL
- Set up IP allowlist
- Test with small real transactions
- Monitor webhook delivery
- Set up error alerting
Support
Need help? Reach out to:- Email: support@stablesrail.io
- Documentation: This site
- API Status: Check authentication.md for service updates
Last updated: April 2026