Overview
HOST Pay uses API Key authentication for all API requests. Each application has separate credentials for Test Mode and Live Mode to ensure secure development and production workflows.API Credentials
Every application has two sets of credentials:Test Mode Credentials
For development and testing - uses sandbox services
Live Mode Credentials
For production - processes real transactions
- API Key: Identifies your application
- Secret Key: Authenticates your requests
Making Authenticated Requests
Include both keys in the request headers:Credential Management
Generating Credentials
Credential Lifecycle
- Active: Credential is valid and can authenticate requests
- Disabled: Credential has been revoked and cannot be used
- Expired: Credential has reached its expiration date (if set)
Best Practices
Use Environment Variables
Use Environment Variables
Store credentials in environment variables, never hardcode them:
Rotate Keys Regularly
Rotate Keys Regularly
Generate new credentials periodically and revoke old ones:
- Generate new credentials
- Update your application
- Test with new credentials
- Revoke old credentials
Use Different Keys Per Environment
Use Different Keys Per Environment
Maintain separate credentials for:
- Development
- Staging
- Production
Monitor Credential Usage
Monitor Credential Usage
Check the
last_used timestamp in the dashboard to identify unused or compromised credentials.Security Considerations
Do’s ✅
- ✅ Store credentials in environment variables
- ✅ Use HTTPS for all API requests
- ✅ Rotate keys regularly
- ✅ Revoke compromised keys immediately
- ✅ Use separate credentials per environment
- ✅ Monitor credential usage
Don’ts ❌
- ❌ Commit keys to version control
- ❌ Share keys via email or chat
- ❌ Log keys in application logs
- ❌ Use production keys in development
- ❌ Expose keys in client-side code
- ❌ Reuse keys across applications
Handling Authentication Errors
401 Unauthorized
This error occurs when credentials are missing or invalid:- Missing
api-keyorsecret-keyheader - Incorrect credential values
- Using revoked credentials
- Using expired credentials
- Verify your credentials in the dashboard
- Check for typos in the header names
- Ensure credentials haven’t been revoked
403 Forbidden
This error occurs when you don’t have permission:- Trying to access resources from another application
- Using test credentials to access live resources (or vice versa)
- Accessing admin-only endpoints with application credentials
- Use the correct credentials for the environment
- Verify you’re accessing resources in your application’s schema
Example: Complete Authentication Flow
Testing Authentication
You can verify your credentials are working:Need Help?
If you’re experiencing authentication issues:Check Credentials
Verify your credentials in the dashboard
Contact Support
Reach out if issues persist