Authentication
Learn how to authenticate with the Notch Pay API
Authentication
All requests to the Notch Pay API must be authenticated. This guide explains the authentication methods available and how to implement them securely.
API Keys
Notch Pay uses API keys to authenticate requests. You can find your API keys in your Notch Pay Business suite under Settings > API Keys.
Test API Keys: Used for development and testing. These keys contain test_
prefix.
All transactions made with test API keys don’t affect your live data and are only visible in test mode.
Test API Keys: Used for development and testing. These keys contain test_
prefix.
All transactions made with test API keys don’t affect your live data and are only visible in test mode.
Live API Keys: Used for production environments.
Only use these keys when your application is ready for real transactions.
Authentication Methods
For most API requests, you need to include your API key in the Authorization
header:
Example Request
For most API requests, you need to include your API key in the Authorization
header:
Example Request
For operations related to synchronized accounts, you need to pass the sync account identifier in the X-Sync
header:
Example Request with Sync Authentication
API Key Security
Keep API Keys Private
Use Environment Variables
Use environment variables or secure vaults to store API keys in your applications.
Implement Access Controls
Implement proper access controls to limit who can access your API keys.
Only give access to team members who absolutely need it.
Rotate Keys Regularly
Rotate your API keys periodically, especially if you suspect they may have been compromised.
You can generate new API keys in your Notch Pay dashboard.
Use Test Keys for Development
Use test API keys for development and testing to avoid accidental charges.
Switch to live keys only when you’re ready to process real transactions.
Error Responses
Best Practices
Use HTTPS
Always use HTTPS to encrypt your API requests and prevent man-in-the-middle attacks.
Never send API requests over unencrypted HTTP connections.
Proper Error Handling
Handle authentication errors gracefully in your application.
Implement retry logic with exponential backoff for transient errors.
Limit API Key Exposure
Only share API keys with trusted systems and developers.
Consider using different API keys for different services or environments.
Monitor API Usage
Regularly review your API logs to detect unauthorized access.
Set up alerts for unusual API activity patterns.
Implement Rate Limiting
Protect your API endpoints from brute force attacks by implementing rate limiting.
Consider using a service like Redis to track and limit request rates.