Skip to main content

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:
  1. API Key - Received via secure onboarding email from Strails
  2. Development Environment - Staging endpoint for testing
  3. Webhook Endpoint - (Optional but recommended) HTTPS endpoint to receive notifications
  4. 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

Expected Response:
Success! If you see your wallet addresses, your API key is working correctly.
Authentication Failed? Double-check your API key and ensure you’re using the correct header: x-api-key (not X-API-Key or api-key).

Set up your webhook endpoint to receive real-time notifications about transaction status.

Set Webhook URL

Webhook Handler Example (Node.js)

See also: Webhook Events Reference

Step 3: Onboard Your First User

3.1 Onboard User with BVN Verification

Response:

3.2 Check Onboarding Status

Successful Verification:
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.
Response:
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:
Response:
Account Expiry: Virtual accounts expire 30 minutes after creation. Users must complete payment before expiry.
Payment Flow:
  1. User pays ₦5,075 to the generated virtual account
  2. System receives deposit → mints cNGN to user’s wallet
  3. Auto-swap cNGN → USDC/T via Aerodrome DEX (if autoSwap: true)
  4. Display cNGN → USDC/T quote on onramp status
  5. Execute quote returned
  6. Webhook notification sent on completion
  7. USDC arrives in user’s wallet

4.3 Check Transaction Status

Response (Completed):

Step 5: Process User Withdrawal (Offramp)

5.1 Get Supported Banks

Response:

5.2 Initiate Offramp to User’s Bank Account

Response:

5.3 Check Offramp Status


Step 6: FX Trading (Fintech-to-Fintech)

6.1 Create Orderbook Entry

Response:

6.2 Get FX Quote

6.3 Execute Trade

See also: FX Orderbook Guide | Trading Guide

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

  1. Download the Postman Collection
  2. Import into Postman
  3. Set environment variables:
    • BASE_URL: https://beta.stablesrail.io/v1
    • API_KEY: Your API key
  4. 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 remains pending for >10 minutes Solutions:
  1. Check transaction status via /cngnonrampstatus
  2. Trigger manual recovery: GET /v1/manualstatusrecovery?requestId=YOUR_REQUEST_ID
  3. Contact support if issue persists

Webhook Not Receiving Events

Solutions:

Security Best Practices

  1. Never expose API keys - Use environment variables, never commit to git
  2. Validate webhook signatures - Always verify HMAC signatures
  3. Use HTTPS - All API calls and webhooks must use HTTPS
  4. Implement IP allowlisting - Restrict API access to known IPs
  5. Store requestIds - Log all requestId values for transaction tracking
  6. Handle idempotency - Check for duplicate webhook events using requestId

Next Steps

Now that you’ve completed the basic integration:
  1. Configure Fee Management - Set custom fees for your users
  2. Enable Advanced Features - Set up auto-swap and sweep-to-offramp
  3. 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:
Last updated: April 2026