Prerequisites: Before implementing crypto transactions, ensure you have:
- A verified Fern developer account with API key configured
- An existing customer account with appropriate KYC verification
- Crypto payment accounts (wallets) for source and destination
Overview
The Fern API enables seamless cryptocurrency transactions between different (supported) tokens and across multiple blockchain networks. This guide walks you through the conceptual flow of executing a crypto-to-crypto transaction.Transaction Types
Fern supports three types of crypto-to-crypto transactions, each serving different use cases: 1. Crypto Transfer: Transfer the same token between different accounts on the same blockchain (e.g., USDC → USDC on Ethereum) 2. Crypto Bridge: Move the same token from one blockchain to another (e.g., USDC from Ethereum → USDC on Solana) 3. Crypto Swap: Exchange one token for another on the same blockchain (e.g., PAXG → USDC on Solana)The API flow remains consistent across all crypto-crypto transaction types - only the request parameters change.For more details on chains/crypto-currencies, check the Coverage : Cryptocurrency & Chain Support
Transaction Flow
1
Set up customer and wallets
Ensure customer exists with required crypto payment accounts
2
Create quote
Lock in the exchange rate for 5 minutes
3
Execute transaction
Create transaction using the quote ID
4
Monitor status
Track transaction until completion
Implementation Guide
Step 1: Prerequisites
Before initiating a transaction, ensure you have:- Customer Account - Create a verified customer following the Customer Creation Guide
- Payment Accounts - Set up crypto wallets as described in the Payment Accounts Guide
A single Fern crypto wallet (EVM/SVM type) can hold multiple tokens across all supported chains
Step 2: Create Quote
Once the user decides to proceed, create a quote to lock in the exchange rate. Quotes are valid for 5 minutes and guarantee the rate during that window. Same-Chain Transfer Example:Source Payment Account Requirements:
sourcePaymentAccountIdis OPTIONAL - omitting it will make our system provide a new temp. wallet address to facilitate the transaction- When provided, it must be a
FERN_CRYPTO_WALLETtype payment account
Destination Payment Account Requirements:
destinationPaymentAccountId: Fern or External crypto wallets payment accounts, can be used
Cross-Chain Bridge Example
Cross-Chain Bridge Example
Moving USDC from Ethereum to Solana (without
sourcePaymentAccountId)Crypto Swap Example
Crypto Swap Example
Swapping PAXG to USDC on Solana (using specific FERN_CRYPTO_WALLET):
Adding Developer Fees (Optional)
Adding Developer Fees (Optional)
You can optionally charge platform fees by including the
developerFee field:The
developerFee field is completely optional. If you don’t want to charge your customers, simply omit this field entirely from your request.Quote Response Fields
Quote Response Fields
id- Unique quote identifier (use this to create transaction)status- Quote status (ACTIVE, EXPIRED, EXECUTED)sourceAmount- Amount to be debiteddestinationAmount- Amount user will receiveexchangeRate- Rate locked for this quotefernFee- Fern’s processing feenetworkFee- Blockchain network feesdeveloperFee- Your platform fee (if configured)expiresAt- Quote expiration timestamp
Step 3: Execute Transaction
After user confirmation, create a transaction using the quote ID: Request Body:correlationId is optional but recommended for tracking transactions in your system.
See the Create Transaction API Reference for details.
Step 4: Monitor Transaction
Track the transaction status to update your user interface accordingly. Transaction statuses include:PENDING- Transaction created, awaiting processingPROCESSING- Transaction in progressCOMPLETED- Transaction successfulFAILED- Transaction failedCANCELLED- Transaction cancelled
Automation
For recurring transactions or dollar-cost averaging strategies, use the Automation Rules API to set up:- Time-based transactions: Execute transactions on a schedule (daily, weekly, monthly)
- Threshold-based transactions: Trigger transactions when certain balance conditions are met
Related Resources
API Reference
Complete API documentation for all endpoints
Customer Creation
Guide for onboarding customers with KYC
Payment Accounts
Managing crypto wallets and external accounts
Supported Currencies
Full list of supported tokens and chains
Support
Use the Support page to contact us.Please include the below details to make it easier for our team to debug the issue:
- quoteId
- transactionId
- customerId