- Encryption Keys - Public/private key pairs for encrypting sensitive data in API payloads
- API Tokens - Long-lived authentication tokens for server-to-server communication
Encryption Keys
Overview
When integrating with FinCode, you may need to send sensitive information such as passwords, PINs, or other secrets. To protect this data during transmission, we provide RSA public key encryption.Your public and private key pair is automatically generated when your organization is onboarded and is always available on the settings area of your dashboard.
How It Works
Key Management
Access Keys
Your encryption keys are available on your dashboard underSettings → API Connections → Encryption Keys.
Key Rotation
You can rotate your key pair at any time from the dashboard.After rotation, the previous keys are immediately invalidated.
When to Use Encryption
Encrypt any sensitive fields before including them in your API request payload:| Field Type | Examples | Encryption Required |
|---|---|---|
| Passwords | currentPassword, newPassword | ✅ Yes |
| PINs | transactionPin, userPin | ✅ Yes |
| Security Answers | securityAnswer | ✅ Yes |
| Regular Data | email, firstName, amount | ❌ No |
Implementation
The encryption uses RSA with OAEP padding (SHA-256). Here’s a quick reference:- Obtain your RSA public key from the dashboard (Base64 encoded)
- Decode the Base64 key into an RSA PublicKey object
- Initialize the cipher with
RSA/ECB/OAEPWithSHA-256AndMGF1Padding - Encrypt the plaintext and Base64-encode the result
- Send the encrypted value in your API request
- Java
- JavaScript
- Python
- C#
Download Full Encryption Guide
Download our comprehensive encryption guide with detailed code sample and best practices.
API Tokens
Overview
For server-to-server integrations, FinCode provides long-lived API tokens that allow you to authenticate without going through the login flow. These tokens are generated from your dashboard and can be used directly in API requests.API tokens are different from the JWT access tokens received from the login endpoint. They provide a simpler authentication method for backend services.
Token vs JWT Authentication
| Feature | API Token | JWT (Login) |
|---|---|---|
| Obtained from | Dashboard | Login endpoint |
| Expiry options | 24 hours, 1 month, 3 months, 6 months, 1 year | 1 hour (with refresh) |
| Use case | Server-to-server, scheduled jobs, integrations | User sessions, real-time apps |
| Rotation | Manual from dashboard | Automatic via refresh token |
| Multiple tokens | ✅ Yes (different services) | ❌ No |
Token Management
Create a Token
Navigate to Settings → API Connections → API Tokens on your dashboard. Click Create New Token and select your desired expiry period.
Set Expiry
Choose from the available expiry options:
- 24 Hours – For temporary or testing purposes
- 1 Month – Short-term integrations
- 3 Months – Standard integrations
- 6 Months – Extended integrations
- 1 Year – Long-term production services
Cashier Email & Password
Enter cashier email and password. You’d need this for generating any token.
Copy and Store
Copy the generated token immediately. For security, the full token is only shown once.
Token Operations
Create
Create multiple tokens for different services or environments (dev, staging, production).
Rotate
Generate a new token to replace an existing one without service interruption.
Invalidate
Immediately revoke or delete a token if compromised or no longer needed.
Using API Tokens
Include your API token in theX-Auth-Token header:
Best Practices
Use Environment Variables
Use Environment Variables
Never hardcode API tokens in your source code. Store them in environment variables or a secrets manager.
Use Different Tokens per Service
Use Different Tokens per Service
Create separate tokens for each service or environment. This limits the blast radius if a token is compromised.
FINCODE_TOKEN_PROD– Production servicesFINCODE_TOKEN_STAGING– Staging environmentFINCODE_TOKEN_CRON– Scheduled jobs
Monitor Token Usage
Monitor Token Usage
Regularly review which tokens are active and when they were last used. Revoke unused or dormant tokens.
Plan for Rotation
Plan for Rotation
Set reminders before tokens expire. Implement graceful rotation to avoid service interruptions.
Summary
| Feature | Encryption Keys | API Tokens |
|---|---|---|
| Purpose | Protect sensitive payload data | Authenticate API requests |
| Location | Dashboard → API Connections → Encryption Keys | Dashboard → API Connections → API Tokens |
| Rotation | Available anytime | Available anytime |
| When to use | Sending passwords, PINs, secrets | Server-to-server calls, webhooks, etc |
