Authentication
All API requests to Zentra must be authenticated using API keys. This guide explains how to obtain and use your API keys securely.API Keys
Zentra uses API keys to authenticate requests. You can obtain your API keys from the Developer Console.Key Types
Secret Key
Format:
sk_sandbox_... or sk_live_...Used for server-side API calls. Never expose this in client-side code!Public Key
Format:
pk_sandbox_... or pk_live_...Can be used in client-side code for specific operations like initializing payments.Environments
Zentra provides two environments:| Environment | Purpose | Key Prefix |
|---|---|---|
| Sandbox | Testing and development | sk_sandbox_, pk_sandbox_ |
| Live | Production transactions | sk_live_, pk_live_ |
Making Authenticated Requests
Include your API key in theAuthorization header using Bearer authentication:
Example Requests
The examples below intentionally use reviewed transfer endpoints rather than draft customer or wallet surfaces.
Keeping Your Keys Safe
Do's
Do's
- Store keys in environment variables
- Use different keys for development and production
- Rotate keys regularly
- Use a secrets manager (AWS Secrets Manager, Azure Key Vault, etc.)
- Restrict API key permissions to only what’s needed
- Monitor API usage for unusual activity
❌ Don'ts
❌ Don'ts
- Never commit keys to version control
- Don’t hardcode keys in your application
- Don’t share keys via email or chat
- Don’t use production keys in development
- Don’t expose secret keys in client-side code
- Don’t share keys across multiple applications
Environment Variables
Store your API keys in environment variables:Error Responses
If authentication fails, you’ll receive a401 Unauthorized response:
| Error Code | Description | Solution |
|---|---|---|
unauthorized | Invalid or missing API key | Check your API key is correct |
invalid_key | Malformed API key | Ensure key format is correct |
expired_key | API key has been revoked | Generate a new API key |
wrong_environment | Using sandbox key on live endpoint | Use the correct environment key |
API Key Management
Rotating Keys
To rotate your API keys:- Generate a new key in the Developer Console
- Update your application with the new key
- Test thoroughly
- Revoke the old key
We recommend rotating keys every 90 days as a security best practice.
Revoking Keys
If you suspect a key has been compromised:- Go to Dashboard → API Keys
- Click Revoke next to the compromised key
- Generate and deploy a new key immediately
Key Permissions
You can create API keys with limited permissions:- Read-only: Only GET requests
- Write: POST, PUT, PATCH, DELETE requests
- Admin: Full access including sensitive operations
IP Whitelisting (Optional)
For additional security, you can whitelist IP addresses:- Go to Dashboard → Security
- Add your server IP addresses
- Save changes
Rate Limiting
API keys are subject to rate limits:| Environment | Limit |
|---|---|
| Sandbox | 100 requests/minute |
| Live (Basic) | 1,000 requests/minute |
| Live (Pro) | 10,000 requests/minute |
Next Steps
Make Your First Request
Follow our quickstart guide
API Reference
Explore all available endpoints
Error Handling
Learn about error responses
Webhooks
Set up webhook authentication