All API requests must include a valid access token in the Authorization header
otherwise stated.
Authentication Flow
User Roles & Permissions
MANAGER
- Plugins management
- Agent configuration
- KYC/AML configuration
- Analytics and reporting
- Process transaction refunds.
- Organisation user management
- Crossboarder setup & operations
AGENT
- Call-over reports
- Corridor management
- View customer profiles
- Transaction status updates
- Exchange rate and fee markups
- Tenant-specific analytics and reporting
CASHIER
- Print receipts
- Process payments
- Create transactions
- Handle cash collections
- View transaction history
- Verify transaction details
CUSTOMER
- Request quotes
- Initiate transfers
- Create beneficiaries
- View own transactions
- View transaction history
- Update profile information
Server-to-Server Authentication
FinCode supports server-to-server authentication using JWT tokens, allowing your systems to interact programmatically with the API. This ensures secure, stateless communication for backend integrations. For comprehensive details on securing your integration, including best practices for managing credentials, please refer to the Security section.API Token Authentication
For backend services and integrations that require simpler, long-lived authentication, FinCode provides API Tokens. These tokens are generated from your dashboard and allow you to call authenticated endpoints without going through the login flow.API Tokens are ideal for server-to-server communication, scheduled jobs, and automated processes where the standard login flow is impractical.
Key Features
- Custom Expiry: Choose from 24 hours, 1 month, 3 months, 6 months, or 1 year
- Multiple Tokens: Create separate tokens for different services or environments
- Full Control: Rotate, invalidate, or delete tokens anytime from your dashboard
Using API Tokens
Include the token in theX-Auth-Token header:
Learn More
For complete details on API tokens, encryption keys, and when to use each, see the Encryption Keys and Tokens guide.
Interactive Authentication Testing
Test authentication for different user roles in your sandbox environment. Select a role to see the appropriate login request and response.- MANAGER
- AGENT
- CASHIER
- CUSTOMER
Manager Authentication
Managers have full access to all platform features and administrative functions.Login Request:Making Authenticated Requests
Once authenticated, include the access token in all subsequent API requests:Authorization: Bearer {access_token}- Your JWT access tokenX-Auth-Token: {api_token}- Your JWT access tokenContent-Type: application/json- For POST/PUT requestsplatform: fincode- For identifying request platformuuid: 200- Unique uuid string
Token Management
Token Expiration
Access tokens expire after 1 hour. You have two options to maintain authentication:- Refresh Token
- Auto-Refresh
Use the refresh token to obtain a new access token without re-authentication:Response:
Token Revocation
Revoke tokens when logging out or if compromised:Security Best Practices
Secure Storage
- Store tokens in secure, httpOnly cookies for web apps
- Use secure storage mechanisms on mobile (Keychain/KeyStore)
- Never store tokens in localStorage or sessionStorage
- Encrypt tokens at rest in your backend
Token Rotation
- Rotate refresh tokens after each use - Implement token expiration monitoring
- Set up automatic token refresh - Handle token refresh failures gracefully
Network Security
- Always use HTTPS in production
- Implement certificate pinning for apps
- Use secure communication channels
- Monitor for man-in-the-middle attacks
Access Control
- Follow principle of least privilege
- Regularly audit user permissions
- Implement session timeout
- Log all authentication attempts
Role Permission Matrix
Error Handling
403 Forbidden
403 Forbidden
Causes:
- Insufficient permissions for the requested resource
- Role doesn’t have access to the endpoint
- Attempting to access another user’s data
Next Steps
Encryption Keys & Tokens
Learn about payload encryption and API token authentication
Webhooks
Set up real-time notifications for authentication events
Security
Deep dive into FinCode’s security architecture
Go Live
Complete your integration and go live!
