API Documentation
Integrate VerPay into your application.
Introduction
Welcome to the definitive open-source verification engine for Ethiopian fintech. This API allows businesses and developers to programmatically verify the authenticity of customer payments, completely automating checkout flows and preventing fraud from fake receipt generators. Built with extreme reliability in mind, the engine officially supports core providers with 99.9% uptime.
Getting Started
1. Database Setup (Supabase)
- Create a new project at Supabase.
- Navigate to the SQL Editor in your Supabase dashboard.
- Copy the contents of
supabase/migrations/001_init.sqland run it to create theapi_keysandusage_logstables. - Go to Project Settings > API to find your URL and Service Role Key.
2. Local Setup
git clone https://github.com/RobiAbebe/payment-verifier.git
cd payment-verifier
npm install
cp .env.example .envEdit the .env file with your actual keys:
SUPABASE_URL=https://your-project-id.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
ADMIN_KEY=your-secure-admin-password
MISTRAL_API_KEY=your-mistral-ai-key
# TELEBIRR_PROXY_URL=http://your-ethiopian-proxy.com:8080
PORT=3001AI Image Verification
Have a screenshot instead of text? Send the base64 image! The system automatically detects QR codes for precision, uses Mistral AI for OCR data extraction, and instantly validates the findings directly with the bank!
Request Body
{
"image": "base64_encoded_string_here...",
"autoVerify": true
}Provider Endpoints
Send your verification requests directly to the standalone provider endpoints below.
CBE
The modern JSON-based CBE API verification. This is significantly faster than the legacy endpoint and does not require a suffix parameter, making it ideal for modern application integrations.
/verify-cbev2- followed by a long alphanumeric string. Case-sensitive.{
"reference": "v2-hfHCxz6TmMYrTUfWldzb"
}Telebirr
Verification for Ethio Telecom's massive mobile money service. This endpoint is extremely robust but requires Ethiopian IP addresses to function without proxy interference.
/verify-telebirrAG3HF92K10).{
"reference": "AG3HF92K10"
}Admin Endpoints
To generate or retrieve API keys, use the /admin/api-keys endpoints passing your x-admin-key header (which corresponds to your ADMIN_KEY env variable).
Generate a new secure API key for a client.
curl -X POST https://api.yourdomain.com/admin/api-keys \
-H "x-admin-key: your-secure-admin-password" \
-H "Content-Type: application/json" \
-d '{"owner": "My Production App"}'Retrieve a list of all active generated API keys to monitor usage.
curl -X GET https://api.yourdomain.com/admin/api-keys \
-H "x-admin-key: your-secure-admin-password"Vercel Deployment
This project is configured out-of-the-box for serverless deployment on Vercel.
- Install the Vercel CLI:
npm i -g vercel - Run
verceland link your project. - Add your environment variables using
vercel env add. - Deploy to production:
vercel --prod
Troubleshooting
1 Telebirr Proxy Errors
Telebirr blocks non-Ethiopian IPs. If you are developing locally, you might need to comment out the proxy variables in
.env. If you deploy outside Ethiopia (e.g., Vercel US), you will need a working residential Ethiopian proxy to ping their APIs.2 Mistral API Errors
Ensure your account is active and you are passing a clean Base64 string (without the
data:image/jpeg;base64,prefix) if calling the API directly. The built-in frontend handles this automatically.