Overview
The FLEX SSO API uses OAuth 2.0 Authorization Code Flow to securely authenticate customers and grant access to their wallets. This flow ensures that customer credentials never pass through your servers.Authentication Flow
1
Customer Login
User provides PayTag and password
2
Request Auth Code
Your backend calls
/sso/auth-code to get authorization code3
Redirect Customer
Redirect user to the returned URL containing the auth code
4
Exchange for Token
Extract auth code from redirect and exchange it for a customer JWT token
5
Make Authenticated Requests
Use the JWT token in the
Authorization: Bearer header for all wallet operationsRequired Headers
For Partner-Only Endpoints
These endpoints only require partner credentials (PayTag creation, auth flow):string
required
Your partner client identifier
string
required
Your partner API key
For Customer-Authenticated Endpoints
These endpoints require both partner credentials AND customer token (wallet operations):string
required
Your partner client identifier
string
required
Your partner API key
string
required
Customer JWT token in format:
Bearer {token}Step 1: Request Authorization Code
When a customer wants to log in, send their credentials to get an authorization code.The redirect URL is configured during partner onboarding. Contact support to set or update your redirect URLs.
Step 2: Exchange Auth Code for Token
After redirecting the customer and receiving the auth code in your callback endpoint, exchange it for a JWT token.Step 3: Make Authenticated Requests
Use the customer token to access wallet features:Complete Implementation Example
Here’s a complete OAuth flow implementation:Token Management
Token Lifecycle
- Expiration: Customer tokens have a limited lifespan (check with support for exact duration)
- Refresh: Currently, tokens must be re-obtained through the auth flow
- Storage: Store securely server-side, never in client-side storage
Best Practices
Use HTTPS only - Never transmit tokens over unencrypted connections
Server-side storage - Store tokens in encrypted server-side sessions
Token validation - Check for 401 errors and prompt re-authentication
Logout handling - Clear tokens from session when user logs out
Error Responses
400 - Bad Request
400 - Bad Request
Cause: Missing or invalid parametersSolution: Check that all required fields are included and properly formatted
404 - Not Found
404 - Not Found
Cause: Customer PayTag doesn’t existSolution: Guide user to create a PayTag using the PayTag creation flow
Security Considerations
Use Environment Variables
Store partner credentials in environment variables
Implement Rate Limiting
Prevent brute force attacks on login endpoints
Log Security Events
Monitor failed authentication attempts
HTTPS Required
Always use HTTPS in production
Next Steps
PayTag Creation
Learn how to create new customer accounts
Integration Guide
Build complete wallet features
Wallet API
Explore wallet management endpoints
Transactions API
Process payments and transfers
API Reference
OAuth Flow Endpoints
Get Authorization Code
POST /sso/auth-code - Authenticate customer and get authorization codeExchange Token
GET /sso/token - Exchange authorization code for customer JWT tokenPayTag Creation Endpoints
Verify PayTag
GET /sso/verify-tag - Check if a PayTag is availableInitiate Creation
POST /sso/create-tag - Start PayTag creation with BVN verificationSend OTP
GET /sso/{session}/otp - Send OTP for verificationValidate OTP
POST /sso/{session}/otp - Validate OTP codeComplete Creation
POST /sso/create-tag/{session}/complete - Create PayTagGet Session
GET /sso - Get PayTag creation session payloadRequired Headers
Partner Authentication (PayTag Creation):x-client-id: Your partner IDx-api-key: Your partner API key
x-client-id: Your partner IDx-api-key: Your partner API keyAuthorization: Bearer {customer_token}
Complete API Specification: View the full SSO OpenAPI Spec for detailed schemas and all endpoint specifications.