Overview
Transaction API supports two authentication methods depending on the endpoint you’re using:- JWT Authentication - For user account operations
- API Key Authentication - For payment and merchant operations
JWT Authentication
JWT tokens are used for user account operations like registration, login, and profile management.Getting a JWT Token
1
Register or Login
Use the
/auth/register or /auth/login endpoints to get a JWT token.2
Include in Headers
Add the token to the
Authorization header:Example
API Key Authentication
API keys are used for payment processing and merchant operations.API Key Types
Public Key
Format:
pk_*Used for:- Creating payments
- Public operations
Secret Key
Format:
sk_*Used for:- Merchant operations
- Wallet management
- Webhook logs
Getting API Keys
- Log in to your dashboard
- Navigate to API Keys section
- Copy your public and secret keys
Example
Token Expiration
JWT Tokens
- Expire after 24 hours
- Use
/auth/loginto get new token - No refresh token mechanism
API Keys
- Do not expire
- Can be regenerated from dashboard
- Regeneration invalidates old keys
Security Best Practices
1
Store Keys Securely
Use environment variables or secure key management systems.
2
Use HTTPS
Always make requests over HTTPS to protect credentials.
3
Rotate Keys Regularly
Regenerate API keys periodically for enhanced security.
4
Monitor Usage
Check your dashboard for unusual API activity.
Error Handling
Common authentication errors:| Error Code | Status | Description |
|---|---|---|
UNAUTHORISED | 401 | Invalid or missing authentication |
INVALID_CREDENTIALS | 401 | Invalid login credentials |
RATE_LIMITED | 429 | Too many authentication attempts |
Rate Limits: Authentication endpoints are limited to 5 requests per minute to prevent brute force attacks.