Wallet and Transaction Flow
A comprehensive guide to wallet management and transaction processing in the FinHub platform
Wallet and Transaction Flow
This guide details the complete wallet management and transaction processing flows in the FinHub platform. These processes include retrieving wallet information, processing transactions, and managing transaction history.
Flow Overview
The following sequence diagram illustrates the wallet and transaction processes:
Detailed API Flow
Step 1: Get Customer Wallets
The first step is to retrieve the customer’s wallet information.
API Request:
Request Body:
Response:
Implementation Notes:
- The system returns all wallets associated with the customer
- Each wallet includes its current balance and available balance
- Wallet types can be FIAT or CRYPTO
- The wallet address is used for transactions
Step 2: Get Transaction History
Customers can view their transaction history across all wallets or filtered by specific criteria.
API Request:
Request Body:
Response:
Implementation Notes:
- The response includes pagination information
- Transactions can be filtered by date range, type, and search term
- Each transaction includes detailed information about the source and destination
- The total count helps with pagination implementation
Step 3: Process Transaction Fee
Before initiating a transaction, the system calculates any applicable fees.
API Request:
Request Body:
Response:
Implementation Notes:
- Fees vary based on transaction type, amount, and destination
- The system provides a breakdown of the fee calculation
- The total amount includes the transaction amount plus fees
- Some transaction types may have zero fees
Step 4: Process Transaction Limit
The system validates that the transaction does not exceed any applicable limits.
API Request:
Request Body:
Response:
Implementation Notes:
- The system checks multiple limit types (daily, monthly, per transaction)
- If any limit is exceeded, the transaction is rejected
- Limits may vary based on customer tier and KYC status
- The response includes remaining limits for customer information
Step 5: Two-Factor Authentication (if required)
For security, certain transactions require two-factor authentication.
API Request to send verification code:
Request Body:
Response:
API Request to verify code:
Request Body:
Response:
Implementation Notes:
- 2FA is typically required for transactions above certain thresholds
- The verification code is valid for a limited time (usually 10 minutes)
- The customer can request a new code if needed
- After successful verification, the transaction can proceed
Step 6: Send Funds (Create Order)
After all validations, the system processes the transaction.
API Request:
Request Body:
Response:
Implementation Notes:
- For SEPA transfers, the beneficiary IBAN is required
- The system creates an order and a transaction record
- Initial status is PROCESSING
- The estimated completion time varies by transaction type
Step 7: Get Order Details
After initiating a transaction, the customer can check its status.
API Request:
Request Body:
Response:
Implementation Notes:
- The order status can be PROCESSING, COMPLETED, FAILED, or CANCELLED
- If the order fails, a reason is provided
- The response includes all details about the transaction
- The system updates the status in real-time
Transaction Types
The platform supports several transaction types:
- Deposit: Adding funds to a wallet from an external source
- Withdrawal: Transferring funds from a wallet to an external account
- Internal Transfer: Moving funds between wallets owned by the same customer
- External Transfer: Sending funds to another customer or external account
- SEPA Transfer: Sending funds to an external IBAN account
- Currency Exchange: Converting funds from one currency to another
Error Handling
The transaction process includes comprehensive error handling for various scenarios:
Error Scenario | Error Code | Description |
---|---|---|
Insufficient funds | INSUFFICIENT_FUNDS | The wallet does not have enough funds for the transaction |
Limit exceeded | LIMIT_EXCEEDED | The transaction exceeds the customer’s limits |
Invalid beneficiary | INVALID_BENEFICIARY | The beneficiary information is invalid |
Invalid IBAN | INVALID_IBAN | The provided IBAN is not valid |
Transaction rejected | TRANSACTION_REJECTED | The transaction was rejected by the system |
2FA verification failed | 2FA_VERIFICATION_FAILED | The 2FA verification was unsuccessful |
Wallet inactive | WALLET_INACTIVE | The source or destination wallet is not active |
Implementation Considerations
When implementing the wallet and transaction flows, consider the following:
- Security: Implement proper authentication and authorization for all transactions
- Idempotency: Ensure transactions are not processed multiple times
- Consistency: Maintain consistent state across all services
- Monitoring: Implement real-time monitoring for transaction processing
- Compliance: Ensure all transactions comply with relevant regulations
- Performance: Optimize for high throughput and low latency
- Resilience: Implement proper error handling and recovery mechanisms
Next Steps
After implementing the wallet and transaction flows, consider: