The Easypay API uses API Key authentication to secure server-to-server requests.
All API requests must include two HTTP headers:
AccountId: <YOUR_ACCOUNT_ID>
ApiKey: <YOUR_API_KEY>These credentials authenticate your application and authorize access to your Easypay account resources.
To create credentials for your account:
- Log in to your Easypay account
- Follow this guide to generate your API keys
For development and testing, you can use these credentials:
AccountId: 2b0f63e2-9fb5-4e52-aca0-b4bf0339bbe6
ApiKey: eae4aa59-8e5b-4ec2-887d-b02768481a92Important:
- These credentials only work in the test environment
- They will not work in production
- Never use production credentials in your test environment
When authentication headers are missing or incorrect, the API returns a 403 Forbidden HTTP status code.
Missing Headers
{
"status": "error",
"message": "Authentication Error: Missing AccountId or ApiKey headers"
}Invalid Credentials
{
"status": "error",
"message": "Authentication Error: Invalid AccountId or ApiKey"
}Account Blocked
{
"status": "error",
"message": "Authentication Error: Your account has been blocked"
}Insufficient Permissions
{
"status": "error",
"message": "Authentication Error: Insufficient permissions for this action"
}Here's an example of a properly authenticated request:
curl -L -X GET 'https://api.test.easypay.pt/2.0/single/5eca7446-14e9-47bb-aabb-5ee237159b8b' \
-H 'AccountId: 2b0f63e2-9fb5-4e52-aca0-b4bf0339bbe6' \
-H 'ApiKey: eae4aa59-8e5b-4ec2-887d-b02768481a92'- Keep Credentials Secret: Never expose your API keys in client-side code, public repositories, or logs
- Use Environment Variables: Store credentials in environment variables, not in your source code
- Rotate Keys Regularly: Periodically regenerate your API keys
- Use Different Keys: Use separate keys for test and production environments
- Monitor Usage: Regularly review API usage logs for suspicious activity
- Environments - Learn about test and production environments
- Error Handling - Handle authentication and other errors
- Quick Start - Make your first authenticated API call