Skip to main content
This guide walks you through a complete Strails integration, from your first API call to executing an FX trade. Follow the steps in order - each one builds on the previous.
Before you start, make sure you have:
  • A Strails API key (contact support@strails.co to obtain one)
  • An HTTPS webhook endpoint you control (use webhook.site or ngrok during development)
  • A test BVN (11-digit Nigerian BVN) for user onboarding tests
1

Test Your API Connection

Verify your API key and confirm you can reach the staging environment by retrieving your fintech wallet.
Expected response:
If you see your Smart Wallet address, your API key is valid and you are connected to the test environment. Save data.smartWallet.address - you will reference it throughout the integration. See Wallet Management for the full response schema.
This endpoint returns your Smart Wallet and registered external wallets only. Your MPC Vault token wallets are returned by GET /fx/settings once MPC registration is approved, and Managed Wallets are provisioned per user - retrieve them with POST /listuserwallets.
The header name must be x-api-key in lowercase. Headers named X-API-Key or api-key will return 401 Unauthorized.
2

Configure Your Webhook

Register your webhook URL so Strails can notify you when asynchronous operations complete. This is strongly recommended before you proceed - without it you will need to poll every status endpoint manually.
Set up your handler to verify the HMAC signature on every incoming request:
Deduplicate on the X-Webhook-ID header - a retried delivery repeats the same event. Full verification details and a Python version are on the HMAC Signatures page.
Return 200 OK before doing any processing. If your handler takes too long to respond, Strails will retry the delivery, causing duplicate events.
3

Onboard Your First User

Register a user with BVN verification. Strails verifies the BVN against Nigerian records and creates a wallet for the user.Initiate onboarding:
bvn is the only field this endpoint accepts. The user’s identity is resolved from the BVN record and Strails issues the user identifier itself - you do not supply one.
Response:
Check onboarding status by posting the requestId you just received:
Successful verification response:
Poll until status is "completed" or "failed", or listen for the user.onboarded webhook event instead of polling. Once complete, use the returned userId for every subsequent call for this user.
Optional: route the user’s cNGN to an external addressOnboarding provisions a Strails-managed wallet that receives the user’s cNGN. If the user self-custodies, or you settle into your own treasury addresses, register an external destination with POST /setuserdefaultwallet:
This redirects virtual account mints, onramps, and sweepToOfframp transfers. Swaps, offramp, and escrow still run against the Strails-managed wallet, so keep balance there for those flows. Call DELETE /removeuserdefaultwallet to revert.
4

Fund a User Wallet

Initiate an onramp to generate a virtual bank account and fund the user’s wallet with cNGN (optionally auto-swapped to USDC or USDT).The /cngnonramp endpoint accepts three parameters that control what happens after NGN is deposited. Use the table below to choose the combination that matches your product:Initiate the onramp:
Response (with fee breakdown):
Retrieve the virtual account details to show your user:
Response:
Virtual accounts expire 30 minutes after creation. Display the expiresAt time prominently to your user so they complete the transfer before the window closes.
Check the onramp status after payment:
Completed response:
Note that amount in the completed response is in the smallest unit (wei format): 5000000000 = 5,000 cNGN at 6 decimals. See Amount Formats for conversion details.
5

Process a Withdrawal (Offramp)

Convert a user’s cNGN back to Naira and send it to their Nigerian bank account.Get the list of supported banks:
Response:
/getbankscode is a POST endpoint that takes no request body. Cache the result - the bank list changes rarely and the call counts against your rate limit.
Initiate the offramp:
Response:
Check the offramp status:
Listen for the vault.return.payout.completed webhook event to confirm the bank transfer has settled - a user offramp emits vault.return.transfer.confirmed first (cNGN moved on-chain), then vault.return.payout.completed. Store the requestId from every offramp so you can query its status if the user disputes a withdrawal.
6

Execute an FX Trade

Post an order to the cNGN/USDC/USDT orderbook, get a quote, and execute the trade.Create an orderbook entry:
Response:
Get an FX quote (POST, with the cNGN amount as a human-readable decimal):
The quote response includes a quoteId and is valid for 5 minutes. Pass the quoteId directly to the trade endpoint.Execute the trade:
After execution, tokens from both sides are held in escrow and settlement completes automatically.
FX trades do not emit webhook events. Poll GET /fx/trades/status?tradeId=... until the trade reaches completed, expired, or failed. The lock window is 5 minutes.
FX amounts are human-readable decimals, not wei - "price": "1350.00" means 1,350 cNGN per USDC and "minAmount": "1000" means 1,000 cNGN. See Orderbook Management and Trading Management for every field.

Common Integration Patterns

Simple Wallet Funding Onboard a user -> generate a virtual account -> user pays NGN -> cNGN is disbursed to their wallet. Use this pattern when your users just need a cNGN balance. Wallet Funding with Auto-Swap Set "autoSwap": true and "assetSwap": "USDC" on the onramp request. After the NGN deposit is received, Strails mints cNGN and immediately swaps it to USDC via fx order in StRails orderbook - no extra API calls required. Use this pattern for products where users want USD-denominated stablecoins. Fintech Liquidity Management Post a limit order on the FX orderbook -> wait for a match -> confirm the trade quote -> execute. Escrow settles the counterparty automatically. Use this pattern to rebalance your fintech’s cNGN and USDC/USDT pools.

Testing Tips

  • Use Postman: Import the Strails Postman collection, set BASE_URL to https://api.strails.io/v1 and API_KEY to your key, then run the collection to exercise all endpoints.
  • Start small: Test onramp and offramp flows with amounts between ₦100 and ₦500 before increasing transaction sizes.
  • Inspect webhooks locally: Use webhook.site for a hosted listener, or ngrok to tunnel to your local machine during development.

Troubleshooting