API Documentation
Welcome to Alsamiflexi Pro API documentation. This guide will help you integrate mobile recharge services into your application.
All API endpoints require authentication using an API key.
Authentication
All API requests must include your API key in the header:
Authorization: Bearer YOUR_API_KEY
You can obtain your API key from the dashboard after signing up.
Base URL
https://pro.alsamiflexi.com/api/v1
API Endpoints
Check Balance
Get your current account balance.
/balance
curl -X GET https://pro.alsamiflexi.com/api/v1/balance \
-H "Authorization: Bearer YOUR_API_KEY"
Response (200 OK):
{
"success": true,
"data": {
"balance": 50000.00,
"currency": "BDT"
}
}
Get Available Operators
Retrieve a list of available mobile operators.
/operators
curl -X GET https://pro.alsamiflexi.com/api/v1/operators \
-H "Authorization: Bearer YOUR_API_KEY"
Response (200 OK):
{
"success": true,
"data": [
{
"id": 1,
"name": "Grameenphone",
"code": "GP",
"min_amount": 10,
"max_amount": 1000
},
{
"id": 2,
"name": "Robi",
"code": "ROBI",
"min_amount": 10,
"max_amount": 1000
}
]
}
Process Mobile Recharge
Submit a mobile recharge request.
/recharge
Request Body:
{
"operator_id": 1,
"mobile_number": "01712345678",
"amount": 100,
"reference": "YOUR_REFERENCE_ID"
}
curl -X POST https://pro.alsamiflexi.com/api/v1/recharge \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operator_id": 1,
"mobile_number": "01712345678",
"amount": 100,
"reference": "YOUR_REFERENCE_ID"
}'
Response (200 OK):
{
"success": true,
"data": {
"transaction_id": "TXN123456789",
"status": "processing",
"mobile_number": "01712345678",
"amount": 100,
"operator": "Grameenphone",
"reference": "YOUR_REFERENCE_ID",
"created_at": "2025-12-27 10:30:00"
}
}
Check Transaction Status
Check the status of a recharge transaction.
/transaction/{transaction_id}
curl -X GET https://pro.alsamiflexi.com/api/v1/transaction/TXN123456789 \
-H "Authorization: Bearer YOUR_API_KEY"
Response (200 OK):
{
"success": true,
"data": {
"transaction_id": "TXN123456789",
"status": "completed",
"mobile_number": "01712345678",
"amount": 100,
"operator": "Grameenphone",
"reference": "YOUR_REFERENCE_ID",
"created_at": "2025-12-27 10:30:00",
"completed_at": "2025-12-27 10:30:15"
}
}
Error Handling
The API uses standard HTTP status codes and returns error details in JSON format:
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 402 | Payment Required - Insufficient balance |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
Error Response Format:
{
"success": false,
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Your account balance is insufficient for this transaction"
}
}
Rate Limits
API rate limits vary by package:
Starter
60 requests/minute
Business
120 requests/minute
Enterprise
Custom limits
Rate limit headers are included in each response for monitoring.
Webhooks
Configure webhook URLs in your dashboard to receive real-time notifications for transaction updates.
Webhook Payload Example:
{
"event": "transaction.completed",
"data": {
"transaction_id": "TXN123456789",
"status": "completed",
"mobile_number": "01712345678",
"amount": 100,
"operator": "Grameenphone",
"reference": "YOUR_REFERENCE_ID",
"completed_at": "2025-12-27 10:30:15"
},
"timestamp": "2025-12-27T10:30:15Z"
}
SDKs & Libraries
We provide official SDKs for popular programming languages:
PHP SDK
composer require pitor/recharge-api
Node.js SDK
npm install @pitor/recharge-api
Python SDK
pip install pitor-recharge-api
Java SDK
Coming soon...
Need Help?
Our support team is here to help you integrate our API successfully.