Authentication
The Peex Platform API uses secret key authentication to secure all API requests. Each request must include a valid secret key in the request headers.
Secret Key Authentication
To access the Peex API resources, you will need to use an access token (SECRETKEY). These secret keys must be set in your HTTP request header.
Your secret key will be sent by mail for sandbox and production environments.
Request Headers
Include your secret key in every API request using the SECRETKEY header:
SECRETKEY: ########-####-####-####-############
Content-Type: application/json
Example cURL Request
Authenticate with Peex API
curl -X GET \
https://sandbox.peexit.com/api/v1/clients/me \
-H 'SECRETKEY: ########-####-####-####-############' \
-H 'Content-Type: application/json'
Example JavaScript Request
JavaScript fetch example
const response = await fetch('https://sandbox.peexit.com/api/v1/clients/me', {
method: 'GET',
headers: {
'SECRETKEY': '########-####-####-####-############',
'Content-Type': 'application/json'
}
});
Environment Keys
The Peex Platform provides different keys for different environments:
Sandbox Environment
- Base URL:
https://sandbox.peexit.com/api/v1/ - Secret Key: Provided by email
- Amount Limitation: Fixed at 10 FCFA for all operations
Production Environment
- Base URL:
https://server.peexit.com/api/v1/(when available) - Secret Key: Provided by email upon approval
- Amount Limitation: Real amounts as specified in requests
Security Best Practices
Keep Your Keys Secure
- Never expose your secret keys in client-side code
- Store keys as environment variables
Handle Authentication Errors
When authentication fails, the API returns a 401 Unauthorized status code:
Authentication error response
{
"error": {
"statusCode": 401,
"name": "UnauthorizedError",
"message": "The key provided doest not exists in our system"
}
}
This means you have not provided a correct secret key, or your secret key is wrong.
Environment Variables Example
.env configuration
# .env file
PEEX_SANDBOX_KEY=your-sandbox-key-here
PEEX_PRODUCTION_KEY=your-production-key-here
PEEX_BASE_URL=https://sandbox.peexit.com/api/v1/
Important: Just set the secret key as an HTTP header when calling the API. No additional authentication steps are required.