Developer Resources
Everything you need to integrate our mobile recharge API into your applications. Comprehensive SDKs, documentation, and code samples for all major programming languages.
Quick Start
Get up and running with our API in minutes. Choose your preferred language and start building.
1. Get Your API Key
Sign up for a free account and get your API key instantly. Start with our sandbox environment for testing.
API Endpoints
Code Examples
Get started quickly with these code examples for different programming languages
Basic Recharge Request
JavaScript
const iRecharge = require('irechargebd-sdk');
const client = new iRecharge.Client({
apiKey: 'your-api-key',
environment: 'sandbox' // or 'production'
});
async function recharge() {
try {
const result = await client.recharge({
operator: 'grameenphone',
phone: '01712345678',
amount: 100
});
console.log('Recharge successful:', result);
} catch (error) {
console.error('Recharge failed:', error.message);
}
}
Async Recharge with Error Handling
Python
import asyncio
from irechargebd import AsyncClient
async def recharge():
client = AsyncClient(
api_key='your-api-key',
environment='sandbox'
)
try:
result = await client.recharge(
operator='grameenphone',
phone='01712345678',
amount=100
)
print(f"Recharge successful: {result}")
except Exception as e:
print(f"Recharge failed: {e}")
finally:
await client.close()
asyncio.run(recharge())
Laravel Integration
PHP
<?php
use IRechargeBD\Client;
class RechargeController extends Controller
{
public function recharge(Request $request)
{
$client = new Client([
'api_key' => config('irecharge.api_key'),
'environment' => config('app.env') === 'production' ? 'production' : 'sandbox'
]);
try {
$result = $client->recharge([
'operator' => 'grameenphone',
'phone' => $request->phone,
'amount' => $request->amount
]);
return response()->json($result);
} catch (Exception $e) {
return response()->json(['error' => $e->getMessage()], 400);
}
}
}
Testing Environment
Test your integration with our comprehensive sandbox environment before going live
Sandbox Environment
Our sandbox environment allows you to test all API endpoints without making real transactions. Perfect for development and testing.
No Real Transactions
Test without spending real money or affecting real accounts
Realistic Responses
Get realistic API responses that match production behavior
Error Simulation
Test error handling with simulated failure scenarios
API Testing Tool
Documentation
Comprehensive documentation to help you integrate our API successfully
Ready to Start Building?
Join thousands of developers who are already using our API to build amazing mobile recharge applications.