Authentication
The PayHero Africa API uses HTTP Basic authentication.
Get your API key
Section titled “Get your API key”- Sign in to your PayHero dashboard.
- Generate an API key — this gives you a username and password pair.
- Store them securely as environment variables. Never commit them or expose them in client-side code.
These map to the Postman variables X-PH-API-USERNAME and X-PH-API-PASSWORD.
Send credentials
Section titled “Send credentials”Pass the username and password as Basic auth credentials on every authenticated request:
curl https://api.payhero.africa/api/global/accounts/{vendor_id}/balance \ -u "$PH_API_USERNAME:$PH_API_PASSWORD"The -u flag builds the header for you. Equivalently:
Authorization: Basic base64(<API_USERNAME>:<API_PASSWORD>)
