API Key Authentication
All API requests must be authenticated using your API key. You can find your API keys in the Payviox Dashboard under the Developer section.API Key Types
Payviox provides two types of API keys for different integration scenarios:Public API Key
For client-side / SDK integration
- Used in browser via JavaScript SDK
- Client IP is automatically captured from the request
- Safe to expose in frontend code
- Ideal for: websites, single-page apps
Secret API Key
For server-side integration
- Used from your backend server
- Allows providing client IP manually via
ipparameter - Must NEVER be exposed in client-side code
- Ideal for: APIs, mobile backends, server apps
When to use which key?
| Use Case | Key Type | IP Handling |
|---|---|---|
| JavaScript SDK in browser | Public Key | Auto-captured |
| Direct API call from frontend | Public Key | Auto-captured |
| Backend creates session for user | Secret Key | Provide via ip param |
| Mobile app via backend | Secret Key | Provide via ip param |
| Server-to-server integration | Secret Key | Optional ip param |
When using the Secret API Key, you can optionally provide the end-user’s IP address using the
ip parameter in the Create Session request. If provided, this IP will be validated when the user completes payment to prevent fraud.Using the API Playground
Each endpoint in this documentation includes an interactive playground where you can test API calls directly from your browser.Get Your API Key
Copy your API key from the Payviox Dashboard
How to Authenticate
Include your API key in theAuthorization header of each request:
Example Request
API Key Management
Getting Your API Keys
- Log in to your Payviox Dashboard
- Navigate to Developer > API Keys
- Copy your keys:
- Public API Key: For frontend/SDK integration
- Secret API Key: For backend/server-side integration
Regenerating API Keys
If your API key has been compromised, you can regenerate it from the dashboard:Error Responses
If authentication fails, you’ll receive one of the following responses:Missing Authorization Header
Invalid API Key
Expired API Key
Best Practices
Use Environment Variables
Store your API keys in environment variables, never hardcode them
Different Keys for Different Environments
Use separate API keys for development, staging, and production
Rotate Keys Regularly
Periodically regenerate your API keys for enhanced security
Monitor Usage
Keep track of your API usage in the dashboard